mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-08-21 14:44:18 +00:00
19 lines
588 B
TypeScript
19 lines
588 B
TypeScript
export type StateSnapshot = Record<string, Record<string, unknown>>;
|
|
|
|
export type SessionRequest = {
|
|
type: "rpc";
|
|
service: string;
|
|
method: string;
|
|
args: unknown[];
|
|
rpcOptions?: true;
|
|
};
|
|
|
|
export type ClientWireMessage =
|
|
| { type: "hello"; clientId: string }
|
|
| { type: "request"; id: number; request: SessionRequest }
|
|
| { type: "cancel"; id: number };
|
|
|
|
export type ServerWireMessage =
|
|
| { type: "snapshot"; states: StateSnapshot }
|
|
| { type: "state_update"; service: string; property: string; value: unknown }
|
|
| { type: "response"; id: number; result?: unknown; error?: string };
|