import { EventManager } from "./EventManager.js"; import { Logger } from "../../util/Logger.js"; import { ChannelRedirect } from "./ChannelRedirect.js"; import { Channel } from "./Channel.js"; import { CrossClientChannel } from "./CrossClientChannel.js"; import { SubscriptionCommandSender } from "./SubscriptionCommandSender.js"; export declare class ServerConnection { connected: boolean; disconnecting: boolean; eventManager: EventManager; static sessionStates: any; state: string; channels: any; _logger: Logger; sessionStatus: string; loginWindow: any; loginWindowEnabled: boolean; lastError: any; errorMessages: any; loginWindowOverride: boolean; needToReestablishSession: boolean; channelRedirect: ChannelRedirect; initialized: boolean; tokenManagementExtension: any; _cometd: any; _crossClientChannel: CrossClientChannel; subscriptionCommandSender: SubscriptionCommandSender | null; private _instanceUrl; private _sessionCookies; private _userToken; constructor(cometd: any, crossClientChannel?: CrossClientChannel); /** * Set the ServiceNow instance URL dynamically * @param url Instance URL (e.g., ) */ setInstanceUrl(url: string): void; /** * Set session cookies for authentication * @param cookies Cookie string (e.g., "JSESSIONID=xxx; glide_session_store=yyy") */ setSessionCookies(cookies: string): void; /** * Set user token for AMB authentication * @param token User token string */ setUserToken(token: string): void; private _initializeMetaChannelListeners; connect(): void; reload(): void; abort(): void; disconnect(): void; getURL(ambServletPath: string): string; getBaseUrl(): string; getUserToken(): string; getSessionCookies(): string | null; getInstanceUrl(): string | null; /** * Connection event listeners */ _metaHandshake(message: any): void; getExt(message: any, extensionName: string): any; _getChannel(channelName: string, subscriptionOptionsCallback: any): Channel; _removeChannel(channelName: any): void; applyAMBProperties(message: any): void; _getIntMessageExtProperty(valueStr: string, defaultVal: any): number; _getBooleanMessageExtProperty(valueStr: string, defaultVal: any): any; applySubscriptionCommandFlowProperties(message: any): void; _initializeSubscriptionCommandSender(): void; _resubscribeAll(): void; _unsubscribeAll(): void; _metaConnect(/*Hash*/ message: any): void; isWebsocketTransport(): boolean; _touchHttpSession(): void; _connectionInitialized(): void; _connectionOpened(): void; _onChannelRedirectSubscriptionComplete(): void; _setupSession(): void; private _defaultCallback; _sendRequestToSetUpGlideSession(callback?: Function): void; _buildSetUpSessionRequest(): any; _connectionClosed(): void; _connectionBroken(): void; _stopSubscriptionCommandSender(): void; /** * Session management/maintenance */ _sessionStatus(/*Hash*/ message: any): void; _processSessionStatus(newSessionStatus: any): void; _isLoggedIn(newSessionStatus: any): boolean; isLoggedOut(newSessionStatus: any): boolean; isReestablished(newSessionStatus: any): boolean; /** * For logged in users session invalidation happens instead of being logged out when they have remember me on */ isSessionInvalidated(newSessionStatus: any): boolean; _loggedIn(): void; _loggedOut(): void; _reestablished(): void; _invalidated(): void; _publishEvent(event: any): void; _emitReestablishSession(): void; /** * Channel management */ unsubscribeAll(): void; resubscribeAll(): void; removeChannel(/*String*/ channelName: any): void; /** * Connection event management */ getEvents(): any; getConnectionState(): string; getLastError(): any; setLastError(/*String*/ error: any): void; getErrorMessages(): any; isLoggedIn(): boolean; isSessionActive(): boolean; getChannelRedirect(): ChannelRedirect; getChannel(channelName: string, subscriptionOptionsCallback?: Function): Channel; getChannels(): any; getState(): string; getLoginWindowOverlayStyle(): string; loginShow(): void; loginHide(): void; loginComplete(): void; _reestablishSession(emit: boolean): void; reestablishSession(): void; subscribeToEvent(/*String*/ event: any, /*Function*/ callback: any): number; unsubscribeFromEvent(/*Number*/ id: number): void; isLoginWindowEnabled(): boolean; setLoginWindowEnabled(enableLoginWindow: boolean): void; isLoginWindowOverride(): boolean; getSubscriptionCommandSender(): SubscriptionCommandSender; }