/// /** * Subscribe client function calls. * It will be triggered once receiving data from client function call. */ export declare const subscribeClientFunctionCalls: () => void; export declare function transformParams(params: Record | unknown[], socketId: number): void; /** * Transform Parameters. * Create a server side function with mappingId from client if type is 'Function', and save it in a map; * Create an Error instance if type is 'Error'; * Replace field value with created data above. * @param params parameters from rpc client. * @param socketId The ID of websocket. */ export declare function transformPlainObjectParams(params: Record, socketId: number): void; export declare const middleware: >(fn: import("@trpc/server").MiddlewareFunction<{ _config: import("@trpc/server").RootConfig<{ ctx: { socketId: number; req: import("http").IncomingMessage; res: import("ws").WebSocket; }; meta: object; errorShape: import("@trpc/server").DefaultErrorShape; transformer: import("@trpc/server").DefaultDataTransformer; }>; _ctx_out: {}; _input_out: typeof import("@trpc/server").unsetMarker; _input_in: unknown; _output_in: unknown; _output_out: unknown; _meta: object; }, TNewParams>) => import("@trpc/server").MiddlewareBuilder<{ _config: import("@trpc/server").RootConfig<{ ctx: { socketId: number; req: import("http").IncomingMessage; res: import("ws").WebSocket; }; meta: object; errorShape: import("@trpc/server").DefaultErrorShape; transformer: import("@trpc/server").DefaultDataTransformer; }>; _ctx_out: {}; _input_out: typeof import("@trpc/server").unsetMarker; _input_in: unknown; _output_in: unknown; _output_out: unknown; _meta: object; }, TNewParams>; /** * When rpc client wants to request to the rpc server, * it will transform the parameters first, mainly it will transform functions. * The rpc client will create an id to map the id to each function, and then send * the id to the rpc server. * The rpc server received the parameters from rpc client, * it will transform the parameter first too, mainly it will transform the parameter which includes `__type__: 'Function'` * and an mappingId. * it will create a new function and mapped the function to the mappingId from rpc client. * When rpc server want to call functions in rpc client, it will send the mappingId and data back to the rpc client. * The rpc client received the mappingId and the data, it will get the mapped function from cache and then call it with the data. * If the function calling is an event callback, the rpc client will not send back the function result to the rpc server, * otherwise, the rpc client will send back the function result to the rpc server. */ export declare const publicProcedure: import("@trpc/server").ProcedureBuilder<{ _config: import("@trpc/server").RootConfig<{ ctx: { socketId: number; req: import("http").IncomingMessage; res: import("ws").WebSocket; }; meta: object; errorShape: import("@trpc/server").DefaultErrorShape; transformer: import("@trpc/server").DefaultDataTransformer; }>; _meta: object; _ctx_out: { socketId: number; req: import("http").IncomingMessage; res: import("ws").WebSocket; }; _input_in: typeof import("@trpc/server").unsetMarker; _input_out: typeof import("@trpc/server").unsetMarker; _output_in: typeof import("@trpc/server").unsetMarker; _output_out: typeof import("@trpc/server").unsetMarker; }>; export declare const router: (procedures: TProcRouterRecord) => import("@trpc/server").CreateRouterInner, TProcRouterRecord>;