UNPKG

@arcgis/workflow-manager

Version:

ArcGIS Workflow Manager JavaScript API

41 lines (40 loc) 1.7 kB
import { ItemNotificationMessage, NotificationMessage } from './support/messages'; import { ConfigInfo } from './manager.factory'; import { BaseManager } from './base-manager'; import { TokenGenerator } from './utils/token.generator'; export type NotificationManagerCallback = (msg: NotificationMessage) => Promise<void>; export type ItemNotificationManagerCallback = (msg: ItemNotificationMessage) => Promise<void>; export declare class NotificationManager extends BaseManager { private webSocketInstance; private commandsToExecuteWhenReady; private disconnectCallbacks; private reconnectCallbacks; private cachedToken; private processorMap; private callbackJobIdMap; private isDisconnected; constructor(); private messageEventListener; initialize(config: ConfigInfo, tokenGenerator: TokenGenerator): Promise<void>; subscribeToJob(jobId: string, callback: NotificationManagerCallback): string; subscribeToItem(itemId: string, callback: ItemNotificationManagerCallback): string; private subscribeImpl; unsubscribe(callbackId: string): void; unsubscribeFromAll(): void; send(message: any): void; onDisconnect(callback: () => void): void; private onDisconnectInternal; onReconnect(callback: () => void): void; attemptReconnect(): void; private isReady; private whenReady; private callReady; private createWebSocketUrl; private createWebSocket; private openEventListener; } export declare class NotificationManagerFactory { private static instanceMap; private static createInstance; static getManager(config: ConfigInfo, tokenGenerator: TokenGenerator): Promise<NotificationManager>; }