import { AIMSSessionDescriptor } from "../../aims-client/types"; import { AlBehaviorPromise } from "../../common/promises"; import { AlTriggerStream } from "../../common/utility"; export declare class AlConduitClient { static events: AlTriggerStream; static verbose: boolean; protected static document: Document; protected static conduitUri: string; protected static conduitWindow: Window; protected static conduitOrigin: string; protected static refCount: number; protected static ready: AlBehaviorPromise; protected static requests: { [requestId: string]: { resolve: any; reject: any; canceled: boolean; }; }; protected static externalSessions: { [locationId: string]: { promise?: Promise; resolver: any; resolved: boolean; }; }; protected static requestIndex: number; protected disabled: boolean; start(targetDocument?: Document): void; render(): DocumentFragment; getFragment(): DocumentFragment; getContainer(): HTMLElement; ready(): Promise; stop(): void; destroy(): void; /** * Checks to see if a session with an external resource has been established. * * @param insightLocationId The external location ID. If unspecified, AlLocatorService's context will be used by default. * @returns Boolean true or false. */ checkExternalSession(insightLocationId?: string): boolean; /** * Waits for a session with an external resource to be established. * * @param insightLocationId The external location ID. If unspecified, AlLocatorService's context will be used by default. * @returns A promise that resolves once the external resource's session has been established. * * Please note that attempting to await an unknown or gibberishy location will return a promise that never resolves. */ awaitExternalSession(insightLocationId?: string): Promise; /** * Retrieves session information from the conduit. Resolves with valid session information if a session exists, or null if no session is established; * an error indicates a problem with conduit operation rather than the absence of a session. */ getSession(): Promise; /** * Sets session information TO the conduit. Should always resolve with a copy of the session (including acting * account and active datacenter) that conduit considers most fresh. Note that in rare cases this may * deviate from the session provided to this method, in which case the caller should update its data to reflect * conduit's. */ setSession(sessionData: AIMSSessionDescriptor): Promise; /** * Deletes existing session information. */ deleteSession(): Promise; /** * Retrieves a global setting from conduit's local storage */ getGlobalSetting(settingKey: string): Promise; /** * Sets a global setting to conduit's local storage */ setGlobalSetting(key: string, data: any): Promise; /** * Deletes a global setting from conduit's local storage */ deleteGlobalSetting(settingKey: string): Promise; /** * Retrieves a global resource. */ getGlobalResource(resourceName: string, ttl: number): Promise; /** * Receives a message from conduit, and dispatches it to the correct handler. */ onReceiveMessage: (event: any) => void; onConduitReady(event: any): void; onDispatchReply(event: any): void; /** * Responds to external session ready messages. If no one is awaiting readiness, it will simply create a resolved promise for that location. */ protected onExternalSessionEstablished(event: any): void; /** * Raises an AlDatacenterSessionEventEvent */ protected onExternalSessionError(event: any): void; /** * Pass the event upstream on the internal event bus */ protected onExternalTrackableEvent(event: any): void; /** * This validation step is included *mostly* for the sanity of developers. It is remarkably easy to forget to start o3-portero :) It * may help detect problems in production as a fringe benefit. */ protected validateReadiness: () => void; protected request(methodName: string, data?: any, timeout?: number): Promise; }