UNPKG

@dannyfranca/any-chat

Version:

Universal, extensible and improved JS API for Chats, like TawkTo, Jivochat, and others.

23 lines (22 loc) 875 B
import EventMap from "../types/EventMap"; import { Subscription } from 'rxjs'; import EventCallback from "../types/EventCallback"; import EventCollection from "../types/EventCollection"; declare type SubscriptionStore = { [key: string]: Subscription[]; }; export default abstract class EventHandler { abstract _eventMap: EventMap; protected _subscriptions: SubscriptionStore; protected _events: EventCollection; on(eventString: string, callback: EventCallback): void; off(eventString: string): void; protected init(): void; private mapEvents; protected trigger(eventName: keyof EventMap, ...args: any[]): void; hasEvent(eventName: keyof EventMap): boolean; private storeSubscription; private removeNamespaceSubscriptions; protected static setError(message: string, error?: Error): Error; } export {};