/** * Dynamic CORS Middleware * Intelligently handles CORS based on environment and configuration */ import cors from "cors"; export interface DynamicCorsOptions { /** * Explicitly allowed origins (optional) */ allowedOrigins?: string[]; /** * Port ranges to automatically allow in development */ devPortRanges?: Array<{ start: number; end: number; }>; /** * Common development ports to always allow */ commonDevPorts?: number[]; /** * Whether to allow credentials */ credentials?: boolean; /** * Custom origin validator function */ customValidator?: (origin: string) => boolean; } /** * Creates dynamic CORS middleware that intelligently handles origins */ export declare function createDynamicCors(options?: DynamicCorsOptions): (req: cors.CorsRequest, res: { statusCode?: number | undefined; setHeader(key: string, value: string): any; end(): any; }, next: (err?: any) => any) => void; /** * Simple CORS middleware for production with specific domains */ export declare function createProductionCors(allowedDomains: string[]): (req: cors.CorsRequest, res: { statusCode?: number | undefined; setHeader(key: string, value: string): any; end(): any; }, next: (err?: any) => any) => void; /** * Permissive CORS for development */ export declare function createDevCors(): (req: cors.CorsRequest, res: { statusCode?: number | undefined; setHeader(key: string, value: string): any; end(): any; }, next: (err?: any) => any) => void; export default createDynamicCors; //# sourceMappingURL=cors.d.ts.map