import { SceneViewAPIClient } from '@vertexvis/scene-view-protos/sceneview/protos/scene_view_api_pb_service'; import { EventDispatcher, UUID } from '@vertexvis/utils'; import { JwtProvider } from '../grpc'; import { Annotation, AnnotationSet } from './annotation'; export interface AnnotationState { annotations: Record; } /** * The controller for managing the annotations of a scene and scene view. */ export declare class AnnotationController { private client; private jwtProvider; private deviceIdProvider; /** * A dispatcher that emits an event whenever the state of the annotations has * changed. The annotation state includes the annotation sets that are active * and the annotations that belong to each set. */ onStateChange: EventDispatcher; private state?; private connection?; constructor(client: SceneViewAPIClient, jwtProvider: JwtProvider, deviceIdProvider: () => string | undefined); /** * Activates an annotation set for the current session. This method will emit * an event on `onStateChange` when the annotation set has been added, and * return a promise the resolves with the new annotation state. * * @param id The ID of the annotation set. * @returns A promise that resolves with the new annotation state. */ addAnnotationSet(id: UUID.UUID): Promise; /** * Stops the automatic retrieval of annotation state. */ disconnect(): void; /** * Starts the automatic retrieval of annotation state. When a new annotation * state is retrieved, an event will be emitted on `onStateChange`. * * @param pollingIntervalInMs The interval to poll for a new annotation state. */ connect(pollingIntervalInMs?: number): void; /** * Performs a manual fetch of the annotation state. This method will emit an * event on `onStateChange` when the annotation set has been added, and return * a promise the resolves with the new annotation state. * * @param opts Options to configure the fetch behavior. If an abort signal is * given, then this will not emit a change event if the signal is aborted. * @returns A promise that resolves with the new annotation state. */ fetch(opts?: { signal?: AbortSignal; }): Promise; /** * Deactivates an annotation set for the current session. This method will * emit an event on `onStateChange` when the annotation set has been added, * and return a promise the resolves with the new annotation state. * * @param id The ID of the annotation set. * @returns A promise that resolves with the new annotation state. */ removeAnnotationSet(id: UUID.UUID): Promise; private pollAnnotationState; private fetchAnnotationSets; private fetchAnnotationSetsAsArray; private fetchAnnotations; private fetchAnnotationsAsArray; private updateState; }