import { MaybePromise } from '@whatwg-node/promise-helpers'; import type { ServerAdapterPlugin } from './types.cjs'; export type CORSOptions = { origin?: string[] | string; methods?: string[]; allowedHeaders?: string[]; exposedHeaders?: string[]; credentials?: boolean; maxAge?: number; } | false; export type CORSPluginOptions = CORSOptionsFactory | CORSOptions | boolean; export type CORSOptionsFactory = (request: Request, ...args: {} extends TServerContext ? [serverContext?: TServerContext | undefined] : [serverContext: TServerContext]) => MaybePromise; export declare function getCORSHeadersByRequestAndOptions(request: Request, corsOptions: CORSOptions): Record | null; export declare function useCORS(options?: CORSPluginOptions): ServerAdapterPlugin;