import { Logger } from "../../util/Logger.js"; import { ChannelListener } from "./ChannelListener.js"; import { ServerConnection } from "./ServerConnection.js"; export declare class Channel { subscription: any; subscriptionCallbackResponse: any; listeners: ChannelListener[]; listenerCallbackQueue: any[]; _logger: Logger; idCounter: number; _initialized: boolean; _channelName: string; _cometd: any; _subscribeOptionsCallback: any; _serverConnection: ServerConnection; constructor(conn: ServerConnection, cometd: any, channelName: string, initialized: boolean, subscribeOptionsCallback?: () => {}); private _disconnected; private getSubscriptionCommandSender; getServerConnection(): ServerConnection; /** * Subscribe to have this channel's messages be published to the specified * callback. * * @return Integer id for the newly registered listener */ subscribe(listener: ChannelListener): number | null; resubscribe(): void; _handleResponse(message: any): void; /** * Remove listener from channel, so callback pertaining to listener * no longer receives messages published to channel. When the last * listener is removed, the subscription is destroyed. */ unsubscribe(/*amb.ChannelListener*/ listener: ChannelListener): void; publish(/*Hash*/ message: any): void; subscribeToCometD(): void; _subscribeToCometD(overLoadedSubscriptionCallBack: any): void; /** * Callback that gets fired when a cometd channel subscription is completed. * Triggers channel listener callbacks. * @param response */ subscriptionCallback(response: any): void; unsubscribeFromCometD(): void; _unsubscribeFromCometD(): void; resubscribeToCometD(): void; getSubscribeOptionsCallback(): any; getName(): string; /** * Returns the array of amb.ChannelListeners. * @returns {Array} */ getChannelListeners(): ChannelListener[]; /** * Returns the array of channel listener subscription callbacks * For unit testing. * @returns {Array} */ getListenerCallbackQueue(): any[]; /** * Don't use this, for unit testing. * Need the ability to set the subscription callback response from cometd subscribe callback * * @param response */ setSubscriptionCallbackResponse(response: any): void; }