Class default<RemoteApi, LocalApi>
Type Parameters
-
RemoteApi extends RpcApi<RemoteApi>
-
LocalApi extends RpcApi<LocalApi>
Constructors
constructor
- new default<RemoteApi, LocalApi>(connection: <internal>.default, onDisconnect: (() => void), methods: WithOrigin<LocalApi>): <internal>.default<RemoteApi, LocalApi>
-
Type Parameters
-
RemoteApi extends RpcApi<RemoteApi>
-
LocalApi extends RpcApi<LocalApi>
Parameters
-
-
onDisconnect: (() => void)
-
Methods
notify
- notify<Name>(name: Name, params: Parameters<RemoteApi[Name]>[0]): void
-
Type Parameters
-
Name extends string | number | symbol
Parameters
-
name: Name
-
params: Parameters<RemoteApi[Name]>[0]
Returns void
request
- request<Name>(name: Name, params: Parameters<RemoteApi[Name]>[0]): Promise<ReturnType<RemoteApi[Name]>>
-
Type Parameters
-
Name extends string | number | symbol
Parameters
-
name: Name
-
params: Parameters<RemoteApi[Name]>[0]
Returns Promise<ReturnType<RemoteApi[Name]>>
Contain functionality for using RPC conection
Param
Connection object
Param
Disconnect callback
Param
Object containing handlers for each request by name