import type { TemplatedApp } from 'uWebSockets.js'; import type { AnyRouter } from '@trpc/server'; import { type NodeHTTPCreateContextFnOptions, type NodeHTTPCreateContextOption } from '@trpc/server/adapters/node-http'; import { type HTTPBaseHandlerOptions } from '@trpc/server/http'; import { HttpResponseDecorated } from './fetchCompat'; import { WebSocketConnection } from './websockets'; export interface CreateHandlerOptions { /** * Url path prefix where the tRPC server will be registered. * @default '' */ prefix?: string | undefined; /** * Specify if SSL is used. Set to true if your application is served over HTTPS. * @default false */ ssl?: boolean | undefined; /** * Maximum request body size in bytes. If the body is larger than this, the request will be aborted. * Null value allows for unlimited body size. * @default null */ maxBodySize?: number | undefined; trpcOptions: HandlerOptions; } export type CreateContextOptions = NodeHTTPCreateContextFnOptions & { /** * Client must be passed along when the context is created. **/ client?: WebSocketConnection | undefined; }; /** * Applies tRPC request handler to uWebSockets app. * @param app - The uWebSockets application. * @param opts - Options for configuring the tRPC request handler. */ export declare function applyRequestHandler(app: TemplatedApp, opts: CreateHandlerOptions): void; export type HandlerOptions = HTTPBaseHandlerOptions & NodeHTTPCreateContextOption; type RequestHandlerOptions = HandlerOptions & { req: TRequest; res: TResponse; path: string; }; export declare function uWsRequestHandler(opts: RequestHandlerOptions): Promise; export {};