UNPKG

536 BTypeScriptView Raw
1export interface PacketId {
2 id: string;
3}
4export interface ReadPacket<T = any> {
5 pattern: any;
6 data: T;
7}
8export interface WritePacket<T = any> {
9 err?: any;
10 response?: T;
11 isDisposed?: boolean;
12 status?: string;
13}
14export type OutgoingRequest = ReadPacket & PacketId;
15export type IncomingRequest = ReadPacket & PacketId;
16export type OutgoingEvent = ReadPacket;
17export type IncomingEvent = ReadPacket;
18export type IncomingResponse = WritePacket & PacketId;
19export type OutgoingResponse = WritePacket & PacketId;