提交学习笔记专用
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

  1. import * as birpc from 'birpc';
  2. import { EventOptions, BirpcOptions } from 'birpc';
  3. import { WebSocketServer } from 'vite';
  4. import { ViteHotContext } from 'vite-hot-client';
  5. declare function createRPCServer<ClientFunction extends object, ServerFunctions extends object>(name: string, ws: WebSocketServer, functions: ServerFunctions, options?: EventOptions<ClientFunction>): birpc.BirpcGroupReturn<ClientFunction>;
  6. 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>;
  7. export { createRPCClient, createRPCServer };