import { HTTPPath, ORPCError } from '@orpc/client'; import { Meta } from '@orpc/contract'; import { Interceptor } from '@orpc/shared'; import { StandardResponse, StandardLazyRequest } from '@orpc/standard-server'; import { C as Context, R as Router, b as AnyRouter, A as AnyProcedure, d as ProcedureClientInterceptorOptions } from './server.qKsRrdxW.js'; interface StandardHandlerPlugin { order?: number; init?(options: StandardHandlerOptions, router: Router): void; } declare class CompositeStandardHandlerPlugin> implements StandardHandlerPlugin { protected readonly plugins: TPlugin[]; constructor(plugins?: readonly TPlugin[]); init(options: StandardHandlerOptions, router: Router): void; } type StandardParams = Record; type StandardMatchResult = { path: readonly string[]; procedure: AnyProcedure; params?: StandardParams; } | undefined; interface StandardMatcher { init(router: AnyRouter): void; match(method: string, pathname: HTTPPath): Promise; } interface StandardCodec { encode(output: unknown, procedure: AnyProcedure): StandardResponse; encodeError(error: ORPCError): StandardResponse; decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise; } interface StandardHandleOptions { prefix?: HTTPPath; context: T; } type StandardHandleResult = { matched: true; response: StandardResponse; } | { matched: false; response: undefined; }; interface StandardHandlerInterceptorOptions extends StandardHandleOptions { request: StandardLazyRequest; } interface StandardHandlerOptions { plugins?: StandardHandlerPlugin[]; /** * Interceptors at the request level, helpful when you want catch errors */ interceptors?: Interceptor, Promise>[]; /** * Interceptors at the root level, helpful when you want override the request/response */ rootInterceptors?: Interceptor, Promise>[]; /** * * Interceptors for procedure client. */ clientInterceptors?: Interceptor, Meta>, Promise>[]; } declare class StandardHandler { private readonly matcher; private readonly codec; private readonly interceptors; private readonly clientInterceptors; private readonly rootInterceptors; constructor(router: Router, matcher: StandardMatcher, codec: StandardCodec, options: NoInfer>); handle(request: StandardLazyRequest, options: StandardHandleOptions): Promise; } export { CompositeStandardHandlerPlugin as C, StandardHandler as f }; export type { StandardCodec as S, StandardParams as a, StandardHandleOptions as b, StandardHandleResult as c, StandardHandlerInterceptorOptions as d, StandardHandlerOptions as e, StandardHandlerPlugin as g, StandardMatchResult as h, StandardMatcher as i };