提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

9 lines
788 B

import * as birpc from 'birpc';
import { EventOptions, BirpcOptions } from 'birpc';
import { WebSocketServer } from 'vite';
import { ViteHotContext } from 'vite-hot-client';
declare function createRPCServer<ClientFunction extends object, ServerFunctions extends object>(name: string, ws: WebSocketServer, functions: ServerFunctions, options?: EventOptions<ClientFunction>): birpc.BirpcGroupReturn<ClientFunction>;
declare function createRPCClient<ServerFunctions extends object, ClientFunctions extends object>(name: string, hot: ViteHotContext | undefined | Promise<ViteHotContext | undefined>, functions?: ClientFunctions, options?: Omit<BirpcOptions<ServerFunctions>, 'on' | 'post'>): birpc.BirpcReturn<ServerFunctions, ClientFunctions>;
export { createRPCClient, createRPCServer };