///
import { EventEmitter } from "events";
import { ITapClient } from "../tap-client";
import { handlerType } from "../domain/handler-type";
import { WsEvent } from "../domain/ws-event";
export interface ChannelStats {
received: number;
sent: number;
}
export interface IChannel {
name: string;
liquidTap: ITapClient;
subscriptionAttempted: boolean;
subscriptionPending: boolean;
subscriptionCancelled: boolean;
subscribed: boolean;
unsubscribed: boolean;
stats: ChannelStats;
reference?: string;
notify(wsEvent: WsEvent): void;
onSubscribed(handler?: handlerType): void | Promise;
bind(event: string, handler?: handlerType): void | Promise;
unbind(event: string, handler?: handlerType): void;
bindAll(handler?: handlerType): Promise | void;
unbindAll(handler?: handlerType): void;
resetAllBindings(): void;
subscribe(): Promise;
unsubscribe(): Promise;
reinstateSubscription(): Promise;
}
export declare class Channel {
name: string;
liquidTap: ITapClient;
subPayload?: any;
eventEmitter: EventEmitter;
subscriptionAttempted: boolean;
subscriptionPending: boolean;
subscriptionCancelled: boolean;
subscribed: boolean;
unsubscribed: boolean;
stats: ChannelStats;
/**
* An opaque string field where any external indentifying information can be stored.
*/
reference?: string;
constructor(channelName: string, liquidTap: ITapClient, subPayload?: any);
notify(wsEvent: WsEvent): void;
onSubscribed(handler?: handlerType): void | Promise;
bind(event: string, handler?: handlerType): void | Promise;
unbind(event: string, handler?: handlerType): void;
bindAll(handler?: handlerType): Promise | void;
unbindAll(handler?: handlerType): void;
resetAllBindings(): void;
subscribe(): Promise;
unsubscribe(): Promise;
reinstateSubscription(): Promise;
}