import { type AnalyticsWebClient, APSTransportType, type OnEvent } from '../../apiTypes'; import { type APSProtocolConfig } from '../types'; import { type EventType, type Protocol } from '../../types'; import { type APSTransport } from './transports'; export default class APSProtocol implements Protocol { readonly url: URL; private readonly eventEmitter; activeTransport: APSTransport; private readonly fallbackTransport; private readonly skipFallback; private readonly analyticsClient; /** * @param apsUrl the URL used to initiate a Web Socket connection with Atlassian PubSub. * Defaults to the path '/gateway/wss/fps', relative to the domain of the current window.location. * @param preferredTransport indicates which type of transport the APS client should use. The default * value is WEBSOCKET. * @param skipFallback indicates that this class should not attempt to reconnected using the fallback transport * in case the primary one fails. This value should, most of the time, be 'false' on a real client. * @param analyticsWebClient a GasV3 AnalyticsWebClient instance which will be used to emit operational events */ constructor(apsUrl?: URL, preferredTransport?: APSTransportType, skipFallback?: boolean, analyticsWebClient?: AnalyticsWebClient); private static getDefaultUrl; getCapabilities(): string[]; getType(): string; /** * The APS protocol does not implement 'networkDown' or 'networkUp'. * These functions are never called by our primary consumers. */ networkDown(): void; /** * The APS protocol does not implement 'networkDown' or 'networkUp'. * These functions are never called by our primary consumers. */ networkUp(): void; off(event: EventType, handler: OnEvent): void; on(event: EventType, handler: OnEvent): void; subscribe(config: APSProtocolConfig): void; unsubscribeAll(): void; }