import type { NitroEventHandler } from 'nitropack'; import type { ServerFnHandlerModule } from './get-server-fn-handlers'; /** * Nitro virtual-module id for the generated server-function dispatch handler. * Referenced from `nitroConfig.handlers` and provided via `nitroConfig.virtual`. */ export declare const SERVER_FN_DISPATCH_VIRTUAL = "#ANALOG_SERVER_FN_DISPATCH"; /** The single transport route all server functions dispatch through. */ export declare const SERVER_FN_DISPATCH_ROUTE = "/_analog/fn/:id"; /** URL prefix of that route, for matching requests before the id is known. */ export declare const SERVER_FN_DISPATCH_PREFIX = "/_analog/fn/"; /** * The Nitro handler registration for the server-function dispatch route. * Unlike page endpoints (one handler per file), every server function shares * this one `/_analog/fn/:id` route; the id selects the function at runtime. * * The route is fixed and NOT `/api`-prefixed: client proxies always call the * absolute `/_analog/fn/:id` URL, so an `/api` prefix (as page endpoints use) * would leave the handler unreachable in apps that have an API directory. */ export declare function getServerFnDispatchHandler(): NitroEventHandler; export type BuildServerFnDispatchModuleArgs = { /** Discovered `*.server.ts` modules, imported for registration side-effects. */ modules: ServerFnHandlerModule[]; /** * Absolute path to the app's server config module (`app.config.server.ts`), * which exports the `ApplicationConfig` (as `config`) that `main.server.ts` * renders with. Handlers bootstrap against it, so they see the same DI the * app configured. When absent, handlers run with only `providedIn: 'root'`. */ appConfigModule?: string; }; /** * Generates the source of the Nitro dispatch handler. * * The handler imports every discovered `*.server.ts` module so each * `serverFn(...)` registers itself, imports the app's server config, then on * each request looks up the function by id and runs it via `dispatchServerFn` — * the same call path the validation harnesses exercise. */ export declare function buildServerFnDispatchModule({ modules, appConfigModule, }: BuildServerFnDispatchModuleArgs): string;