UNPKG

@trpc/server

Version:

The tRPC server library

22 lines 1.33 kB
/** * If you're making an adapter for tRPC and looking at this file for reference, you should import types and functions from `@trpc/server` and `@trpc/server/http` * * @example * ```ts * import type { AnyTRPCRouter } from '@trpc/server' * import type { HTTPBaseHandlerOptions } from '@trpc/server/http' * ``` */ import type { FastifyReply, FastifyRequest } from 'fastify'; import type { AnyRouter } from '../../@trpc/server'; import { type HTTPBaseHandlerOptions } from '../../@trpc/server/http'; import { type NodeHTTPCreateContextOption } from '../node-http'; export type FastifyHandlerOptions<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply> = HTTPBaseHandlerOptions<TRouter, TRequest> & NodeHTTPCreateContextOption<TRouter, TRequest, TResponse>; type FastifyRequestHandlerOptions<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply> = FastifyHandlerOptions<TRouter, TRequest, TResponse> & { req: TRequest; res: TResponse; path: string; }; export declare function fastifyRequestHandler<TRouter extends AnyRouter, TRequest extends FastifyRequest, TResponse extends FastifyReply>(opts: FastifyRequestHandlerOptions<TRouter, TRequest, TResponse>): Promise<void>; export {}; //# sourceMappingURL=fastifyRequestHandler.d.ts.map