alepha
Version:
Alepha is a convention-driven TypeScript framework for building robust, end-to-end type-safe applications, from serverless APIs to full-stack React apps.
27 lines (26 loc) • 1.04 kB
TypeScript
import * as _alepha_core1 from "alepha";
import { ServerRouterProvider } from "alepha/server";
//#region src/providers/ServerCorsProvider.d.ts
declare class ServerCorsProvider {
protected readonly serverRouterProvider: ServerRouterProvider;
options: ServerCorsProviderOptions;
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
isOriginAllowed(origin: string | undefined, allowed: ServerCorsProviderOptions["origin"]): boolean;
}
interface ServerCorsProviderOptions {
origin?: string | string[] | ((origin: string | undefined) => boolean);
methods: string[];
headers: string[];
credentials?: boolean;
maxAge?: number;
}
//#endregion
//#region src/index.d.ts
/**
* Plugin for configuring CORS on the Alepha server.
*/
declare const AlephaServerCors: _alepha_core1.Service<_alepha_core1.Module>;
//#endregion
export { AlephaServerCors, ServerCorsProvider, ServerCorsProviderOptions };
//# sourceMappingURL=index.d.ts.map