UNPKG

vision-embedded-web

Version:
18 lines (17 loc) 667 B
import { LiteAutoBind } from './lite-auto-bind'; export interface ISubscribeLiteEvent<T> { on(handler: (data: T) => void): () => void; off(handler: (data: T) => void): void; once(handler: (data: T) => void): () => void; } export declare function createLiteEvent<T>(): LiteEvent<T>; export default class LiteEvent<T> extends LiteAutoBind implements ISubscribeLiteEvent<T> { private handlers; private onceHandlers; on(handler: (data: T) => void): () => void; off(handler: (data: T) => void): void; private execute; emit(data: T): void; once(handler: (data: T) => void): () => void; unsubscribeAll(): void; }