web 3d图形渲染器
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.

20 lines
906 B

  1. import { EventInterface } from 'microevent.ts';
  2. interface RpcProviderInterface {
  3. dispatch(message: any): void;
  4. rpc<T, U>(id: string, payload?: T, transfer?: Array<any>): Promise<U>;
  5. signal<T>(id: string, payload?: T, transfer?: Array<any>): this;
  6. registerRpcHandler<T, U>(id: string, handler: RpcProviderInterface.RpcHandler<T, U>): this;
  7. registerSignalHandler<T>(id: string, handler: RpcProviderInterface.SignalHandler<T>): this;
  8. deregisterRpcHandler<T, U>(id: string, handler: RpcProviderInterface.RpcHandler<T, U>): this;
  9. deregisterSignalHandler<T>(id: string, handler: RpcProviderInterface.SignalHandler<T>): this;
  10. error: EventInterface<Error>;
  11. }
  12. declare module RpcProviderInterface {
  13. interface RpcHandler<T, U> {
  14. (payload?: T): Promise<U> | U;
  15. }
  16. interface SignalHandler<T> {
  17. (payload?: T): void;
  18. }
  19. }
  20. export default RpcProviderInterface;