import { A as AllServerSettingsType, k as Middleware, B as BaseRouter, M as MethodTypes, a4 as HandlerType, a5 as RouterOptionsType, S as ServerAdapter, i as ServerlessAdapter, a6 as HandlerForServerless } from '../index-BMSbpSmF.js'; import { S as ServerDomain } from '../index-DfNwNCa_.js'; import '@palmares/core'; import '../status-RlKnv8eR.js'; import '../response/utils.js'; import '@palmares/core/dist/src/index-CkvPmDl3'; declare function loadServer(args: { settings: AllServerSettingsType; commandLineArgs: { keywordArgs: { port?: number; }; positionalArgs: object; }; domains: ServerDomain[]; }): Promise; /** * By default we don't know how to handle the routes by itself. Pretty much MethodsRouter does everything * that we need here during runtime. So we pretty much need to extract this data "for free". */ declare function getRootRouterCompletePaths(domains: ServerDomain[], settings: AllServerSettingsType['servers'][string], isDebugModeEnabled?: boolean): Promise; options?: RouterOptionsType; }; }; }>>; /** * Responsible for wrapping the handler and the middlewares into a single function that will be called when a * request is made to the server. * * The server adapter is responsible for passing the data it needs to be able to safely translate the request * and response during it's lifecycle. * * @param method - The method that was extracted from the router. * @param middlewares - The middlewares that will be applied to the request. * @param queryParams - The query params that were extracted from the router. * @param urlParams - The url params that were extracted from the router. * @param handler - The handler that will be called when the request is made. * @param server - The server adapter that was selected. * @param handler500 - The handler500 that was set on the settings so we can handle errors. */ declare function wrapHandlerAndMiddlewares(method: MethodTypes, middlewares: Middleware[], queryParams: BaseRouter['__queryParamsAndPath']['params'], urlParams: BaseRouter['__urlParamsAndPath']['params'], handler: HandlerType, options: RouterOptionsType | undefined, server: ServerAdapter | ServerlessAdapter, customServerInstance: any, handler500?: AllServerSettingsType['servers'][string]['handler500'], validation?: AllServerSettingsType['servers'][string]['validation']): (serverRequestAndResponseData: any) => Promise; declare function generateServerlessHandler(settings: AllServerSettingsType['servers'][string], allSettings: AllServerSettingsType, serverName: string, domainName: string, method: MethodTypes | 'all', path: string, pathOfHandler: { pathOfHandler: string; }): HandlerForServerless; /** * A generator that will yield all of the routers that were extracted from the domains and the settings. * Used for {@link ServerRouterAdapter.parseHandlers} function. */ declare function getAllRouters(domains: ServerDomain[], settings: AllServerSettingsType['servers'][string], allSettings: AllServerSettingsType, serverAdapter: ServerAdapter | ServerlessAdapter, customServerInstance: any, options?: { serverless?: { generate: boolean; use: { method: MethodTypes; route: string; }; }; }): AsyncGenerator<{ translatedPath: string; handlers: Map; options?: RouterOptionsType["customOptions"]; }>; queryParams: Map; } | { translatedPath: string; handlers: Map; options?: RouterOptionsType["customOptions"]; }>; queryParams: Map; }, void, unknown>; /** * A generator that will yield all of the routers that were extracted from the domains and the * settings. Used for {@link ServerRouterAdapter.parseHandler} function. */ declare function getAllHandlers(domains: ServerDomain[], settings: AllServerSettingsType['servers'][string], serverAdapter: ServerAdapter | ServerlessAdapter): AsyncGenerator<{ path: string; method: string; options: undefined; handler: (serverRequestAndResponseData: any) => Promise; partsOfPath: { part: string; isUrlParam: boolean; }[]; queryParams: Map; urlParams: Map; }, void, unknown>; declare function wrap404HandlerAndRootMiddlewares(serverAdapter: ServerAdapter | ServerlessAdapter, customServerInstance: any, middlewares: Middleware[], handler404: AllServerSettingsType['servers'][string]['handler404'], handler500: AllServerSettingsType['servers'][string]['handler500']): (serverRequestAndResponseData: any) => Promise; /** * This will initialize all of the routers in sequence, it'll extract all of the routes from all of * the domains and initialize them on the server. */ declare function initializeRouters(customServerInstance: any, domains: ServerDomain[], settings: AllServerSettingsType['servers'][string], allSettings: AllServerSettingsType, serverAdapter: ServerAdapter | ServerlessAdapter, options?: { serverless?: { generate?: boolean; /** An object that contains data for when running serverless functions */ use?: { /** Gets the method from the request, should be lower cased */ getMethod: () => string; /** Gets the path route from the request */ getRoute: () => string; /** The data to send to the request during the request / response lifecycle */ requestAndResponseData?: any; }; }; }): Promise; export { getAllHandlers, getAllRouters, getRootRouterCompletePaths, initializeRouters, loadServer, wrap404HandlerAndRootMiddlewares };