ts-event-bus
Version:
Distributed messaging in Typescript
14 lines • 645 B
TypeScript
import { Slot } from './Slot';
import { Channel } from './Channel';
export interface EventDeclaration {
[slotName: string]: Slot<any, any>;
}
type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
export declare function combineEvents<Events extends EventDeclaration[]>(...args: Events): UnionToIntersection<Events[number]>;
export declare function createEventBus<C extends EventDeclaration, T extends Array<keyof C> = []>(args: {
events: C;
channels?: Channel[];
ignoredEvents?: T;
}): T extends [] ? C : Omit<C, T[number]>;
export {};
//# sourceMappingURL=Events.d.ts.map