import type { Resolver } from "../hook/event.js";
import { RouterGroup } from "./group.js";
type RouterEvent = Resolver & {
    json: (status: number, body: unknown) => Response;
};
type EventFactoryResult<E extends RouterEvent> = E | {
    event: E;
    cleanup?: () => void | Promise<void>;
};
export type EventFactory<E extends RouterEvent> = (options: {
    request: Request;
    requestUrl?: URL;
    params: Record<string, string>;
    remoteAddress: string | null;
    remoteAddressResolver?: (() => string | null) | null;
    pattern: string;
}) => EventFactoryResult<E>;
export declare class Router<E extends RouterEvent> extends RouterGroup<E> {
    buildHandler(factory: EventFactory<E>, options?: {
        lazyRemoteAddress?: boolean;
        lazyRequestUrl?: boolean;
    }): (req: Request, server?: unknown) => Promise<Response>;
    private resolveRoutes;
    private collectRoutes;
}
export {};
