@wocker/core
Version:
Core of the Wocker
10 lines (9 loc) • 346 B
TypeScript
export type EventHandle = (...args: any[]) => Promise<void> | void;
export declare class EventService {
protected handles: {
[event: string]: Set<EventHandle>;
};
on(event: string, handle: EventHandle): (() => void);
off(event: string, handle: EventHandle): void;
emit(event: string, ...args: any[]): Promise<void>;
}