UNPKG

@signalwire/realtime-api

Version:
24 lines 1.28 kB
import { EventEmitter } from '@signalwire/core'; import { ListenSubscriber } from './ListenSubscriber'; import { SWClient } from './SWClient'; export interface ListenOptions { topics?: string[]; channels?: string[]; } export type Listeners<T> = Omit<T, 'topics' | 'channels'>; export type ListenersKeys<T> = keyof T; export declare class BaseNamespace<T extends ListenOptions, EventTypes extends EventEmitter.ValidEventTypes> extends ListenSubscriber<Listeners<T>, EventTypes> { constructor(options: SWClient); protected onSessionReconnect(): void; private onSessionDisconnect; protected addTopics(topics: string[]): Promise<void>; protected removeTopics(topics: string[]): Promise<void>; listen(listenOptions: T): Promise<() => Promise<void>>; protected subscribe(listenOptions: T): Promise<() => Promise<void>>; protected _attachListenersWithTopics(topics: string[], listeners: Listeners<T>): void; protected _areListenersAttached(topics: string[], listeners: Listeners<T>): boolean; protected _detachListenersWithTopics(topics: string[], listeners: Listeners<T>): void; protected hasOtherListeners(uuid: string, topic: string): boolean; protected unsubscribeAll(): Promise<void>; } //# sourceMappingURL=BaseNamespace.d.ts.map