UNPKG

@aptpod/iscp-ts

Version:

iSCP 2.0 client library for TypeScript

18 lines (17 loc) 581 B
export interface Listener<T, S = void, U = void> { (...event: [T, S, U]): any; } export interface Disposable { dispose: () => void; } export declare const ErrorAlreadyDisposed: Error; /** passes through events as they happen. You will not get events from before you start listening */ export declare class TypedEvent<T, S = void, U = void> { #private; constructor(); dispose(): void; on(listener: Listener<T, S, U>): Disposable; once(listener: Listener<T, S, U>): void; off(listener: Listener<T, S, U>): void; emit(...event: [T, S, U]): void; }