import { HttpResponse, HttpRouter, httpWorkflow } from '@deepkit/http';
export declare const CorsHeaders: unique symbol;
export declare class HttpCorsOptionsMulti {
    readonly options: HttpCorsOptions[];
    constructor(options: HttpCorsOptions[]);
}
export declare class HttpCorsOptions {
    hosts: (string | RegExp)[];
    paths?: (string | RegExp)[];
    methods?: string[];
    credentials?: boolean;
    allowHeaders?: string[];
    exposeHeaders?: string[];
}
export declare class HttpCors {
    static getResponseHeaders(response: HttpResponse): Record<string, string> | undefined;
}
export declare class HttpCorsDescriptor {
    readonly options: HttpCorsOptions;
    cachedPreflightHeaders: Record<string, string>;
    cachedResponseCorsHeaders: Record<string, string>;
    constructor(options: HttpCorsOptions);
}
export declare class HttpCorsListener {
    protected router: HttpRouter;
    protected corsOptionsMulti: HttpCorsOptionsMulti;
    descriptors: HttpCorsDescriptor[];
    constructor(router: HttpRouter, corsOptionsMulti: HttpCorsOptionsMulti);
    onRoute(event: typeof httpWorkflow.onRoute.event): Promise<void>;
    routeNotFound(event: typeof httpWorkflow.onRouteNotFound.event): Promise<void>;
    onResponse(event: typeof httpWorkflow.onResponse.event): Promise<void>;
    private findMatchingDescriptor;
    private getCorsPreflightHeaders;
    private getCorsResponseHeaders;
}
//# sourceMappingURL=cors.d.ts.map