import { FastifyRequest, FastifyInstance, FastifyServerOptions } from 'fastify'; import { a as RpcManifest, f as RpcServiceManifest } from '../types-CQ_aexOX.mjs'; import { WextsShieldConfig } from '@wexts/security'; import { IncomingMessage, ServerResponse } from 'http'; type RpcServiceInstances = Record unknown | Promise>>; interface RegisterRpcRoutesOptions { manifest: RpcManifest; services: RpcServiceInstances; authorize?: (request: FastifyRequest, service: RpcServiceManifest, methodName: string) => boolean | Promise; } declare function registerRpcRoutes(fastify: FastifyInstance, options: RegisterRpcRoutesOptions): Promise; interface WextsRuntimeConfig { rootDir?: string; port?: number; host?: string; dev?: boolean; nextDir?: string; nestAppModule?: unknown; nestAppModulePath?: string; rpcManifest?: RpcManifest; rpcManifestPath?: string; rpcServices?: RpcServiceInstances; security?: WextsShieldConfig; logger?: FastifyServerOptions['logger']; } interface WextsRuntimeServer { fastify: FastifyInstance; start: () => Promise; close: () => Promise; } declare function createWextsRuntimeServer(config?: WextsRuntimeConfig): Promise; declare function startWextsRuntime(config?: WextsRuntimeConfig): Promise; /** * Vercel / serverless handler adapter for the Wexts runtime. * * Creates a standard Node.js (req, res) handler that delegates to the * Fastify-backed Wexts runtime **without** calling fastify.listen(). * * Usage: * const handler = await createWextsHandler({ ... }); * export default handler; // Vercel function entry */ type WextsHandler = (req: IncomingMessage, res: ServerResponse) => void; /** * Build a serverless-compatible handler from the Wexts runtime. * The returned function accepts Node http (req, res) and passes them * into the Fastify instance without ever calling listen(). */ declare function createWextsHandler(config?: WextsRuntimeConfig): Promise; export { type RegisterRpcRoutesOptions, type RpcServiceInstances, type WextsHandler, type WextsRuntimeConfig, type WextsRuntimeServer, createWextsHandler, createWextsRuntimeServer, registerRpcRoutes, startWextsRuntime };