/** The vendor's CORS: `origin` `*`, or `echo` (the request's Origin, as a gateway that allows credentials must); the * methods, request headers and exposed headers it allows, each as the header's text; how long a preflight holds. */ export type CorsDecl = { origin: '*' | 'echo'; credentials?: boolean; methods: string; headers: string; expose?: string; maxAge?: number; }; /** The CORS headers an answer to `request` carries under `decl`. */ export declare function corsHeaders(decl: CorsDecl, request: Request): Record; /** `fetch` behind the vendor's CORS: a preflight (OPTIONS) answered 204 with the headers, whatever its path, and every * other answer given the headers it does not set itself. */ export declare function withCors Promise>(decl: CorsDecl, fetch: F): F;