ts-event-bus
Version:
Distributed messaging in Typescript
41 lines • 1.06 kB
TypeScript
export type TransportRequest = {
type: 'request';
slotName: string;
id: string;
data: any;
param: string;
};
export type TransportResponse = {
type: 'response';
slotName: string;
id: string;
data: any;
param: string;
};
export type TransportError = {
id: string;
message: string;
param: string;
slotName: string;
stack?: string;
type: 'error';
};
export type TransportRegistrationMessage = {
type: 'handler_registered';
slotName: string;
param: string;
};
export type TransportUnregistrationMessage = {
type: 'handler_unregistered';
slotName: string;
param: string;
};
export type TransportEventListMessage = {
type: 'event_list';
ignoredEvents: string[];
};
export type TransportMessage = TransportError | TransportRegistrationMessage | TransportRequest | TransportResponse | TransportUnregistrationMessage | TransportEventListMessage;
export declare function isTransportMessage(m: {
type: string;
}): m is TransportMessage;
//# sourceMappingURL=Message.d.ts.map