Skip to content

Universal DevTools Kit SDK


Universal DevTools Kit SDK / @u-devtools/core / RpcClientInterface

Interface: RpcClientInterface ​

Defined in: index.ts:31

RPC Client Interface for making remote procedure calls. Provides methods to call server methods and subscribe to events.

Communication: Server ↔ Client via WebSocket (Vite HMR or custom WebSocket)

Methods ​

call() ​

call<T>(method, payload?): Promise<T>

Defined in: index.ts:39

Call a remote method on the server.

Type Parameters ​

Type ParameterDefault typeDescription
TunknownReturn type of the method

Parameters ​

ParameterTypeDescription
methodstringMethod name (e.g., 'sys:getPlugins')
payload?unknownOptional payload data

Returns ​

Promise<T>

Promise that resolves with the method result


off()? ​

optional off(event, callback): void

Defined in: index.ts:54

Unsubscribe from events (optional, some transports may not support it).

Parameters ​

ParameterTypeDescription
eventstringEvent name
callback(data) => voidCallback function to remove

Returns ​

void


on() ​

on(event, callback): () => void

Defined in: index.ts:47

Subscribe to events from the server.

Parameters ​

ParameterTypeDescription
eventstringEvent name
callback(data) => voidCallback function to handle events

Returns ​

Function to unsubscribe from the event

(): void

Returns ​

void

Released under the MIT License.