]> git.openstreetmap.org Git - rails.git/blob - vendor/assets/iD/iD/mapillary-js/mapillary.d.ts
Merge branch 'master' into HEAD
[rails.git] / vendor / assets / iD / iD / mapillary-js / mapillary.d.ts
1 import { Observable, Subject, Subscription, BehaviorSubject, Scheduler } from 'rxjs';
2 import { Matrix4, Vector3, PerspectiveCamera, WebGLRenderer, Object3D, Camera as Camera$1 } from 'three';
3 import { VNode } from 'virtual-dom';
4
5 /**
6  * Convert coordinates from geodetic (WGS84) reference to local topocentric
7  * (ENU) reference.
8  *
9  * @param {number} lng Longitude in degrees.
10  * @param {number} lat Latitude in degrees.
11  * @param {number} alt Altitude in meters.
12  * @param {number} refLng Reference longitude in degrees.
13  * @param {number} refLat Reference latitude in degrees.
14  * @param {number} refAlt Reference altitude in meters.
15  * @returns {Array<number>} The x, y, z local topocentric ENU coordinates.
16  */
17 declare function geodeticToEnu(lng: number, lat: number, alt: number, refLng: number, refLat: number, refAlt: number): number[];
18 /**
19  * Convert coordinates from local topocentric (ENU) reference to
20  * geodetic (WGS84) reference.
21  *
22  * @param {number} x Topocentric ENU coordinate in East direction.
23  * @param {number} y Topocentric ENU coordinate in North direction.
24  * @param {number} z Topocentric ENU coordinate in Up direction.
25  * @param {number} refLng Reference longitude in degrees.
26  * @param {number} refLat Reference latitude in degrees.
27  * @param {number} refAlt Reference altitude in meters.
28  * @returns {Array<number>} The longitude, latitude in degrees
29  * and altitude in meters.
30  */
31 declare function enuToGeodetic(x: number, y: number, z: number, refLng: number, refLat: number, refAlt: number): number[];
32
33 /**
34  * Contract describing triangulated meshes.
35  */
36 interface MeshContract {
37     /**
38      * Flattened array of faces for the mesh. Each face consist
39      * three vertex indices.
40      */
41     faces: number[];
42     /**
43      * Flattened array of vertices for the mesh. Each vertex
44      * consists of X, Y and Z coordinates in the camera
45      * reference frame.
46      */
47     vertices: number[];
48 }
49
50 /**
51  * Decompress and parse an array buffer containing zipped
52  * json data and return as a json object.
53  *
54  * @description Handles array buffers continaing zipped json
55  * data.
56  *
57  * @param {ArrayBuffer} buffer - Array buffer to decompress.
58  * @returns {Object} Parsed object.
59  */
60 declare function decompress<T>(buffer: ArrayBuffer): T;
61 /**
62  * Retrieves a resource as an array buffer and returns a promise
63  * to the buffer.
64  *
65  * @description Rejects the promise on request failure.
66  *
67  * @param {string} url - URL for resource to retrieve.
68  * @param {Promise} [abort] - Optional promise for aborting
69  * the request through rejection.
70  * @returns {Promise<ArrayBuffer>} Promise to the array buffer
71  * resource.
72  */
73 declare function fetchArrayBuffer(url: string, abort?: Promise<void>): Promise<ArrayBuffer>;
74 /**
75  * Read the fields of a protobuf array buffer into a mesh
76  * object.
77  *
78  * @param {ArrayBuffer} buffer - Protobuf array buffer
79  * to read from.
80  * @returns {MeshContract} Mesh object.
81  */
82 declare function readMeshPbf(buffer: ArrayBuffer): MeshContract;
83
84 declare class EventEmitter {
85     private _events;
86     constructor();
87     /**
88      * Subscribe to an event by its name.
89      * @param {string} type - The name of the event
90      * to subscribe to.
91      * @param {(event: T) => void} handler - The
92      * handler called when the event occurs.
93      */
94     on<T>(type: string, handler: (event: T) => void): void;
95     /**
96      * Unsubscribe from an event by its name.
97      * @param {string} type - The name of the event
98      * to unsubscribe from.
99      * @param {(event: T) => void} handler - The
100      * handler to remove.
101      */
102     off<T>(type: string, handler: (event: T) => void): void;
103     /**
104      * @ignore
105      */
106     fire<T>(type: string, event: T): void;
107     private _listens;
108 }
109
110 /**
111  * Interface that represents a longitude, latitude coordinate,
112  * measured in degrees. Coordinates are defined in the WGS84 datum.
113  */
114 interface LngLat {
115     /**
116      * Latitude, measured in degrees.
117      */
118     lat: number;
119     /**
120      * Longitude, measured in degrees.
121      */
122     lng: number;
123 }
124
125 /**
126  * Interface that represents longitude-latitude-altitude
127  * coordinates. Longitude and latitude are measured in degrees
128  * and altitude in meters. Coordinates are defined in the WGS84 datum.
129  *
130  * @interface
131  */
132 interface LngLatAlt extends LngLat {
133     /**
134      * Altitude, measured in meters.
135      */
136     alt: number;
137 }
138
139 /**
140  * Contract describing a reconstruction point.
141  */
142 interface PointContract {
143     /**
144      * RGB color vector of the point, normalized to floats
145      * on the interval [0, 1];
146      */
147     color: number[];
148     /**
149      * Coordinates in metric scale in topocentric ENU
150      * reference frame with respect to a geo reference.
151      */
152     coordinates: number[];
153 }
154
155 /**
156  * Contract describing cluster reconstruction data.
157  */
158 interface ClusterContract {
159     /**
160      * The unique id of the cluster.
161      */
162     id: string;
163     /**
164      * The points of the reconstruction.
165      */
166     points: {
167         [pointId: string]: PointContract;
168     };
169     /**
170      * The reference longitude, latitude, altitude of
171      * the reconstruction. Determines the
172      * position of the reconstruction in world reference
173      * frame.
174      */
175     reference: LngLatAlt;
176 }
177
178 /**
179  * @class GeometryProviderBase
180  *
181  * @classdesc Base class to extend if implementing a geometry
182  * provider class.
183  *
184  * @example
185  * ```js
186  * class MyGeometryProvider extends GeometryProviderBase {
187  *      ...
188  * }
189  * ```
190  */
191 declare abstract class GeometryProviderBase {
192     /**
193      * Create a new geometry provider base instance.
194      */
195     constructor();
196     /**
197      * Convert a geodetic bounding box to the the minimum set
198      * of cell ids containing the bounding box.
199      *
200      * @description The bounding box needs
201      * to be sufficiently small to be contained in an area with the size
202      * of maximally four tiles. Up to nine adjacent tiles may be returned.
203      *
204      * @param {LngLat} sw - South west corner of bounding box.
205      * @param {LngLat} ne - North east corner of bounding box.
206      *
207      * @returns {Array<string>} Array of cell ids.
208      */
209     bboxToCellIds(sw: LngLat, ne: LngLat): string[];
210     /**
211      * Get the cell ids of all adjacent cells.
212      *
213      * @description In the case of approximately rectangular cells
214      * this is typically the eight orthogonally and diagonally adjacent
215      * cells.
216      *
217      * @param {string} cellId - Id of cell.
218      * @returns {Array<string>} Array of cell ids. No specific
219      * order is guaranteed.
220      */
221     getAdjacent(cellId: string): string[];
222     /**
223      * Get the vertices of a cell.
224      *
225      * @description The vertices form an unclosed
226      * clockwise polygon in the 2D longitude, latitude
227      * space. No assumption on the position of the first
228      * vertex relative to the others can be made.
229      *
230      * @param {string} cellId - Id of cell.
231      * @returns {Array<LngLat>} Unclosed clockwise polygon.
232      */
233     getVertices(cellId: string): LngLat[];
234     /**
235      * Convert geodetic coordinates to a cell id.
236      *
237      * @param {LngLat} lngLat - Longitude, latitude to convert.
238      * @returns {string} Cell id for the longitude, latitude.
239      */
240     lngLatToCellId(lngLat: LngLat): string;
241     /** @ignore */
242     protected _approxBboxToCellIds(sw: LngLat, ne: LngLat): string[];
243     /** @ignore */
244     private _enuToGeodetic;
245     /** @ignore */
246     private _getLngLatBoundingBoxCorners;
247     /**
248      * Convert a geodetic square to cell ids.
249      *
250      * The square is specified as a longitude, latitude
251      * and a threshold from the position using Manhattan distance.
252      *
253      * @param {LngLat} lngLat - Longitude, latitude.
254      * @param {number} threshold - Threshold of the conversion in meters.
255      *
256      * @returns {Array<string>} Array of cell ids reachable within
257      * the threshold.
258      *
259      * @ignore
260      */
261     private _lngLatToCellIds;
262 }
263
264 /**
265  * Ent representing an entity with a unique ID.
266  *
267  * @interface IDEnt
268  */
269 interface IDEnt {
270     /**
271      * Unique ID.
272      */
273     id: string;
274 }
275
276 /**
277  * Ent representing core image properties.
278  */
279 interface CoreImageEnt extends IDEnt {
280     /**
281      * SfM computed longitude, latitude in WGS84 datum, measured in degrees.
282      *
283      * @description Optional - no 3D interaction available
284      * if unset.
285      */
286     computed_geometry?: LngLat;
287     /**
288      * Original EXIF longitude, latitude in WGS84 datum, measured in degrees.
289      */
290     geometry: LngLat;
291     /**
292      * Sequence that the image is part of.
293      */
294     sequence: IDEnt;
295 }
296
297 /**
298  * Contract describing core image results.
299  */
300 interface CoreImagesContract {
301     /**
302      * Geometry cell ID.
303      */
304     cell_id: string;
305     /**
306      * Array of core image ents.
307      */
308     images: CoreImageEnt[];
309 }
310
311 /**
312  * Ent representing camera properties.
313  */
314 interface CameraEnt {
315     /**
316      * Camera type dependent camera parameters.
317      *
318      * For perspective and fisheye camera types,
319      * the camera parameters array should be
320      * constructed according to
321      *
322      * `[focal, k1, k2]`
323      *
324      * where focal is the camera focal length,
325      * and k1, k2 are radial distortion parameters.
326      *
327      * For spherical camera type the camera
328      * parameters should be an emtpy array.
329      */
330     camera_parameters: number[];
331     /**
332      * Projection type of the camera.
333      *
334      * @description Supported camera types are:
335      *
336      * ```js
337      *   'spherical'
338      *   'fisheye'
339      *   'perspective'
340      * ```
341      *
342      * Other camera types will be treated as
343      * perspective images.
344      */
345     camera_type: string;
346 }
347
348 /**
349  * Ent representing URL properties.
350  */
351 interface URLEnt extends IDEnt {
352     /**
353      * URL for fetching ent data.
354      */
355     url: string;
356 }
357
358 /**
359  * Ent representing image creator properties.
360  */
361 interface CreatorEnt extends IDEnt {
362     /**
363      * The username of the creator.
364      */
365     username: string;
366 }
367
368 /**
369  * Ent representing spatial image properties.
370  */
371 interface SpatialImageEnt extends CameraEnt, IDEnt {
372     /**
373      * Original EXIF altitude above sea level, in meters.
374      */
375     altitude: number;
376     /**
377      * Scale of atomic reconstruction.
378      *
379      * @description Optional - no 3D interaction available
380      * if unset.
381      */
382     atomic_scale?: number;
383     /**
384      * Timestamp representing the capture date and time.
385      *
386      * @description Unix epoch timestamp in milliseconds.
387      */
388     captured_at: number;
389     /**
390      * Original EXIF compass angle, measured in degrees.
391      */
392     compass_angle: number;
393     /**
394      * Computed altitude, in meters.
395      *
396      * @description Optional - no 3D interaction available
397      * if unset.
398      */
399     computed_altitude?: number;
400     /**
401      * SfM computed compass angle, measured in degrees.
402      *
403      * @description Optional - no 3D interaction available
404      * if unset.
405      */
406     computed_compass_angle?: number;
407     /**
408      * Rotation vector in angle axis representation.
409      *
410      * @description Optional - no 3D interaction available
411      * if unset.
412      */
413     computed_rotation?: number[];
414     /**
415      * Cluster reconstruction to which the image belongs.
416      */
417     cluster: URLEnt;
418     /**
419      * Image creator.
420      */
421     creator: CreatorEnt;
422     /**
423      * EXIF orientation of original image.
424      */
425     exif_orientation: number;
426     /**
427      * Height of original image, not adjusted for orientation.
428      */
429     height: number;
430     /**
431      * SfM connected component id to which the image belongs.
432      *
433      * @description Optional - no 3D interaction available
434      * if unset.
435      */
436     merge_id?: string;
437     /**
438      * 3D mesh resource.
439      */
440     mesh: URLEnt;
441     /**
442      * Owner to which the image belongs.
443      */
444     owner: IDEnt;
445     /**
446      * Value specifying if image is accessible to organization members only
447      * or to everyone.
448      */
449     private?: boolean;
450     /**
451      * Image quality score on the interval [0, 1].
452      */
453     quality_score?: number;
454     /**
455      * Image thumbnail resource.
456      */
457     thumb: URLEnt;
458     /**
459      * Width of original image, not adjusted for orientation.
460      */
461     width: number;
462 }
463
464 /**
465  * Contract describing ent results.
466  */
467 interface EntContract<T> {
468     /**
469      * Ent node.
470      */
471     node: T;
472     /**
473      * Ent node id.
474      */
475     node_id: string;
476 }
477
478 /**
479  * Contract describing spatial image results.
480  */
481 declare type SpatialImagesContract = EntContract<SpatialImageEnt>[];
482
483 /**
484  * Ent representing image properties.
485  */
486 interface ImageEnt extends CoreImageEnt, SpatialImageEnt {
487 }
488
489 /**
490  * Contract describing image results.
491  */
492 declare type ImagesContract = EntContract<ImageEnt>[];
493
494 /**
495  * Ent representing sequence properties.
496  *
497  * @interface SequenceEnt
498  */
499 interface SequenceEnt extends IDEnt {
500     /**
501      * The image IDs of the sequence sorted in
502      * acsending order based on capture time.
503      */
504     image_ids: string[];
505 }
506
507 /**
508  * Contract describing sequence results.
509  */
510 declare type SequenceContract = SequenceEnt;
511
512 /**
513  * Ent representing image tile properties.
514  */
515 interface ImageTileEnt {
516     /**
517      * URL for fetching image tile pixel data.
518      */
519     url: string;
520     /**
521      * X tile coordinate.
522      */
523     x: number;
524     /**
525      * Y tile coordinate.
526      */
527     y: number;
528     /**
529      * Tile level.
530      */
531     z: number;
532 }
533
534 /**
535  * Contract describing image tile results.
536  */
537 declare type ImageTilesContract = EntContract<ImageTileEnt[]>;
538
539 /**
540  * Contract describing image tile requests.
541  */
542 interface ImageTilesRequestContract {
543     /**
544      * ID of the tile's image.
545      */
546     imageId: string;
547     /**
548      * Tile level.
549      */
550     z: number;
551 }
552
553 /**
554  * @event
555  */
556 declare type ProviderEventType = "datacreate";
557
558 /**
559  * Interface for general provider events.
560  */
561 interface ProviderEvent {
562     /**
563      * Data provider target that emitted the event.
564      */
565     target: DataProviderBase;
566     /**
567      * Provider event type.
568      */
569     type: ProviderEventType;
570 }
571
572 /**
573  *
574  * Interface for data provider cell events.
575  */
576 interface ProviderCellEvent extends ProviderEvent {
577     /**
578      * Cell ids for cells where data have been created.
579      */
580     cellIds: string[];
581     /**
582      * Provider event type.
583      */
584     type: "datacreate";
585 }
586
587 /**
588  * @class DataProviderBase
589  *
590  * @classdesc Base class to extend if implementing a data provider
591  * class.
592  *
593  * @fires datacreate
594  *
595  * @example
596  * ```js
597  * class MyDataProvider extends DataProviderBase {
598  *   constructor() {
599  *     super(new S2GeometryProvider());
600  *   }
601  *   ...
602  * }
603  * ```
604  */
605 declare abstract class DataProviderBase extends EventEmitter {
606     protected _geometry: GeometryProviderBase;
607     /**
608      * Create a new data provider base instance.
609      *
610      * @param {GeometryProviderBase} geometry - Geometry
611      * provider instance.
612      */
613     constructor(_geometry: GeometryProviderBase);
614     /**
615      * Get geometry property.
616      *
617      * @returns {GeometryProviderBase} Geometry provider instance.
618      */
619     get geometry(): GeometryProviderBase;
620     /**
621      * Fire when data has been created in the data provider
622      * after initial load.
623      *
624      * @param type datacreate
625      * @param event Provider cell event
626      *
627      * @example
628      * ```js
629      * // Initialize the data provider
630      * class MyDataProvider extends DataProviderBase {
631      *   // Class implementation
632      * }
633      * var provider = new MyDataProvider();
634      * // Create the event
635      * var cellIds = [ // Determine updated cells ];
636      * var target = provider;
637      * var type = "datacreate";
638      * var event = {
639      *   cellIds,
640      *   target,
641      *   type,
642      * };
643      * // Fire the event
644      * provider.fire(type, event);
645      * ```
646      */
647     fire(type: "datacreate", event: ProviderCellEvent): void;
648     /** @ignore */
649     fire(type: ProviderEventType, event: ProviderEvent): void;
650     /**
651      * Get core images in a geometry cell.
652      *
653      * @param {string} cellId - The id of the geometry cell.
654      * @returns {Promise<CoreImagesContract>} Promise to
655      * the core images of the requested geometry cell id.
656      * @throws Rejects the promise on errors.
657      */
658     getCoreImages(cellId: string): Promise<CoreImagesContract>;
659     /**
660      * Get a cluster reconstruction.
661      *
662      * @param {string} url - URL for the cluster reconstruction
663      * to retrieve.
664      * @param {Promise} [abort] - Optional promise for aborting
665      * the request through rejection.
666      * @returns {Promise<ClusterContract>} Promise to the
667      * cluster reconstruction.
668      * @throws Rejects the promise on errors.
669      */
670     getCluster(url: string, abort?: Promise<void>): Promise<ClusterContract>;
671     /**
672      * Get spatial images.
673      *
674      * @param {Array<string>} imageIds - The ids for the
675      * images to retrieve.
676      * @returns {Promise<SpatialImagesContract>} Promise to
677      * the spatial images of the requested image ids.
678      * @throws Rejects the promise on errors.
679      */
680     getSpatialImages(imageIds: string[]): Promise<SpatialImagesContract>;
681     /**
682      * Get complete images.
683      *
684      * @param {Array<string>} imageIds - The ids for the
685      * images to retrieve.
686      * @returns {Promise<ImagesContract>} Promise to the images of the
687      * requested image ids.
688      * @throws Rejects the promise on errors.
689      */
690     getImages(imageIds: string[]): Promise<ImagesContract>;
691     /**
692      * Get an image as an array buffer.
693      *
694      * @param {string} url - URL for image to retrieve.
695      * @param {Promise<void>} [abort] - Optional promise for aborting
696      * the request through rejection.
697      * @returns {Promise<ArrayBuffer>} Promise to the array
698      * buffer containing the image.
699      * @throws Rejects the promise on errors.
700      */
701     getImageBuffer(url: string, abort?: Promise<void>): Promise<ArrayBuffer>;
702     /**
703      * Get image tiles urls for a tile level.
704      *
705      * @param {ImageTilesRequestContract} tiles - Tiles to request
706      * @returns {Promise<ImageTilesContract>} Promise to the
707      * image tiles response contract
708      *
709      * @throws Rejects the promise on errors.
710      *
711      * @example
712      * ```js
713      * var tileRequest = { imageId: 'image-id', z: 12 };
714      * provider.getImageTiles(tileRequest)
715      *   .then((response) => console.log(response));
716      * ```
717      */
718     getImageTiles(tiles: ImageTilesRequestContract): Promise<ImageTilesContract>;
719     /**
720      * Get a mesh.
721      *
722      * @param {string} url - URL for mesh to retrieve.
723      * @param {Promise<void>} [abort] - Optional promise for aborting
724      * the request through rejection.
725      * @returns {Promise<MeshContract>} Promise to the mesh.
726      * @throws Rejects the promise on errors.
727      */
728     getMesh(url: string, abort?: Promise<void>): Promise<MeshContract>;
729     /**
730      * Get sequence.
731      *
732      * @param {Array<string>} sequenceId - The id for the
733      * sequence to retrieve.
734      * @returns {Promise} Promise to the sequences of the
735      * requested image ids.
736      * @throws Rejects the promise on errors.
737      */
738     getSequence(sequenceId: string): Promise<SequenceContract>;
739     off(type: ProviderCellEvent["type"], handler: (event: ProviderCellEvent) => void): void;
740     /** @ignore */
741     off(type: ProviderEventType, handler: (event: ProviderEvent) => void): void;
742     /**
743      * Fired when data has been created in the data provider
744      * after initial load.
745      *
746      * @event datacreate
747      * @example
748      * ```js
749      * // Initialize the data provider
750      * class MyDataProvider extends DataProviderBase {
751      *   // implementation
752      * }
753      * var provider = new MyDataProvider();
754      * // Set an event listener
755      * provider.on("datacreate", function() {
756      *   console.log("A datacreate event has occurred.");
757      * });
758      * ```
759      */
760     on(type: "datacreate", handler: (event: ProviderCellEvent) => void): void;
761     /** @ignore */
762     on(type: ProviderEventType, handler: (event: ProviderEvent) => void): void;
763     /**
764      * Set an access token for authenticated API requests of
765      * protected resources.
766      *
767      * @param {string} [accessToken] accessToken - User access
768      * token or client access token.
769      */
770     setAccessToken(accessToken?: string): void;
771 }
772
773 interface GraphCameraContract {
774     focal: number;
775     k1: number;
776     k2: number;
777     projection_type: string;
778 }
779 interface GraphCameraShotContract {
780     camera: string;
781     rotation: number[];
782     translation: number[];
783 }
784 interface GraphReferenceContract {
785     altitude: number;
786     latitude: number;
787     longitude: number;
788 }
789 interface GraphPointContract {
790     color: number[];
791     coordinates: number[];
792 }
793 interface GraphClusterContract {
794     cameras: {
795         [cameraId: string]: GraphCameraContract;
796     };
797     points: {
798         [pointId: string]: GraphPointContract;
799     };
800     reference_lla: GraphReferenceContract;
801     shots: {
802         [imageKey: string]: GraphCameraShotContract;
803     };
804 }
805
806 interface GraphGeometry {
807     coordinates: [number, number];
808 }
809 interface GraphCoreImageEnt extends IDEnt {
810     computed_geometry: GraphGeometry;
811     geometry: GraphGeometry;
812     sequence: string;
813 }
814 interface GraphSpatialImageEnt extends SpatialImageEnt {
815     merge_cc: number;
816     sfm_cluster: URLEnt;
817     thumb_1024_url: string;
818     thumb_2048_url: string;
819 }
820
821 declare class GraphConverter {
822     clusterReconstruction(source: GraphClusterContract): ClusterContract;
823     coreImage(source: GraphCoreImageEnt): CoreImageEnt;
824     spatialImage(source: GraphSpatialImageEnt): SpatialImageEnt;
825     private _geometry;
826 }
827
828 interface GraphDataProviderOptions {
829     endpoint?: string;
830     accessToken?: string;
831 }
832
833 declare class GraphQueryCreator {
834     readonly imagesPath: string;
835     readonly sequencePath: string;
836     readonly coreFields: string[];
837     readonly idFields: string[];
838     readonly spatialFields: string[];
839     readonly imageTileFields: string[];
840     private readonly _imageTilesPath;
841     constructor();
842     images(imageIds: string[], fields: string[]): string;
843     imagesS2(cellId: string, fields: string[]): string;
844     imageTiles(z: number, fields: string[]): string;
845     imageTilesPath(imageId: string): string;
846     sequence(sequenceId: string): string;
847 }
848
849 declare class GraphDataProvider extends DataProviderBase {
850     private readonly _method;
851     private readonly _endpoint;
852     private readonly _convert;
853     private readonly _query;
854     private _accessToken;
855     constructor(options?: GraphDataProviderOptions, geometry?: GeometryProviderBase, converter?: GraphConverter, queryCreator?: GraphQueryCreator);
856     getCluster(url: string, abort?: Promise<void>): Promise<ClusterContract>;
857     getCoreImages(cellId: string): Promise<CoreImagesContract>;
858     getImageBuffer(url: string, abort?: Promise<void>): Promise<ArrayBuffer>;
859     getImages(imageIds: string[]): Promise<ImagesContract>;
860     getImageTiles(request: ImageTilesRequestContract): Promise<ImageTilesContract>;
861     getMesh(url: string, abort?: Promise<void>): Promise<MeshContract>;
862     getSequence(sequenceId: string): Promise<SequenceContract>;
863     getSpatialImages(imageIds: string[]): Promise<SpatialImagesContract>;
864     setAccessToken(accessToken: string): void;
865     private _createHeaders;
866     private _fetchGraphContract;
867     private _makeErrorMessage;
868 }
869
870 /**
871  * @class S2GeometryProvider
872  *
873  * @classdesc Geometry provider based on S2 cells.
874  *
875  * @example
876  * ```js
877  * class MyDataProvider extends DataProviderBase {
878  *      ...
879  * }
880  *
881  * const geometryProvider = new S2GeometryProvider();
882  * const dataProvider = new MyDataProvider(geometryProvider);
883  * ```
884  */
885 declare class S2GeometryProvider extends GeometryProviderBase {
886     private readonly _level;
887     /**
888      * Create a new S2 geometry provider instance.
889      */
890     constructor(_level?: number);
891     /** @inheritdoc */
892     bboxToCellIds(sw: LngLat, ne: LngLat): string[];
893     /** @inheritdoc */
894     getAdjacent(cellId: string): string[];
895     /** @inheritdoc */
896     getVertices(cellId: string): LngLat[];
897     /** @inheritdoc */
898     lngLatToCellId(lngLat: LngLat): string;
899     private _getNeighbors;
900     private _lngLatToId;
901 }
902
903 interface ComponentConfiguration {
904     [key: string]: any;
905 }
906
907 /**
908  * Enumeration for render mode
909  * @enum {number}
910  * @readonly
911  * @description Modes for specifying how rendering is done
912  * in the viewer. All modes preserves the original aspect
913  * ratio of the images.
914  */
915 declare enum RenderMode {
916     /**
917      * Displays all content within the viewer.
918      *
919      * @description Black bars shown on both
920      * sides of the content. Bars are shown
921      * either below and above or to the left
922      * and right of the content depending on
923      * the aspect ratio relation between the
924      * image and the viewer.
925      */
926     Letterbox = 0,
927     /**
928      * Fills the viewer by cropping content.
929      *
930      * @description Cropping is done either
931      * in horizontal or vertical direction
932      * depending on the aspect ratio relation
933      * between the image and the viewer.
934      */
935     Fill = 1
936 }
937
938 interface ViewportSize {
939     height: number;
940     width: number;
941 }
942
943 declare type CameraType = "spherical" | "fisheye" | "perspective";
944
945 /**
946  * @class Transform
947  *
948  * @classdesc Class used for calculating coordinate transformations
949  * and projections.
950  */
951 declare class Transform {
952     private _width;
953     private _height;
954     private _focal;
955     private _orientation;
956     private _scale;
957     private _basicWidth;
958     private _basicHeight;
959     private _basicAspect;
960     private _worldToCamera;
961     private _worldToCameraInverse;
962     private _scaledWorldToCamera;
963     private _scaledWorldToCameraInverse;
964     private _basicWorldToCamera;
965     private _textureScale;
966     private _ck1;
967     private _ck2;
968     private _cameraType;
969     private _radialPeak;
970     /**
971      * Create a new transform instance.
972      * @param {number} orientation - Image orientation.
973      * @param {number} width - Image height.
974      * @param {number} height - Image width.
975      * @param {number} focal - Focal length.
976      * @param {number} scale - Atomic scale.
977      * @param {Array<number>} rotation - Rotation vector in three dimensions.
978      * @param {Array<number>} translation - Translation vector in three dimensions.
979      * @param {HTMLImageElement} image - Image for fallback size calculations.
980      */
981     constructor(orientation: number, width: number, height: number, scale: number, rotation: number[], translation: number[], image: HTMLImageElement, textureScale?: number[], cameraParameters?: number[], cameraType?: CameraType);
982     get ck1(): number;
983     get ck2(): number;
984     get cameraType(): CameraType;
985     /**
986      * Get basic aspect.
987      * @returns {number} The orientation adjusted aspect ratio.
988      */
989     get basicAspect(): number;
990     /**
991      * Get basic height.
992      *
993      * @description Does not fall back to image image height but
994      * uses original value from API so can be faulty.
995      *
996      * @returns {number} The height of the basic version image
997      * (adjusted for orientation).
998      */
999     get basicHeight(): number;
1000     get basicRt(): Matrix4;
1001     /**
1002      * Get basic width.
1003      *
1004      * @description Does not fall back to image image width but
1005      * uses original value from API so can be faulty.
1006      *
1007      * @returns {number} The width of the basic version image
1008      * (adjusted for orientation).
1009      */
1010     get basicWidth(): number;
1011     /**
1012      * Get focal.
1013      * @returns {number} The image focal length.
1014      */
1015     get focal(): number;
1016     /**
1017      * Get height.
1018      *
1019      * @description Falls back to the image image height if
1020      * the API data is faulty.
1021      *
1022      * @returns {number} The orientation adjusted image height.
1023      */
1024     get height(): number;
1025     /**
1026      * Get orientation.
1027      * @returns {number} The image orientation.
1028      */
1029     get orientation(): number;
1030     /**
1031      * Get rt.
1032      * @returns {THREE.Matrix4} The extrinsic camera matrix.
1033      */
1034     get rt(): Matrix4;
1035     /**
1036      * Get srt.
1037      * @returns {THREE.Matrix4} The scaled extrinsic camera matrix.
1038      */
1039     get srt(): Matrix4;
1040     /**
1041      * Get srtInverse.
1042      * @returns {THREE.Matrix4} The scaled extrinsic camera matrix.
1043      */
1044     get srtInverse(): Matrix4;
1045     /**
1046      * Get scale.
1047      * @returns {number} The image atomic reconstruction scale.
1048      */
1049     get scale(): number;
1050     /**
1051      * Get has valid scale.
1052      * @returns {boolean} Value indicating if the scale of the transform is valid.
1053      */
1054     get hasValidScale(): boolean;
1055     /**
1056      * Get radial peak.
1057      * @returns {number} Value indicating the radius where the radial
1058      * undistortion function peaks.
1059      */
1060     get radialPeak(): number;
1061     /**
1062      * Get width.
1063      *
1064      * @description Falls back to the image image width if
1065      * the API data is faulty.
1066      *
1067      * @returns {number} The orientation adjusted image width.
1068      */
1069     get width(): number;
1070     /**
1071      * Calculate the up vector for the image transform.
1072      *
1073      * @returns {THREE.Vector3} Normalized and orientation adjusted up vector.
1074      */
1075     upVector(): Vector3;
1076     /**
1077      * Calculate projector matrix for projecting 3D points to texture map
1078      * coordinates (u and v).
1079      *
1080      * @returns {THREE.Matrix4} Projection matrix for 3D point to texture
1081      * map coordinate calculations.
1082      */
1083     projectorMatrix(): Matrix4;
1084     /**
1085      * Project 3D world coordinates to basic coordinates.
1086      *
1087      * @param {Array<number>} point3d - 3D world coordinates.
1088      * @return {Array<number>} 2D basic coordinates.
1089      */
1090     projectBasic(point3d: number[]): number[];
1091     /**
1092      * Unproject basic coordinates to 3D world coordinates.
1093      *
1094      * @param {Array<number>} basic - 2D basic coordinates.
1095      * @param {Array<number>} distance - Distance to unproject from camera center.
1096      * @param {boolean} [depth] - Treat the distance value as depth from camera center.
1097      *                            Only applicable for perspective images. Will be
1098      *                            ignored for spherical.
1099      * @returns {Array<number>} Unprojected 3D world coordinates.
1100      */
1101     unprojectBasic(basic: number[], distance: number, depth?: boolean): number[];
1102     /**
1103      * Project 3D world coordinates to SfM coordinates.
1104      *
1105      * @param {Array<number>} point3d - 3D world coordinates.
1106      * @return {Array<number>} 2D SfM coordinates.
1107      */
1108     projectSfM(point3d: number[]): number[];
1109     /**
1110      * Unproject SfM coordinates to a 3D world coordinates.
1111      *
1112      * @param {Array<number>} sfm - 2D SfM coordinates.
1113      * @param {Array<number>} distance - Distance to unproject
1114      * from camera center.
1115      * @param {boolean} [depth] - Treat the distance value as
1116      * depth from camera center. Only applicable for perspective
1117      * images. Will be ignored for spherical.
1118      * @returns {Array<number>} Unprojected 3D world coordinates.
1119      */
1120     unprojectSfM(sfm: number[], distance: number, depth?: boolean): number[];
1121     /**
1122      * Transform SfM coordinates to bearing vector (3D cartesian
1123      * coordinates on the unit sphere).
1124      *
1125      * @param {Array<number>} sfm - 2D SfM coordinates.
1126      * @returns {Array<number>} Bearing vector (3D cartesian coordinates
1127      * on the unit sphere).
1128      */
1129     private _sfmToBearing;
1130     /** Compute distortion given the distorted radius.
1131      *
1132      *  Solves for d in the equation
1133      *    y = d(x, k1, k2) * x
1134      * given the distorted radius, y.
1135      */
1136     private _distortionFromDistortedRadius;
1137     /**
1138      * Transform bearing vector (3D cartesian coordiantes on the unit sphere) to
1139      * SfM coordinates.
1140      *
1141      * @param {Array<number>} bearing - Bearing vector (3D cartesian coordinates on the
1142      * unit sphere).
1143      * @returns {Array<number>} 2D SfM coordinates.
1144      */
1145     private _bearingToSfm;
1146     /**
1147      * Convert basic coordinates to SfM coordinates.
1148      *
1149      * @param {Array<number>} basic - 2D basic coordinates.
1150      * @returns {Array<number>} 2D SfM coordinates.
1151      */
1152     private _basicToSfm;
1153     /**
1154      * Convert SfM coordinates to basic coordinates.
1155      *
1156      * @param {Array<number>} sfm - 2D SfM coordinates.
1157      * @returns {Array<number>} 2D basic coordinates.
1158      */
1159     private _sfmToBasic;
1160     /**
1161      * Checks a value and returns it if it exists and is larger than 0.
1162      * Fallbacks if it is null.
1163      *
1164      * @param {number} value - Value to check.
1165      * @param {number} fallback - Value to fall back to.
1166      * @returns {number} The value or its fallback value if it is not defined or negative.
1167      */
1168     private _getValue;
1169     private _getCameraParameters;
1170     /**
1171      * Creates the extrinsic camera matrix [ R | t ].
1172      *
1173      * @param {Array<number>} rotation - Rotation vector in angle axis representation.
1174      * @param {Array<number>} translation - Translation vector.
1175      * @returns {THREE.Matrix4} Extrisic camera matrix.
1176      */
1177     private createWorldToCamera;
1178     /**
1179      * Calculates the scaled extrinsic camera matrix scale * [ R | t ].
1180      *
1181      * @param {THREE.Matrix4} worldToCamera - Extrisic camera matrix.
1182      * @param {number} scale - Scale factor.
1183      * @returns {THREE.Matrix4} Scaled extrisic camera matrix.
1184      */
1185     private _createScaledWorldToCamera;
1186     private _createBasicWorldToCamera;
1187     private _getRadialPeak;
1188     /**
1189      * Calculate a transformation matrix from normalized coordinates for
1190      * texture map coordinates.
1191      *
1192      * @returns {THREE.Matrix4} Normalized coordinates to texture map
1193      * coordinates transformation matrix.
1194      */
1195     private _normalizedToTextureMatrix;
1196 }
1197
1198 /**
1199  * @class Camera
1200  *
1201  * @classdesc Holds information about a camera.
1202  */
1203 declare class Camera {
1204     private _position;
1205     private _lookat;
1206     private _up;
1207     private _focal;
1208     /**
1209      * Create a new camera instance.
1210      * @param {Transform} [transform] - Optional transform instance.
1211      */
1212     constructor(transform?: Transform);
1213     /**
1214      * Get position.
1215      * @returns {THREE.Vector3} The position vector.
1216      */
1217     get position(): Vector3;
1218     /**
1219      * Get lookat.
1220      * @returns {THREE.Vector3} The lookat vector.
1221      */
1222     get lookat(): Vector3;
1223     /**
1224      * Get up.
1225      * @returns {THREE.Vector3} The up vector.
1226      */
1227     get up(): Vector3;
1228     /**
1229      * Get focal.
1230      * @returns {number} The focal length.
1231      */
1232     get focal(): number;
1233     /**
1234      * Set focal.
1235      */
1236     set focal(value: number);
1237     /**
1238      * Update this camera to the linearly interpolated value of two other cameras.
1239      *
1240      * @param {Camera} a - First camera.
1241      * @param {Camera} b - Second camera.
1242      * @param {number} alpha - Interpolation value on the interval [0, 1].
1243      */
1244     lerpCameras(a: Camera, b: Camera, alpha: number): void;
1245     /**
1246      * Copy the properties of another camera to this camera.
1247      *
1248      * @param {Camera} other - Another camera.
1249      */
1250     copy(other: Camera): void;
1251     /**
1252      * Clone this camera.
1253      *
1254      * @returns {Camera} A camera with cloned properties equal to this camera.
1255      */
1256     clone(): Camera;
1257     /**
1258      * Determine the distance between this camera and another camera.
1259      *
1260      * @param {Camera} other - Another camera.
1261      * @returns {number} The distance between the cameras.
1262      */
1263     diff(other: Camera): number;
1264     /**
1265      * Get the focal length based on the transform.
1266      *
1267      * @description Returns the focal length corresponding
1268      * to a 90 degree field of view for spherical
1269      * transforms.
1270      *
1271      * Returns the transform focal length for other
1272      * projection types.
1273      *
1274      * @returns {number} Focal length.
1275      */
1276     private _getFocal;
1277 }
1278
1279 declare enum State {
1280     Custom = 0,
1281     Earth = 1,
1282     Traversing = 2,
1283     Waiting = 3,
1284     WaitingInteractively = 4
1285 }
1286
1287 /**
1288  * Enumeration for edge directions
1289  * @enum {number}
1290  * @readonly
1291  * @description Directions for edges in image graph describing
1292  * sequence, spatial and image type relations between nodes.
1293  */
1294 declare enum NavigationDirection {
1295     /**
1296      * Next image in the sequence.
1297      */
1298     Next = 0,
1299     /**
1300      * Previous image in the sequence.
1301      */
1302     Prev = 1,
1303     /**
1304      * Step to the left keeping viewing direction.
1305      */
1306     StepLeft = 2,
1307     /**
1308      * Step to the right keeping viewing direction.
1309      */
1310     StepRight = 3,
1311     /**
1312      * Step forward keeping viewing direction.
1313      */
1314     StepForward = 4,
1315     /**
1316      * Step backward keeping viewing direction.
1317      */
1318     StepBackward = 5,
1319     /**
1320      * Turn 90 degrees counter clockwise.
1321      */
1322     TurnLeft = 6,
1323     /**
1324      * Turn 90 degrees clockwise.
1325      */
1326     TurnRight = 7,
1327     /**
1328      * Turn 180 degrees.
1329      */
1330     TurnU = 8,
1331     /**
1332      * Spherical in general direction.
1333      */
1334     Spherical = 9,
1335     /**
1336      * Looking in roughly the same direction at rougly the same position.
1337      */
1338     Similar = 10
1339 }
1340
1341 /**
1342  * Interface that describes additional properties of an edge.
1343  *
1344  * @interface NavigationEdgeData
1345  */
1346 interface NavigationEdgeData {
1347     /**
1348      * The edge direction.
1349      */
1350     direction: NavigationDirection;
1351     /**
1352      * The counter clockwise horizontal rotation angle from
1353      * the X-axis in a spherical coordiante system of the
1354      * motion from the source image to the destination node.
1355      */
1356     worldMotionAzimuth: number;
1357 }
1358
1359 /**
1360  * Interface that describes the properties for a
1361  * navigation edge from a source image to a
1362  * target image.
1363  *
1364  * @interface NavigationEdge
1365  */
1366 interface NavigationEdge {
1367     /**
1368      * The id of the source image.
1369      */
1370     source: string;
1371     /**
1372      * The id of the target image.
1373      */
1374     target: string;
1375     /**
1376      * Additional data describing properties of the edge.
1377      */
1378     data: NavigationEdgeData;
1379 }
1380
1381 /**
1382  * Interface that indicates edge status.
1383  *
1384  * @interface NavigationEdgeStatus
1385  */
1386 interface NavigationEdgeStatus {
1387     /**
1388      * Value indicating whether the edges have been cached.
1389      */
1390     cached: boolean;
1391     /**
1392      * The edges.
1393      *
1394      * @description If the cached property is false the edges
1395      * property will always be an empty array. If the cached
1396      * property is true, there will exist edges in the the
1397      * array if the image has edges.
1398      */
1399     edges: NavigationEdge[];
1400 }
1401
1402 /**
1403  * @class ImageCache
1404  *
1405  * @classdesc Represents the cached properties of a image.
1406  */
1407 declare class ImageCache {
1408     private _disposed;
1409     private _provider;
1410     private _image;
1411     private _mesh;
1412     private _sequenceEdges;
1413     private _spatialEdges;
1414     private _imageAborter;
1415     private _meshAborter;
1416     private _imageChanged$;
1417     private _image$;
1418     private _sequenceEdgesChanged$;
1419     private _sequenceEdges$;
1420     private _spatialEdgesChanged$;
1421     private _spatialEdges$;
1422     private _cachingAssets$;
1423     private _iamgeSubscription;
1424     private _sequenceEdgesSubscription;
1425     private _spatialEdgesSubscription;
1426     /**
1427      * Create a new image cache instance.
1428      */
1429     constructor(provider: DataProviderBase);
1430     /**
1431      * Get image.
1432      *
1433      * @description Will not be set when assets have not been cached
1434      * or when the object has been disposed.
1435      *
1436      * @returns {HTMLImageElement} Cached image element of the image.
1437      */
1438     get image(): HTMLImageElement;
1439     /**
1440      * Get image$.
1441      *
1442      * @returns {Observable<HTMLImageElement>} Observable emitting
1443      * the cached image when it is updated.
1444      */
1445     get image$(): Observable<HTMLImageElement>;
1446     /**
1447      * Get mesh.
1448      *
1449      * @description Will not be set when assets have not been cached
1450      * or when the object has been disposed.
1451      *
1452      * @returns {MeshContract} SfM triangulated mesh of reconstructed
1453      * atomic 3D points.
1454      */
1455     get mesh(): MeshContract;
1456     /**
1457      * Get sequenceEdges.
1458      *
1459      * @returns {NavigationEdgeStatus} Value describing the status of the
1460      * sequence edges.
1461      */
1462     get sequenceEdges(): NavigationEdgeStatus;
1463     /**
1464      * Get sequenceEdges$.
1465      *
1466      * @returns {Observable<NavigationEdgeStatus>} Observable emitting
1467      * values describing the status of the sequence edges.
1468      */
1469     get sequenceEdges$(): Observable<NavigationEdgeStatus>;
1470     /**
1471      * Get spatialEdges.
1472      *
1473      * @returns {NavigationEdgeStatus} Value describing the status of the
1474      * spatial edges.
1475      */
1476     get spatialEdges(): NavigationEdgeStatus;
1477     /**
1478      * Get spatialEdges$.
1479      *
1480      * @returns {Observable<NavigationEdgeStatus>} Observable emitting
1481      * values describing the status of the spatial edges.
1482      */
1483     get spatialEdges$(): Observable<NavigationEdgeStatus>;
1484     /**
1485      * Cache the image and mesh assets.
1486      *
1487      * @param {SpatialImageEnt} spatial - Spatial props of the image to cache.
1488      * @param {boolean} spherical - Value indicating whether image is a spherical.
1489      * @param {boolean} merged - Value indicating whether image is merged.
1490      * @returns {Observable<ImageCache>} Observable emitting this image
1491      * cache whenever the load status has changed and when the mesh or image
1492      * has been fully loaded.
1493      */
1494     cacheAssets$(spatial: SpatialImageEnt, merged: boolean): Observable<ImageCache>;
1495     /**
1496      * Cache an image with a higher resolution than the current one.
1497      *
1498      * @param {SpatialImageEnt} spatial - Spatial props.
1499      * @returns {Observable<ImageCache>} Observable emitting a single item,
1500      * the image cache, when the image has been cached. If supplied image
1501      * size is not larger than the current image size the image cache is
1502      * returned immediately.
1503      */
1504     cacheImage$(spatial: SpatialImageEnt): Observable<ImageCache>;
1505     /**
1506      * Cache the sequence edges.
1507      *
1508      * @param {Array<NavigationEdge>} edges - Sequence edges to cache.
1509      */
1510     cacheSequenceEdges(edges: NavigationEdge[]): void;
1511     /**
1512      * Cache the spatial edges.
1513      *
1514      * @param {Array<NavigationEdge>} edges - Spatial edges to cache.
1515      */
1516     cacheSpatialEdges(edges: NavigationEdge[]): void;
1517     /**
1518      * Dispose the image cache.
1519      *
1520      * @description Disposes all cached assets and unsubscribes to
1521      * all streams.
1522      */
1523     dispose(): void;
1524     /**
1525      * Reset the sequence edges.
1526      */
1527     resetSequenceEdges(): void;
1528     /**
1529      * Reset the spatial edges.
1530      */
1531     resetSpatialEdges(): void;
1532     /**
1533      * Cache the image.
1534      *
1535      * @param {SpatialImageEnt} spatial - Spatial image.
1536      * @param {boolean} spherical - Value indicating whether image is a spherical.
1537      * @returns {Observable<ILoadStatusObject<HTMLImageElement>>} Observable
1538      * emitting a load status object every time the load status changes
1539      * and completes when the image is fully loaded.
1540      */
1541     private _cacheImage$;
1542     /**
1543      * Cache the mesh.
1544      *
1545      * @param {SpatialImageEnt} spatial - Spatial props.
1546      * @param {boolean} merged - Value indicating whether image is merged.
1547      * @returns {Observable<ILoadStatusObject<MeshContract>>} Observable emitting
1548      * a load status object every time the load status changes and completes
1549      * when the mesh is fully loaded.
1550      */
1551     private _cacheMesh$;
1552     /**
1553      * Create a load status object with an empty mesh.
1554      *
1555      * @returns {ILoadStatusObject<MeshContract>} Load status object
1556      * with empty mesh.
1557      */
1558     private _createEmptyMesh;
1559     private _disposeImage;
1560 }
1561
1562 /**
1563  * @class Image
1564  *
1565  * @classdesc Represents a image in the navigation graph.
1566  *
1567  * Explanation of position and bearing properties:
1568  *
1569  * When images are uploaded they will have GPS information in the EXIF, this is what
1570  * is called `originalLngLat` {@link Image.originalLngLat}.
1571  *
1572  * When Structure from Motions has been run for a image a `computedLngLat` that
1573  * differs from the `originalLngLat` will be created. It is different because
1574  * GPS positions are not very exact and SfM aligns the camera positions according
1575  * to the 3D reconstruction {@link Image.computedLngLat}.
1576  *
1577  * At last there exist a `lngLat` property which evaluates to
1578  * the `computedLngLat` from SfM if it exists but falls back
1579  * to the `originalLngLat` from the EXIF GPS otherwise {@link Image.lngLat}.
1580  *
1581  * Everything that is done in in the Viewer is based on the SfM positions,
1582  * i.e. `computedLngLat`. That is why the smooth transitions go in the right
1583  * direction (nd not in strange directions because of bad GPS).
1584  *
1585  * E.g. when placing a marker in the Viewer it is relative to the SfM
1586  * position i.e. the `computedLngLat`.
1587  *
1588  * The same concept as above also applies to the compass angle (or bearing) properties
1589  * `originalCa`, `computedCa` and `ca`.
1590  */
1591 declare class Image {
1592     private _cache;
1593     private _core;
1594     private _spatial;
1595     /**
1596      * Create a new image instance.
1597      *
1598      * @description Images are always created internally by the library.
1599      * Images can not be added to the library through any API method.
1600      *
1601      * @param {CoreImageEnt} core- Raw core image data.
1602      * @ignore
1603      */
1604     constructor(core: CoreImageEnt);
1605     /**
1606      * Get assets cached.
1607      *
1608      * @description The assets that need to be cached for this property
1609      * to report true are the following: fill properties, image and mesh.
1610      * The library ensures that the current image will always have the
1611      * assets cached.
1612      *
1613      * @returns {boolean} Value indicating whether all assets have been
1614      * cached.
1615      *
1616      * @ignore
1617      */
1618     get assetsCached(): boolean;
1619     /**
1620      * Get cameraParameters.
1621      *
1622      * @description Will be undefined if SfM has
1623      * not been run.
1624      *
1625      * Camera type dependent parameters.
1626      *
1627      * For perspective and fisheye camera types,
1628      * the camera parameters array should be
1629      * constructed according to
1630      *
1631      * `[focal, k1, k2]`
1632      *
1633      * where focal is the camera focal length,
1634      * and k1, k2 are radial distortion parameters.
1635      *
1636      * For spherical camera type the camera
1637      * parameters are unset or emtpy array.
1638      *
1639      * @returns {Array<number>} The parameters
1640      * related to the camera type.
1641      */
1642     get cameraParameters(): number[];
1643     /**
1644      * Get cameraType.
1645      *
1646      * @description Will be undefined if SfM has not been run.
1647      *
1648      * @returns {string} The camera type that captured the image.
1649      */
1650     get cameraType(): string;
1651     /**
1652      * Get capturedAt.
1653      *
1654      * @description Timestamp of the image capture date
1655      * and time represented as a Unix epoch timestamp in milliseconds.
1656      *
1657      * @returns {number} Timestamp when the image was captured.
1658      */
1659     get capturedAt(): number;
1660     /**
1661      * Get clusterId.
1662      *
1663      * @returns {string} Globally unique id of the SfM cluster to which
1664      * the image belongs.
1665      */
1666     get clusterId(): string;
1667     /**
1668      * Get clusterUrl.
1669      *
1670      * @returns {string} Url to the cluster reconstruction file.
1671      *
1672      * @ignore
1673      */
1674     get clusterUrl(): string;
1675     /**
1676      * Get compassAngle.
1677      *
1678      * @description If the SfM computed compass angle exists it will
1679      * be returned, otherwise the original EXIF compass angle.
1680      *
1681      * @returns {number} Compass angle, measured in degrees
1682      * clockwise with respect to north.
1683      */
1684     get compassAngle(): number;
1685     /**
1686      * Get complete.
1687      *
1688      * @description The library ensures that the current image will
1689      * always be full.
1690      *
1691      * @returns {boolean} Value indicating whether the image has all
1692      * properties filled.
1693      *
1694      * @ignore
1695      */
1696     get complete(): boolean;
1697     /**
1698      * Get computedAltitude.
1699      *
1700      * @description If SfM has not been run the computed altitude is
1701      * set to a default value of two meters.
1702      *
1703      * @returns {number} Altitude, in meters.
1704      */
1705     get computedAltitude(): number;
1706     /**
1707      * Get computedCompassAngle.
1708      *
1709      * @description Will not be set if SfM has not been run.
1710      *
1711      * @returns {number} SfM computed compass angle, measured
1712      * in degrees clockwise with respect to north.
1713      */
1714     get computedCompassAngle(): number;
1715     /**
1716      * Get computedLngLat.
1717      *
1718      * @description Will not be set if SfM has not been run.
1719      *
1720      * @returns {LngLat} SfM computed longitude, latitude in WGS84 datum,
1721      * measured in degrees.
1722      */
1723     get computedLngLat(): LngLat;
1724     /**
1725      * Get creatorId.
1726      *
1727      * @description Note that the creator ID will not be set when using
1728      * the Mapillary API.
1729      *
1730      * @returns {string} Globally unique id of the user who uploaded
1731      * the image.
1732      */
1733     get creatorId(): string;
1734     /**
1735      * Get creatorUsername.
1736      *
1737      * @description Note that the creator username will not be set when
1738      * using the Mapillary API.
1739      *
1740      * @returns {string} Username of the creator who uploaded
1741      * the image.
1742      */
1743     get creatorUsername(): string;
1744     /**
1745      * Get exifOrientation.
1746      *
1747      * @returns {number} EXIF orientation of original image.
1748      */
1749     get exifOrientation(): number;
1750     /**
1751      * Get height.
1752      *
1753      * @returns {number} Height of original image, not adjusted
1754      * for orientation.
1755      */
1756     get height(): number;
1757     /**
1758      * Get image.
1759      *
1760      * @description The image will always be set on the current image.
1761      *
1762      * @returns {HTMLImageElement} Cached image element of the image.
1763      */
1764     get image(): HTMLImageElement;
1765     /**
1766      * Get image$.
1767      *
1768      * @returns {Observable<HTMLImageElement>} Observable emitting
1769      * the cached image when it is updated.
1770      *
1771      * @ignore
1772      */
1773     get image$(): Observable<HTMLImageElement>;
1774     /**
1775      * Get id.
1776      *
1777      * @returns {string} Globally unique id of the image.
1778      */
1779     get id(): string;
1780     /**
1781      * Get lngLat.
1782      *
1783      * @description If the SfM computed longitude, latitude exist
1784      * it will be returned, otherwise the original EXIF latitude
1785      * longitude.
1786      *
1787      * @returns {LngLat} Longitude, latitude in WGS84 datum,
1788      * measured in degrees.
1789      */
1790     get lngLat(): LngLat;
1791     /**
1792      * Get merged.
1793      *
1794      * @returns {boolean} Value indicating whether SfM has been
1795      * run on the image and the image has been merged into a
1796      * connected component.
1797      */
1798     get merged(): boolean;
1799     /**
1800      * Get mergeId.
1801      *
1802      * @description Will not be set if SfM has not yet been run on
1803      * image.
1804      *
1805      * @returns {stirng} Id of connected component to which image
1806      * belongs after the aligning merge.
1807      */
1808     get mergeId(): string;
1809     /**
1810      * Get mesh.
1811      *
1812      * @description The mesh will always be set on the current image.
1813      *
1814      * @returns {MeshContract} SfM triangulated mesh of reconstructed
1815      * atomic 3D points.
1816      */
1817     get mesh(): MeshContract;
1818     /**
1819      * Get originalAltitude.
1820      *
1821      * @returns {number} EXIF altitude, in meters, if available.
1822      */
1823     get originalAltitude(): number;
1824     /**
1825      * Get originalCompassAngle.
1826      *
1827      * @returns {number} Original EXIF compass angle, measured in
1828      * degrees.
1829      */
1830     get originalCompassAngle(): number;
1831     /**
1832      * Get originalLngLat.
1833      *
1834      * @returns {LngLat} Original EXIF longitude, latitude in
1835      * WGS84 datum, measured in degrees.
1836      */
1837     get originalLngLat(): LngLat;
1838     /**
1839      * Get ownerId.
1840      *
1841      * @returns {string} Globally unique id of the owner to which
1842      * the image belongs. If the image does not belong to an
1843      * owner the owner id will be undefined.
1844      */
1845     get ownerId(): string;
1846     /**
1847      * Get private.
1848      *
1849      * @returns {boolean} Value specifying if image is accessible to
1850      * organization members only or to everyone.
1851      */
1852     get private(): boolean;
1853     /**
1854      * Get qualityScore.
1855      *
1856      * @returns {number} A number between zero and one
1857      * determining the quality of the image. Blurriness
1858      * (motion blur / out-of-focus), occlusion (camera
1859      * mount, ego vehicle, water-drops), windshield
1860      * reflections, bad illumination (exposure, glare),
1861      * and bad weather condition (fog, rain, snow)
1862      * affect the quality score.
1863      *
1864      * @description Value should be on the interval [0, 1].
1865      */
1866     get qualityScore(): number;
1867     /**
1868      * Get rotation.
1869      *
1870      * @description Will not be set if SfM has not been run.
1871      *
1872      * @returns {Array<number>} Rotation vector in angle axis representation.
1873      */
1874     get rotation(): number[];
1875     /**
1876      * Get scale.
1877      *
1878      * @description Will not be set if SfM has not been run.
1879      *
1880      * @returns {number} Scale of reconstruction the image
1881      * belongs to.
1882      */
1883     get scale(): number;
1884     /**
1885      * Get sequenceId.
1886      *
1887      * @returns {string} Globally unique id of the sequence
1888      * to which the image belongs.
1889      */
1890     get sequenceId(): string;
1891     /**
1892      * Get sequenceEdges.
1893      *
1894      * @returns {NavigationEdgeStatus} Value describing the status of the
1895      * sequence edges.
1896      *
1897      * @ignore
1898      */
1899     get sequenceEdges(): NavigationEdgeStatus;
1900     /**
1901      * Get sequenceEdges$.
1902      *
1903      * @description Internal observable, should not be used as an API.
1904      *
1905      * @returns {Observable<NavigationEdgeStatus>} Observable emitting
1906      * values describing the status of the sequence edges.
1907      *
1908      * @ignore
1909      */
1910     get sequenceEdges$(): Observable<NavigationEdgeStatus>;
1911     /**
1912      * Get spatialEdges.
1913      *
1914      * @returns {NavigationEdgeStatus} Value describing the status of the
1915      * spatial edges.
1916      *
1917      * @ignore
1918      */
1919     get spatialEdges(): NavigationEdgeStatus;
1920     /**
1921      * Get spatialEdges$.
1922      *
1923      * @description Internal observable, should not be used as an API.
1924      *
1925      * @returns {Observable<NavigationEdgeStatus>} Observable emitting
1926      * values describing the status of the spatial edges.
1927      *
1928      * @ignore
1929      */
1930     get spatialEdges$(): Observable<NavigationEdgeStatus>;
1931     /**
1932      * Get width.
1933      *
1934      * @returns {number} Width of original image, not
1935      * adjusted for orientation.
1936      */
1937     get width(): number;
1938     /**
1939      * Cache the image and mesh assets.
1940      *
1941      * @description The assets are always cached internally by the
1942      * library prior to setting a image as the current image.
1943      *
1944      * @returns {Observable<Image>} Observable emitting this image whenever the
1945      * load status has changed and when the mesh or image has been fully loaded.
1946      *
1947      * @ignore
1948      */
1949     cacheAssets$(): Observable<Image>;
1950     /**
1951      * Cache the image asset.
1952      *
1953      * @description Use for caching a differently sized image than
1954      * the one currently held by the image.
1955      *
1956      * @returns {Observable<Image>} Observable emitting this image whenever the
1957      * load status has changed and when the mesh or image has been fully loaded.
1958      *
1959      * @ignore
1960      */
1961     cacheImage$(): Observable<Image>;
1962     /**
1963      * Cache the sequence edges.
1964      *
1965      * @description The sequence edges are cached asynchronously
1966      * internally by the library.
1967      *
1968      * @param {Array<NavigationEdge>} edges - Sequence edges to cache.
1969      * @ignore
1970      */
1971     cacheSequenceEdges(edges: NavigationEdge[]): void;
1972     /**
1973      * Cache the spatial edges.
1974      *
1975      * @description The spatial edges are cached asynchronously
1976      * internally by the library.
1977      *
1978      * @param {Array<NavigationEdge>} edges - Spatial edges to cache.
1979      * @ignore
1980      */
1981     cacheSpatialEdges(edges: NavigationEdge[]): void;
1982     /**
1983      * Dispose the image.
1984      *
1985      * @description Disposes all cached assets.
1986      * @ignore
1987      */
1988     dispose(): void;
1989     /**
1990      * Initialize the image cache.
1991      *
1992      * @description The image cache is initialized internally by
1993      * the library.
1994      *
1995      * @param {ImageCache} cache - The image cache to set as cache.
1996      * @ignore
1997      */
1998     initializeCache(cache: ImageCache): void;
1999     /**
2000      * Complete an image with spatial properties.
2001      *
2002      * @description The image is completed internally by
2003      * the library.
2004      *
2005      * @param {SpatialImageEnt} fill - The spatial image struct.
2006      * @ignore
2007      */
2008     makeComplete(fill: SpatialImageEnt): void;
2009     /**
2010      * Reset the sequence edges.
2011      *
2012      * @ignore
2013      */
2014     resetSequenceEdges(): void;
2015     /**
2016      * Reset the spatial edges.
2017      *
2018      * @ignore
2019      */
2020     resetSpatialEdges(): void;
2021     /**
2022      * Clears the image and mesh assets, aborts
2023      * any outstanding requests and resets edges.
2024      *
2025      * @ignore
2026      */
2027     uncache(): void;
2028 }
2029
2030 interface IAnimationState {
2031     reference: LngLatAlt;
2032     alpha: number;
2033     camera: Camera;
2034     zoom: number;
2035     currentImage: Image;
2036     currentCamera: Camera;
2037     previousImage: Image;
2038     trajectory: Image[];
2039     currentIndex: number;
2040     lastImage: Image;
2041     imagesAhead: number;
2042     currentTransform: Transform;
2043     previousTransform: Transform;
2044     motionless: boolean;
2045     state: State;
2046 }
2047
2048 interface AnimationFrame {
2049     id: number;
2050     fps: number;
2051     state: IAnimationState;
2052 }
2053
2054 interface EulerRotation {
2055     phi: number;
2056     theta: number;
2057 }
2058
2059 declare class RenderCamera {
2060     private _spatial;
2061     private _viewportCoords;
2062     private _alpha;
2063     private _renderMode;
2064     private _zoom;
2065     private _frameId;
2066     private _size;
2067     private _camera;
2068     private _perspective;
2069     private _rotation;
2070     private _changed;
2071     private _changedForFrame;
2072     private _currentImageId;
2073     private _previousImageId;
2074     private _currentSpherical;
2075     private _previousSpherical;
2076     private _state;
2077     private _currentProjectedPoints;
2078     private _previousProjectedPoints;
2079     private _currentFov;
2080     private _previousFov;
2081     private _initialFov;
2082     constructor(elementWidth: number, elementHeight: number, renderMode: RenderMode);
2083     get alpha(): number;
2084     get camera(): Camera;
2085     get changed(): boolean;
2086     get frameId(): number;
2087     get perspective(): PerspectiveCamera;
2088     get renderMode(): RenderMode;
2089     get rotation(): EulerRotation;
2090     get zoom(): number;
2091     get size(): ViewportSize;
2092     getTilt(): number;
2093     fovToZoom(fov: number): number;
2094     setFrame(frame: AnimationFrame): void;
2095     setProjectionMatrix(matrix: number[]): void;
2096     setRenderMode(renderMode: RenderMode): void;
2097     setSize(size: ViewportSize): void;
2098     private _computeAspect;
2099     private _computeCurrentFov;
2100     private _computeFov;
2101     private _computePreviousFov;
2102     private _computeProjectedPoints;
2103     private _computeRequiredVerticalFov;
2104     private _computeRotation;
2105     private _computeVerticalFov;
2106     private _yToFov;
2107     private _interpolateFov;
2108     private _setFrameId;
2109 }
2110
2111 declare class RenderService {
2112     private _bearing$;
2113     private _element;
2114     private _currentFrame$;
2115     private _projectionMatrix$;
2116     private _renderCameraOperation$;
2117     private _renderCameraHolder$;
2118     private _renderCameraFrame$;
2119     private _renderCamera$;
2120     private _resize$;
2121     private _size$;
2122     private _spatial;
2123     private _renderMode$;
2124     private _subscriptions;
2125     constructor(element: HTMLElement, currentFrame$: Observable<AnimationFrame>, renderMode: RenderMode, renderCamera?: RenderCamera);
2126     get bearing$(): Observable<number>;
2127     get element(): HTMLElement;
2128     get projectionMatrix$(): Subject<number[]>;
2129     get renderCamera$(): Observable<RenderCamera>;
2130     get renderCameraFrame$(): Observable<RenderCamera>;
2131     get renderMode$(): Subject<RenderMode>;
2132     get resize$(): Subject<void>;
2133     get size$(): Observable<ViewportSize>;
2134     dispose(): void;
2135 }
2136
2137 interface VirtualNodeHash {
2138     name: string;
2139     vNode: VNode;
2140 }
2141
2142 declare class DOMRenderer {
2143     private _renderService;
2144     private _currentFrame$;
2145     private _adaptiveOperation$;
2146     private _offset$;
2147     private _element$;
2148     private _vPatch$;
2149     private _vNode$;
2150     private _render$;
2151     private _renderAdaptive$;
2152     private _subscriptions;
2153     constructor(element: HTMLElement, renderService: RenderService, currentFrame$: Observable<AnimationFrame>);
2154     get element$(): Observable<Element>;
2155     get render$(): Subject<VirtualNodeHash>;
2156     get renderAdaptive$(): Subject<VirtualNodeHash>;
2157     clear(name: string): void;
2158     remove(): void;
2159 }
2160
2161 interface GLRenderFunction extends Function {
2162     (perspectiveCamera: PerspectiveCamera, renderer: WebGLRenderer): void;
2163 }
2164
2165 declare enum RenderPass$1 {
2166     Background = 0,
2167     Opaque = 1
2168 }
2169
2170 interface GLFrameRenderer {
2171     frameId: number;
2172     needsRender: boolean;
2173     render: GLRenderFunction;
2174     pass: RenderPass$1;
2175 }
2176
2177 interface GLRenderHash {
2178     name: string;
2179     renderer: GLFrameRenderer;
2180 }
2181
2182 declare class GLRenderer {
2183     private _renderService;
2184     private _renderFrame$;
2185     private _renderCameraOperation$;
2186     private _renderCamera$;
2187     private _render$;
2188     private _clear$;
2189     private _renderOperation$;
2190     private _renderCollection$;
2191     private _rendererOperation$;
2192     private _renderer$;
2193     private _eraserOperation$;
2194     private _eraser$;
2195     private _triggerOperation$;
2196     private _webGLRenderer$;
2197     private _renderFrameSubscription;
2198     private _subscriptions;
2199     private _opaqueRender$;
2200     constructor(canvas: HTMLCanvasElement, canvasContainer: HTMLElement, renderService: RenderService);
2201     get render$(): Subject<GLRenderHash>;
2202     get opaqueRender$(): Observable<void>;
2203     get webGLRenderer$(): Observable<WebGLRenderer>;
2204     clear(name: string): void;
2205     remove(): void;
2206     triggerRerender(): void;
2207     private _renderFrameSubscribe;
2208 }
2209
2210 /**
2211  * Enumeration for transition mode
2212  * @enum {number}
2213  * @readonly
2214  * @description Modes for specifying how transitions
2215  * between images are performed.
2216  */
2217 declare enum TransitionMode {
2218     /**
2219      * Default transitions.
2220      *
2221      * @description The viewer dynamically determines
2222      * whether transitions should be performed with or
2223      * without motion and blending for each transition
2224      * based on the underlying data.
2225      */
2226     Default = 0,
2227     /**
2228      * Instantaneous transitions.
2229      *
2230      * @description All transitions are performed
2231      * without motion or blending.
2232      */
2233     Instantaneous = 1
2234 }
2235
2236 declare class StateService {
2237     private _start$;
2238     private _frame$;
2239     private _contextOperation$;
2240     private _context$;
2241     private _fps$;
2242     private _state$;
2243     private _currentState$;
2244     private _lastState$;
2245     private _currentImage$;
2246     private _currentImageExternal$;
2247     private _currentCamera$;
2248     private _currentId$;
2249     private _currentTransform$;
2250     private _reference$;
2251     private _inMotionOperation$;
2252     private _inMotion$;
2253     private _inTranslationOperation$;
2254     private _inTranslation$;
2255     private _appendImage$;
2256     private _frameGenerator;
2257     private _frameId;
2258     private _fpsSampleRate;
2259     private _subscriptions;
2260     constructor(initialState: State, transitionMode?: TransitionMode);
2261     get currentState$(): Observable<AnimationFrame>;
2262     get currentImage$(): Observable<Image>;
2263     get currentId$(): Observable<string>;
2264     get currentImageExternal$(): Observable<Image>;
2265     get currentCamera$(): Observable<Camera>;
2266     get currentTransform$(): Observable<Transform>;
2267     get state$(): Observable<State>;
2268     get reference$(): Observable<LngLatAlt>;
2269     get inMotion$(): Observable<boolean>;
2270     get inTranslation$(): Observable<boolean>;
2271     get appendImage$(): Subject<Image>;
2272     dispose(): void;
2273     custom(): void;
2274     earth(): void;
2275     traverse(): void;
2276     wait(): void;
2277     waitInteractively(): void;
2278     appendImagess(images: Image[]): void;
2279     prependImages(images: Image[]): void;
2280     removeImages(n: number): void;
2281     clearImages(): void;
2282     clearPriorImages(): void;
2283     cutImages(): void;
2284     setImages(images: Image[]): void;
2285     setViewMatrix(matrix: number[]): void;
2286     rotate(delta: EulerRotation): void;
2287     rotateUnbounded(delta: EulerRotation): void;
2288     rotateWithoutInertia(delta: EulerRotation): void;
2289     rotateBasic(basicRotation: number[]): void;
2290     rotateBasicUnbounded(basicRotation: number[]): void;
2291     rotateBasicWithoutInertia(basicRotation: number[]): void;
2292     rotateToBasic(basic: number[]): void;
2293     move(delta: number): void;
2294     moveTo(position: number): void;
2295     dolly(delta: number): void;
2296     orbit(rotation: EulerRotation): void;
2297     truck(direction: number[]): void;
2298     /**
2299      * Change zoom level while keeping the reference point position approximately static.
2300      *
2301      * @parameter {number} delta - Change in zoom level.
2302      * @parameter {Array<number>} reference - Reference point in basic coordinates.
2303      */
2304     zoomIn(delta: number, reference: number[]): void;
2305     getCenter(): Observable<number[]>;
2306     getZoom(): Observable<number>;
2307     setCenter(center: number[]): void;
2308     setSpeed(speed: number): void;
2309     setTransitionMode(mode: TransitionMode): void;
2310     setZoom(zoom: number): void;
2311     start(): void;
2312     stop(): void;
2313     private _invokeContextOperation;
2314     private _frame;
2315 }
2316
2317 declare class DOM {
2318     private _document;
2319     constructor(doc?: Node);
2320     get document(): HTMLDocument;
2321     createElement<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
2322 }
2323
2324 /**
2325  * Enumeration for component size.
2326  * @enum {number}
2327  * @readonly
2328  * @description May be used by a component to allow for resizing
2329  * of the UI elements rendered by the component.
2330  */
2331 declare enum ComponentSize {
2332     /**
2333      * Automatic size. The size of the elements will automatically
2334      * change at a predefined threshold.
2335      */
2336     Automatic = 0,
2337     /**
2338      * Large size. The size of the elements will be fixed until another
2339      * component size is configured.
2340      */
2341     Large = 1,
2342     /**
2343      * Small size. The size of the elements will be fixed until another
2344      * component size is configured.
2345      */
2346     Small = 2
2347 }
2348
2349 interface BearingConfiguration extends ComponentConfiguration {
2350     /**
2351      * The size of the ui elements.
2352      *
2353      * @default ComponentSize.Automatic
2354      */
2355     size?: ComponentSize;
2356 }
2357
2358 /**
2359  * Interface for configuration of cache depth.
2360  *
2361  * @interface
2362  * @example
2363  * ```js
2364  * var viewer = new Viewer({
2365  *     ...
2366  *     component: {
2367  *         cache: {
2368  *             depth: {
2369  *                 spherical: 2,
2370  *                 sequence: 3,
2371  *             }
2372  *         },
2373  *     },
2374  *     ...
2375  * });
2376  * ```
2377  */
2378 interface CacheDepthConfiguration {
2379     /**
2380      * Cache depth in the sequence directions.
2381      *
2382      * @description Max value is 4. Value will be clamped
2383      * to the interval [0, 4].
2384      * @default 2
2385      */
2386     sequence: number;
2387     /**
2388      * Cache depth in the spherical direction.
2389      *
2390      * @description Max value is 2. Value will be clamped
2391      * to the interval [0, 2].
2392      * @default 1
2393      */
2394     spherical: number;
2395     /**
2396      * Cache depth in the step directions.
2397      *
2398      * @description Max value is 3. Value will be clamped
2399      * to the interval [0, 3].
2400      * @default 1
2401      */
2402     step: number;
2403     /**
2404      * Cache depth in the turn directions.
2405      *
2406      * @description Max value is 1. Value will be clamped
2407      * to the interval [0, 1].
2408      * @default 0
2409      */
2410     turn: number;
2411 }
2412 /**
2413  * Interface for configuration of cache component.
2414  *
2415  * @interface
2416  */
2417 interface CacheConfiguration extends ComponentConfiguration {
2418     /**
2419      * Cache depth struct.
2420      */
2421     depth?: CacheDepthConfiguration;
2422 }
2423
2424 /**
2425  * Interface for configuration of direction component.
2426  *
2427  * @interface
2428  * @example
2429  * ```js
2430  * var viewer = new Viewer({
2431  *     ...
2432  *     component: {
2433  *         direction: {
2434  *             minWidth: 140,
2435  *             maxWidth: 340,
2436  *         },
2437  *     },
2438  *     ...
2439  * });
2440  * ```
2441  */
2442 interface DirectionConfiguration extends ComponentConfiguration {
2443     /**
2444      * Determines if the sequence arrow appearance should be different from
2445      * the non sequence arrows.
2446      *
2447      * @description Needs to be set to true for the sequence suffixed classes
2448      * to be applied to the navigation elements. Additional calculations will be
2449      * performed resulting in a performance cost.
2450      *
2451      * @default false
2452      */
2453     distinguishSequence?: boolean;
2454     /**
2455      * The image id representing the direction arrow to be highlighted.
2456      *
2457      * @description The arrow pointing towards the image corresponding to the
2458      * highlight id will be highlighted.
2459      *
2460      * @default undefined
2461      */
2462     highlightId?: string;
2463     /**
2464      * The min width of the non transformed container element holding
2465      * the navigation arrows.
2466      *
2467      * @description  Set min width of the non transformed
2468      * container element holding the navigation arrows.
2469      * If the min width is larger than the max width the
2470      * min width value will be used.
2471      *
2472      * The container element is automatically resized when the resize
2473      * method on the Viewer class is called.
2474      *
2475      * @default 260
2476      */
2477     minWidth?: number;
2478     /**
2479      * The max width of the non transformed container element holding
2480      * the navigation arrows.
2481      *
2482      * @description Set max width of the non transformed
2483      * container element holding the navigation arrows.
2484      * If the min width is larger than the max width the
2485      * min width value will be used.
2486      *
2487      * The container element is automatically resized when the resize
2488      * method on the Viewer class is called.
2489      *
2490      * @default 460
2491      */
2492     maxWidth?: number;
2493 }
2494
2495 /**
2496  * Interface for configuration of keyboard component.
2497  *
2498  * @interface
2499  * @example
2500  * ```js
2501  * var viewer = new Viewer({
2502  *     ...
2503  *     component: {
2504  *         keyboard: {
2505  *             keyZoom: false,
2506  *             keySequenceNavigation: false,
2507  *             keySpatialNavigation: false,
2508  *         },
2509  *     },
2510  *     ...
2511  * });
2512  * ```
2513  */
2514 interface KeyboardConfiguration extends ComponentConfiguration {
2515     /**
2516      * Enable or disable the `KeyPlayHandler`.
2517      *
2518      * @default true
2519      */
2520     keyPlay?: boolean;
2521     /**
2522      * Enable or disable the `KeySequenceNavigationHandler`.
2523      *
2524      * @default true
2525      */
2526     keySequenceNavigation?: boolean;
2527     /**
2528      * Enable or disable the `KeySpatialNavigationHandler`.
2529      *
2530      * @default true
2531      */
2532     keySpatialNavigation?: boolean;
2533     /**
2534      * Enable or disable the `KeyZoomHandler`.
2535      *
2536      * @default true
2537      */
2538     keyZoom?: boolean;
2539 }
2540
2541 /**
2542  * Interface for configuration of marker component.
2543  *
2544  * @interface
2545  * @example
2546  * ```js
2547  * var viewer = new Viewer({
2548  *     ...
2549  *     component: {
2550  *         marker: {
2551  *             visibleBBoxSize: 80,
2552  *         },
2553  *     },
2554  *     ...
2555  * });
2556  * ```
2557  */
2558 interface MarkerConfiguration extends ComponentConfiguration {
2559     /**
2560      * The size of the bounding box for which markers will be visible.
2561      *
2562      * @description Provided values will be clamped to the [1, 200]
2563      * interval.
2564      *
2565      * @default 100
2566      */
2567     visibleBBoxSize?: number;
2568 }
2569
2570 /**
2571  * Interface for configuration of mouse component.
2572  *
2573  * @interface
2574  * @example
2575  * ```js
2576  * var viewer = new Viewer({
2577  *     ...
2578  *     component: {
2579  *         pointer: {
2580  *             dragPan: false,
2581  *             scrollZoom: false,
2582  *             touchZoom: false,
2583  *         },
2584  *     },
2585  *     ...
2586  * });
2587  * ```
2588  */
2589 interface PointerConfiguration extends ComponentConfiguration {
2590     /**
2591      * Activate or deactivate the `DragPanHandler`.
2592      *
2593      * @default true
2594      */
2595     dragPan?: boolean;
2596     /**
2597      * Activate or deactivate the `EarthControlHandler`.
2598      *
2599      * @default true
2600      */
2601     earthControl?: boolean;
2602     /**
2603      * Activate or deactivate the `ScrollZoomHandler`.
2604      *
2605      * @default true
2606      */
2607     scrollZoom?: boolean;
2608     /**
2609      * Activate or deactivate the `TouchZoomHandler`.
2610      *
2611      * @default true
2612      */
2613     touchZoom?: boolean;
2614 }
2615
2616 /**
2617  * Interface for configuration of sequence component.
2618  *
2619  * @interface
2620  * @example
2621  * ```js
2622  * const viewer = new Viewer({
2623  *     ...
2624  *     component: {
2625  *         sequence: {
2626  *             minWidth: 40,
2627  *             maxWidth: 80,
2628  *             visible: false,
2629  *         },
2630  *     },
2631  *     ...
2632  * });
2633  * ```
2634  */
2635 interface SequenceConfiguration extends ComponentConfiguration {
2636     /**
2637      * Set the direction to follow when playing.
2638      *
2639      * @default EdgeDirection.Next
2640      */
2641     direction?: NavigationDirection;
2642     /**
2643      * The node id representing the direction arrow to be highlighted.
2644      *
2645      * @description When set to null no direction will be highlighted.
2646      * The arrow pointing towards the node corresponding to the
2647      * highlight id will be highlighted.
2648      *
2649      * @default undefined
2650      *
2651      * @ignore
2652      */
2653     highlightId?: string;
2654     /**
2655      * The max width of the sequence container.
2656      *
2657      * @description Set max width of the container element holding
2658      * the sequence navigation elements. If the min width is larger than the
2659      * max width the min width value will be used.
2660      *
2661      * The container element is automatically resized when the resize
2662      * method on the Viewer class is called.
2663      *
2664      * @default 117
2665      */
2666     maxWidth?: number;
2667     /**
2668      * The min width of the sequence container.
2669      *
2670      * @description Set min width of the container element holding
2671      * the sequence navigation elements. If the min width is larger than the
2672      * max width the min width value will be used.
2673      *
2674      * The container element is automatically resized when the resize
2675      * method on the Viewer class is called.
2676      *
2677      * @default 70
2678      */
2679     minWidth?: number;
2680     /**
2681      * Indicating wheter the component is playing.
2682      *
2683      * @default false
2684      */
2685     playing?: boolean;
2686     /**
2687      * Determine whether the sequence UI elements
2688      * should be visible.
2689      *
2690      * @default true
2691      */
2692     visible?: boolean;
2693 }
2694
2695 /**
2696  * Enumeration for slider mode.
2697  *
2698  * @enum {number}
2699  * @readonly
2700  *
2701  * @description Modes for specifying how transitions
2702  * between images are performed in slider mode. Only
2703  * applicable when the slider component determines
2704  * that transitions with motion is possilble. When it
2705  * is not, the stationary mode will be applied.
2706  */
2707 declare enum SliderConfigurationMode {
2708     /**
2709      * Transitions with motion.
2710      *
2711      * @description The slider component moves the
2712      * camera between the image origins.
2713      *
2714      * In this mode it is not possible to zoom or pan.
2715      *
2716      * The slider component falls back to stationary
2717      * mode when it determines that the pair of images
2718      * does not have a strong enough relation.
2719      */
2720     Motion = 0,
2721     /**
2722      * Stationary transitions.
2723      *
2724      * @description The camera is stationary.
2725      *
2726      * In this mode it is possible to zoom and pan.
2727      */
2728     Stationary = 1
2729 }
2730 /**
2731  * Interface for configuration of slider ids.
2732  *
2733  * @interface
2734  */
2735 interface SliderConfigurationIds {
2736     /**
2737      * Id for the image plane in the background.
2738      */
2739     background: string;
2740     /**
2741      * Id for the image plane in the foreground.
2742      */
2743     foreground: string;
2744 }
2745 /**
2746  * Interface for configuration of slider component.
2747  *
2748  * @interface
2749  * ```js
2750  * var viewer = new Viewer({
2751  *     ...
2752  *     component: {
2753  *         slider: {
2754  *             initialPosition: 0.5,
2755  *             ids: {
2756  *                 background: '<background-id>',
2757  *                 foreground: '<foreground-id>',
2758  *             },
2759  *             sliderVisible: true,
2760  *         },
2761  *     },
2762  *     ...
2763  * });
2764  * ```
2765  */
2766 interface SliderConfiguration extends ComponentConfiguration {
2767     /**
2768      * Initial position of the slider on the interval [0, 1].
2769      *
2770      * @description Configures the intial position of the slider.
2771      * The inital position value will be used when the component
2772      * is activated.
2773      *
2774      * @default 1
2775      */
2776     initialPosition?: number;
2777     /**
2778      * Slider image ids.
2779      *
2780      * @description Configures the component to show the image
2781      * planes for the supplied image ids  in the foreground
2782      * and the background.
2783      */
2784     ids?: SliderConfigurationIds;
2785     /**
2786      * Value indicating whether the slider should be visible.
2787      *
2788      * @description Set the value controlling if the
2789      * slider is visible.
2790      *
2791      * @default true
2792      */
2793     sliderVisible?: boolean;
2794     /**
2795      * Mode used for image pair transitions.
2796      *
2797      * @description Configures the mode for transitions between
2798      * image pairs.
2799      */
2800     mode?: SliderConfigurationMode;
2801 }
2802
2803 declare enum CameraVisualizationMode {
2804     /**
2805      * Cameras are hidden.
2806      */
2807     Hidden = 0,
2808     /**
2809      * Cameras are shown, all with the same color.
2810      */
2811     Homogeneous = 1,
2812     /**
2813      * Cameras are shown with colors based on the
2814      * their clusters.
2815      */
2816     Cluster = 2,
2817     /**
2818      * Cameras are shown with colors based on the
2819      * their connected components.
2820      */
2821     ConnectedComponent = 3,
2822     /**
2823      * Cameras are shown, with colors based on the
2824      * their sequence.
2825      */
2826     Sequence = 4
2827 }
2828
2829 declare enum OriginalPositionMode {
2830     /**
2831      * Original positions are hidden.
2832      */
2833     Hidden = 0,
2834     /**
2835      * Visualize original positions with altitude change.
2836      */
2837     Altitude = 1,
2838     /**
2839      * Visualize original positions without altitude change,
2840      * i.e. as flat lines from the camera origin.
2841      */
2842     Flat = 2
2843 }
2844
2845 /**
2846  * Interface for configuration of spatial component.
2847  *
2848  * @interface
2849  * @example
2850  * ```js
2851  * var viewer = new Viewer({
2852  *     ...
2853  *     component: {
2854  *         spatial: {
2855  *             cameraSize: 0.5,
2856  *             cameraVisualizationMode: CameraVisualizationMode.Cluster,
2857  *             cellsVisible: true,
2858  *             originalPositionMode: OriginalPositionMode.Altitude,
2859  *             pointSize: 0.5,
2860  *             pointsVisible: false,
2861  *         },
2862  *     },
2863  *     ...
2864  * });
2865  * ```
2866  */
2867 interface SpatialConfiguration extends ComponentConfiguration {
2868     /**
2869      * The camera size on the interval [0.01, 1].
2870      *
2871      * @default 0.1
2872      */
2873     cameraSize?: number;
2874     /**
2875      * Specify the camera visualization mode.
2876      *
2877      * @default CameraVisualizationMode.Homogeneous
2878      */
2879     cameraVisualizationMode?: CameraVisualizationMode;
2880     /**
2881      * Specify if the currently rendered cells should be visualize on
2882      * an approximated ground plane.
2883      *
2884      * @default false
2885      */
2886     cellsVisible?: boolean;
2887     /**
2888      * Cell grid depth from the cell of the currently
2889      * selected camera.
2890      *
2891      * @description Max value is 3. Value will be clamped
2892      * to the interval [1, 3].
2893      * @default 1
2894      */
2895     cellGridDepth?: number;
2896     /**
2897      * Specify the original position visualization mode.
2898      *
2899      * @description The original positions are hidden
2900      * by default.
2901      *
2902      * @default OriginalPositionMode.Hidden
2903      */
2904     originalPositionMode?: OriginalPositionMode;
2905     /**
2906      * The point size on the interval [0.01, 1].
2907      *
2908      * @default 0.1
2909      */
2910     pointSize?: number;
2911     /**
2912      * Specify if the points should be visible or not.
2913      *
2914      * @default true
2915      */
2916     pointsVisible?: boolean;
2917 }
2918
2919 /**
2920  * Enumeration for tag modes
2921  * @enum {number}
2922  * @readonly
2923  * @description Modes for the interaction in the tag component.
2924  */
2925 declare enum TagMode {
2926     /**
2927      * Disables creating tags.
2928      */
2929     Default = 0,
2930     /**
2931      * Create a point geometry through a click.
2932      */
2933     CreatePoint = 1,
2934     /**
2935      * Create a points geometry through clicks.
2936      */
2937     CreatePoints = 2,
2938     /**
2939      * Create a polygon geometry through clicks.
2940      */
2941     CreatePolygon = 3,
2942     /**
2943      * Create a rect geometry through clicks.
2944      */
2945     CreateRect = 4,
2946     /**
2947      * Create a rect geometry through drag.
2948      *
2949      * @description Claims the mouse which results in mouse handlers like
2950      * drag pan and scroll zoom becoming inactive.
2951      */
2952     CreateRectDrag = 5
2953 }
2954
2955 /**
2956  * Interface for configuration of tag component.
2957  *
2958  * @interface
2959  * @example
2960  * ```js
2961  * var viewer = new Viewer({
2962  *     ...
2963  *     component: {
2964  *         tag: {
2965  *             createColor: 0xFF0000,
2966  *             mode: TagMode.CreateRect,
2967  *         },
2968  *     },
2969  *     ...
2970  * });
2971  * ```
2972  */
2973 interface TagConfiguration extends ComponentConfiguration {
2974     /**
2975      * The color of vertices and edges for tags that
2976      * are being created.
2977      *
2978      * @default 0xFFFFFF
2979      */
2980     createColor?: number;
2981     /**
2982      * Show an indicator at the centroid of the points geometry
2983      * that creates the geometry when clicked.
2984      * @default true
2985      */
2986     indicatePointsCompleter?: boolean;
2987     /**
2988      * The interaction mode of the tag component.
2989      *
2990      * @default TagMode.Default
2991      */
2992     mode?: TagMode;
2993 }
2994
2995 interface ZoomConfiguration extends ComponentConfiguration {
2996     /**
2997      * The size of the ui elements.
2998      *
2999      * @default ComponentSize.Automatic
3000      */
3001     size?: ComponentSize;
3002 }
3003
3004 /**
3005  * Interface for configuration of navigation component.
3006  *
3007  * @interface
3008  *  @example
3009  * ```js
3010  * var viewer = new Viewer({
3011  *     ...
3012  *     component: {
3013  *         fallback: {
3014  *             navigation: {
3015  *                 spatial: false,
3016  *             },
3017  *         },
3018  *     },
3019  *     ...
3020  * });
3021  * ```
3022  */
3023 interface NavigationFallbackConfiguration extends ComponentConfiguration {
3024     /**
3025      * Enable or disable the sequence arrows.
3026      *
3027      * @default true
3028      */
3029     sequence?: boolean;
3030     /**
3031      * Enable or disable the spatial arrows.
3032      *
3033      * @default true
3034      */
3035     spatial?: boolean;
3036 }
3037
3038 /**
3039  * Interface for the fallback component options that can be
3040  * provided to the viewer when the browser does not have
3041  * WebGL support.
3042  *
3043  * @interface
3044  */
3045 interface FallbackOptions {
3046     /**
3047      * Show static images without pan, zoom, or transitions.
3048      *
3049      * @description Fallback for `image` when WebGL is not supported.
3050      *
3051      * @default false
3052      */
3053     image?: boolean;
3054     /**
3055      * Show static navigation arrows in the corners.
3056      *
3057      * @description Fallback for `direction` and `sequence` when WebGL is not supported.
3058      *
3059      * @default false
3060      */
3061     navigation?: boolean | NavigationFallbackConfiguration;
3062 }
3063
3064 /**
3065  * Interface for the component options that can be provided to the viewer.
3066  *
3067  * @interface
3068  */
3069 interface ComponentOptions {
3070     /**
3071      * Show attribution.
3072      *
3073      * @default true
3074      */
3075     attribution?: boolean;
3076     /**
3077      * Show indicator for bearing and field of view.
3078      *
3079      * @default true
3080      */
3081     bearing?: boolean | BearingConfiguration;
3082     /**
3083      * Cache images around the current one.
3084      *
3085      * @default true
3086      */
3087     cache?: boolean | CacheConfiguration;
3088     /**
3089      * Use a cover to avoid loading data until viewer interaction.
3090      *
3091      * @default true
3092      */
3093     cover?: boolean;
3094     /**
3095      * Show spatial direction arrows for navigation.
3096      *
3097      * @description Default spatial navigation when there is WebGL support.
3098      * Requires WebGL support.
3099      *
3100      * @default true
3101      */
3102     direction?: boolean | DirectionConfiguration;
3103     /**
3104      * Enable fallback component options
3105      * when the browser does not have WebGL support.
3106      *
3107      * @default undefined
3108      */
3109     fallback?: FallbackOptions;
3110     /**
3111      * Show image planes in 3D.
3112      *
3113      * @description Requires WebGL support.
3114      *
3115      * @default true
3116      */
3117     image?: boolean;
3118     /**
3119      * Enable use of keyboard commands.
3120      *
3121      * @description Requires WebGL support.
3122      *
3123      * @default true
3124      */
3125     keyboard?: boolean | KeyboardConfiguration;
3126     /**
3127      * Enable an interface for showing 3D markers in the viewer.
3128      *
3129      * @description Requires WebGL support.
3130      *
3131      * @default false
3132      */
3133     marker?: boolean | MarkerConfiguration;
3134     /**
3135      * Enable mouse, pen, and touch interaction for zoom and pan.
3136      *
3137      * @description Requires WebGL support.
3138      *
3139      * @default true
3140      */
3141     pointer?: boolean | PointerConfiguration;
3142     /**
3143      * Show HTML popups over images.
3144      *
3145      * @description Requires WebGL support.
3146      *
3147      * @default false
3148      */
3149     popup?: boolean;
3150     /**
3151      * Show sequence related navigation.
3152      *
3153      * @description Default sequence navigation when there is WebGL support.
3154      *
3155      * @default true
3156      */
3157     sequence?: boolean | SequenceConfiguration;
3158     /**
3159      * Show a slider for transitioning between image planes.
3160      *
3161      * @description Requires WebGL support.
3162      *
3163      * @default false
3164      */
3165     slider?: boolean | SliderConfiguration;
3166     /**
3167      * Enable an interface for showing spatial data in the viewer.
3168      *
3169      * @description Requires WebGL support.
3170      *
3171      * @default false
3172      */
3173     spatial?: boolean | SpatialConfiguration;
3174     /**
3175      * Enable an interface for drawing 2D geometries on top of images.
3176      *
3177      * @description Requires WebGL support.
3178      *
3179      * @default false
3180      */
3181     tag?: boolean | TagConfiguration;
3182     /**
3183      * Show buttons for zooming in and out.
3184      *
3185      * @description Requires WebGL support.
3186      *
3187      * @default true
3188      */
3189     zoom?: boolean | ZoomConfiguration;
3190 }
3191
3192 /**
3193  * Interface for the URL options that can be provided to the viewer.
3194  *
3195  * @interface
3196  */
3197 interface UrlOptions {
3198     /**
3199      * Explore host.
3200      *
3201      * @description Host used for links to the full
3202      * mapillary website.
3203      *
3204      * @default {"www.mapillary.com"}
3205      */
3206     exploreHost?: string;
3207     /**
3208      * Scheme.
3209      *
3210      * @description Used for all hosts.
3211      *
3212      * @default {"https"}
3213      */
3214     scheme?: string;
3215 }
3216
3217 /**
3218  * Enumeration for camera controls.
3219  *
3220  * @description Specifies different modes for how the
3221  * camera is controlled through pointer, keyboard or
3222  * other modes of input.
3223  *
3224  * @enum {number}
3225  * @readonly
3226  */
3227 declare enum CameraControls {
3228     /**
3229      * Control the camera with custom logic by
3230      * attaching a custom camera controls
3231      * instance to the {@link Viewer}.
3232      */
3233     Custom = 0,
3234     /**
3235      * Control the camera from a birds perspective
3236      * to get an overview.
3237      */
3238     Earth = 1,
3239     /**
3240      * Control the camera in a first person view
3241      * from the street level perspective.
3242      */
3243     Street = 2
3244 }
3245
3246 /**
3247  * Interface for the options that can be provided to the {@link Viewer}.
3248  */
3249 interface ViewerOptions {
3250     /**
3251      * Optional access token for API requests of
3252      * resources.
3253      *
3254      * @description Can be a user access token or
3255      * a client access token.
3256      *
3257      * A Mapillary client access token can be obtained
3258      * by [registering an application](https://www.mapillary.com/dashboard/developers).
3259      *
3260      * The access token can also be set through the
3261      * {@link Viewer.setAccessToken} method.
3262      */
3263     accessToken?: string;
3264     /**
3265      * Value specifying the initial camera controls of
3266      * the viewer.
3267      *
3268      * @default {@link CameraControls.Street}
3269      */
3270     cameraControls?: CameraControls;
3271     /**
3272      * Value specifying if combined panning should be activated.
3273      *
3274      * @default true
3275      */
3276     combinedPanning?: boolean;
3277     /**
3278      * Component options.
3279      */
3280     component?: ComponentOptions;
3281     /**
3282      * The HTML element in which MapillaryJS will render the
3283      * viewer, or the element's string `id`. The
3284      * specified element must have no children.
3285      */
3286     container: string | HTMLElement;
3287     /**
3288      * Optional data provider class instance for API and static
3289      * resource requests.
3290      *
3291      * @description The data provider will override the
3292      * default MapillaryJS data provider and take responsibility
3293      * for all IO handling.
3294      *
3295      * The data provider takes precedance over the {@link }
3296      *
3297      * A data provider instance must extend
3298      * the data provider base class.
3299      */
3300     dataProvider?: DataProviderBase;
3301     /**
3302      * Optional `image-id` to start from. The id
3303      * can be any Mapillary image. If a id is provided the viewer is
3304      * bound to that id until it has been fully loaded. If null is provided
3305      * no image is loaded at viewer initialization and the viewer is not
3306      * bound to any particular id. Any image can then be navigated to
3307      * with e.g. `viewer.moveTo("<my-image-id>")`.
3308      */
3309     imageId?: string;
3310     /**
3311      * Value indicating if the viewer should fetch high resolution
3312      * image tiles.
3313      *
3314      * @description Can be used when extending MapillaryJS with
3315      * a custom data provider. If no image tiling server exists
3316      * the image tiling can be inactivated to avoid error
3317      * messages about non-existing tiles in the console.
3318      *
3319      * @default true
3320      */
3321     imageTiling?: boolean;
3322     /**
3323      * The render mode in the viewer.
3324      *
3325      * @default {@link RenderMode.Fill}
3326      */
3327     renderMode?: RenderMode;
3328     /**
3329      * A base URL for retrieving a PNG sprite image and json metadata file.
3330      * File name extensions will be automatically appended.
3331      */
3332     sprite?: string;
3333     /**
3334      * If `true`, the viewer will automatically resize when the
3335      * browser window resizes.
3336      *
3337      * @default true
3338      */
3339     trackResize?: boolean;
3340     /**
3341      * The transtion mode in the viewer.
3342      *
3343      * @default {@link TransitionMode.Default}
3344      */
3345     transitionMode?: TransitionMode;
3346     /**
3347      * The URL options.
3348      */
3349     url?: UrlOptions;
3350 }
3351
3352 declare class KeyboardService {
3353     private _keyDown$;
3354     private _keyUp$;
3355     constructor(canvasContainer: HTMLElement);
3356     get keyDown$(): Observable<KeyboardEvent>;
3357     get keyUp$(): Observable<KeyboardEvent>;
3358 }
3359
3360 declare class MouseService {
3361     private _activeSubject$;
3362     private _active$;
3363     private _domMouseDown$;
3364     private _domMouseMove$;
3365     private _domMouseDragStart$;
3366     private _domMouseDrag$;
3367     private _domMouseDragEnd$;
3368     private _documentMouseMove$;
3369     private _documentMouseUp$;
3370     private _mouseDown$;
3371     private _mouseEnter$;
3372     private _mouseMove$;
3373     private _mouseLeave$;
3374     private _mouseUp$;
3375     private _mouseOut$;
3376     private _mouseOver$;
3377     private _contextMenu$;
3378     private _consistentContextMenu$;
3379     private _click$;
3380     private _dblClick$;
3381     private _deferPixelClaims$;
3382     private _deferPixels$;
3383     private _proximateClick$;
3384     private _staticClick$;
3385     private _mouseWheel$;
3386     private _mouseDragStart$;
3387     private _mouseDrag$;
3388     private _mouseDragEnd$;
3389     private _mouseRightDragStart$;
3390     private _mouseRightDrag$;
3391     private _mouseRightDragEnd$;
3392     private _claimMouse$;
3393     private _claimWheel$;
3394     private _mouseOwner$;
3395     private _wheelOwner$;
3396     private _windowBlur$;
3397     private _subscriptions;
3398     constructor(container: EventTarget, canvasContainer: EventTarget, domContainer: EventTarget, doc: EventTarget);
3399     get active$(): Observable<boolean>;
3400     get activate$(): Subject<boolean>;
3401     get documentMouseMove$(): Observable<MouseEvent>;
3402     get documentMouseUp$(): Observable<MouseEvent>;
3403     get domMouseDragStart$(): Observable<MouseEvent>;
3404     get domMouseDrag$(): Observable<MouseEvent>;
3405     get domMouseDragEnd$(): Observable<MouseEvent | FocusEvent>;
3406     get domMouseDown$(): Observable<MouseEvent>;
3407     get domMouseMove$(): Observable<MouseEvent>;
3408     get mouseOwner$(): Observable<string>;
3409     get mouseDown$(): Observable<MouseEvent>;
3410     get mouseEnter$(): Observable<MouseEvent>;
3411     get mouseMove$(): Observable<MouseEvent>;
3412     get mouseLeave$(): Observable<MouseEvent>;
3413     get mouseOut$(): Observable<MouseEvent>;
3414     get mouseOver$(): Observable<MouseEvent>;
3415     get mouseUp$(): Observable<MouseEvent>;
3416     get click$(): Observable<MouseEvent>;
3417     get dblClick$(): Observable<MouseEvent>;
3418     get contextMenu$(): Observable<MouseEvent>;
3419     get mouseWheel$(): Observable<WheelEvent>;
3420     get mouseDragStart$(): Observable<MouseEvent>;
3421     get mouseDrag$(): Observable<MouseEvent>;
3422     get mouseDragEnd$(): Observable<MouseEvent | FocusEvent>;
3423     get mouseRightDragStart$(): Observable<MouseEvent>;
3424     get mouseRightDrag$(): Observable<MouseEvent>;
3425     get mouseRightDragEnd$(): Observable<MouseEvent | FocusEvent>;
3426     get proximateClick$(): Observable<MouseEvent>;
3427     get staticClick$(): Observable<MouseEvent>;
3428     get windowBlur$(): Observable<FocusEvent>;
3429     dispose(): void;
3430     claimMouse(name: string, zindex: number): void;
3431     unclaimMouse(name: string): void;
3432     deferPixels(name: string, deferPixels: number): void;
3433     undeferPixels(name: string): void;
3434     claimWheel(name: string, zindex: number): void;
3435     unclaimWheel(name: string): void;
3436     filtered$<T>(name: string, observable$: Observable<T>): Observable<T>;
3437     filteredWheel$<T>(name: string, observable$: Observable<T>): Observable<T>;
3438     private _createDeferredMouseMove$;
3439     private _createMouseDrag$;
3440     private _createMouseDragEnd$;
3441     private _createMouseDragStart$;
3442     private _createMouseDragInitiate$;
3443     private _createOwner$;
3444     private _filtered;
3445     private _mouseButton;
3446     private _buttonReleased;
3447     private _isMousePen;
3448 }
3449
3450 /**
3451  * Enumeration for alignments
3452  * @enum {number}
3453  * @readonly
3454  */
3455 declare enum Alignment {
3456     /**
3457      * Align to bottom
3458      */
3459     Bottom = 0,
3460     /**
3461      * Align to bottom left
3462      */
3463     BottomLeft = 1,
3464     /**
3465      * Align to bottom right
3466      */
3467     BottomRight = 2,
3468     /**
3469      * Align to center
3470      */
3471     Center = 3,
3472     /**
3473      * Align to left
3474      */
3475     Left = 4,
3476     /**
3477      * Align to right
3478      */
3479     Right = 5,
3480     /**
3481      * Align to top
3482      */
3483     Top = 6,
3484     /**
3485      * Align to top left
3486      */
3487     TopLeft = 7,
3488     /**
3489      * Align to top right
3490      */
3491     TopRight = 8
3492 }
3493
3494 interface ISpriteAtlas {
3495     loaded: boolean;
3496     getGLSprite(name: string): Object3D;
3497     getDOMSprite(name: string, float?: Alignment): VNode;
3498 }
3499
3500 declare class SpriteAtlas implements ISpriteAtlas {
3501     private _image;
3502     private _texture;
3503     private _json;
3504     set json(value: Sprites);
3505     set image(value: HTMLImageElement);
3506     get loaded(): boolean;
3507     getGLSprite(name: string): Object3D;
3508     getDOMSprite(name: string, float?: Alignment): VNode;
3509 }
3510 interface Sprite {
3511     width: number;
3512     height: number;
3513     x: number;
3514     y: number;
3515     pixelRatio: number;
3516 }
3517 interface Sprites {
3518     [key: string]: Sprite;
3519 }
3520 declare class SpriteService {
3521     private _retina;
3522     private _spriteAtlasOperation$;
3523     private _spriteAtlas$;
3524     private _atlasSubscription;
3525     constructor(sprite?: string);
3526     get spriteAtlas$(): Observable<SpriteAtlas>;
3527     dispose(): void;
3528 }
3529
3530 interface TouchPinch {
3531     /**
3532      * X client coordinate for center of pinch.
3533      */
3534     clientX: number;
3535     /**
3536      * Y client coordinate for center of pinch.
3537      */
3538     clientY: number;
3539     /**
3540      * X page coordinate for center of pinch.
3541      */
3542     pageX: number;
3543     /**
3544      * Y page coordinate for center of pinch.
3545      */
3546     pageY: number;
3547     /**
3548      * X screen coordinate for center of pinch.
3549      */
3550     screenX: number;
3551     /**
3552      * Y screen coordinate for center of pinch.
3553      */
3554     screenY: number;
3555     /**
3556      * Distance change in X direction between touches
3557      * compared to previous event.
3558      */
3559     changeX: number;
3560     /**
3561      * Distance change in Y direction between touches
3562      * compared to previous event.
3563      */
3564     changeY: number;
3565     /**
3566      * Pixel distance between touches.
3567      */
3568     distance: number;
3569     /**
3570      * Change in pixel distance between touches compared
3571      * to previous event.
3572      */
3573     distanceChange: number;
3574     /**
3575      * Distance in X direction between touches.
3576      */
3577     distanceX: number;
3578     /**
3579      * Distance in Y direction between touches.
3580      */
3581     distanceY: number;
3582     /**
3583      * Original touch event.
3584      */
3585     originalEvent: TouchEvent;
3586     /**
3587      * First touch.
3588      */
3589     touch1: Touch;
3590     /**
3591      * Second touch.
3592      */
3593     touch2: Touch;
3594 }
3595
3596 declare class TouchService {
3597     private _activeSubject$;
3598     private _active$;
3599     private _touchStart$;
3600     private _touchMove$;
3601     private _touchEnd$;
3602     private _touchCancel$;
3603     private _singleTouchDrag$;
3604     private _singleTouchDragStart$;
3605     private _singleTouchDragEnd$;
3606     private _singleTouchMove$;
3607     private _pinchOperation$;
3608     private _pinch$;
3609     private _pinchStart$;
3610     private _pinchEnd$;
3611     private _pinchChange$;
3612     private _doubleTap$;
3613     private _subscriptions;
3614     constructor(canvasContainer: HTMLElement, domContainer: HTMLElement);
3615     get active$(): Observable<boolean>;
3616     get activate$(): Subject<boolean>;
3617     get doubleTap$(): Observable<TouchEvent>;
3618     get touchStart$(): Observable<TouchEvent>;
3619     get touchMove$(): Observable<TouchEvent>;
3620     get touchEnd$(): Observable<TouchEvent>;
3621     get touchCancel$(): Observable<TouchEvent>;
3622     get singleTouchDragStart$(): Observable<TouchEvent>;
3623     get singleTouchDrag$(): Observable<TouchEvent>;
3624     get singleTouchDragEnd$(): Observable<TouchEvent>;
3625     get pinch$(): Observable<TouchPinch>;
3626     get pinchStart$(): Observable<TouchEvent>;
3627     get pinchEnd$(): Observable<TouchEvent>;
3628     dispose(): void;
3629 }
3630
3631 /**
3632  * Test whether the current browser supports the full
3633  * functionality of MapillaryJS.
3634  *
3635  * @description The full functionality includes WebGL rendering.
3636  *
3637  * @return {boolean}
3638  *
3639  * @example `var supported = isSupported();`
3640  */
3641 declare function isSupported(): boolean;
3642 /**
3643  * Test whether the current browser supports the fallback
3644  * functionality of MapillaryJS.
3645  *
3646  * @description The fallback functionality does not include WebGL
3647  * rendering, only 2D canvas rendering.
3648  *
3649  * @return {boolean}
3650  *
3651  * @example `var fallbackSupported = isFallbackSupported();`
3652  */
3653 declare function isFallbackSupported(): boolean;
3654
3655 declare type ComparisonFilterOperator = "==" | "!=" | ">" | ">=" | "<" | "<=";
3656 declare type SetMembershipFilterOperator = "in" | "!in";
3657 declare type CombiningFilterOperator = "all";
3658 declare type FilterOperator = CombiningFilterOperator | ComparisonFilterOperator | SetMembershipFilterOperator;
3659 declare type FilterImage = Pick<Image, "cameraType" | "capturedAt" | "clusterId" | "creatorId" | "creatorUsername" | "exifOrientation" | "height" | "id" | "mergeId" | "merged" | "ownerId" | "private" | "qualityScore" | "sequenceId" | "width">;
3660 declare type FilterKey = keyof FilterImage;
3661 declare type FilterValue = boolean | number | string;
3662 declare type ComparisonFilterExpression = [
3663     ComparisonFilterOperator,
3664     FilterKey,
3665     FilterValue
3666 ];
3667 declare type SetMembershipFilterExpression = [
3668     SetMembershipFilterOperator,
3669     FilterKey,
3670     ...FilterValue[]
3671 ];
3672 declare type CombiningFilterExpression = [
3673     CombiningFilterOperator,
3674     ...(ComparisonFilterExpression | SetMembershipFilterExpression)[]
3675 ];
3676 declare type FilterExpression = ComparisonFilterExpression | SetMembershipFilterExpression | CombiningFilterExpression;
3677
3678 /**
3679  * @event
3680  */
3681 declare type ViewerEventType = "bearing" | "click" | "contextmenu" | "dblclick" | "fov" | "dataloading" | "load" | "mousedown" | "mousemove" | "mouseout" | "mouseover" | "mouseup" | "moveend" | "movestart" | "navigable" | "image" | "position" | "pov" | "remove" | "sequenceedges" | "spatialedges";
3682
3683 declare enum RenderPass {
3684     /**
3685      * Occurs after the background render pass.
3686      */
3687     Opaque = 0
3688 }
3689
3690 /**
3691  * @interface
3692  *
3693  * @description Interface for custom renderers. This is a
3694  * specification for implementers to model: it is not
3695  * an exported method or class.
3696  *
3697  * A custom renderer allows the API user to render directly
3698  * into the viewer's GL context using the viewer's camera.
3699  *
3700  * Custom renderers must have a unique id. They must implement
3701  * render, onReferenceChanged, onAdd, and onRemove. They can
3702  * trigger rendering using {@link Viewer.triggerRerender}.
3703  *
3704  * The viewer uses a metric topocentric
3705  * [local east, north, up coordinate system](https://en.wikipedia.org/wiki/Local_tangent_plane_coordinates).
3706  *
3707  * Custom renderers can calculate the topocentric positions
3708  * of their objects using the reference parameter of the
3709  * renderer interface methods and the {@link geodeticToEnu}
3710  * method.
3711  *
3712  * During a render pass, custom renderers
3713  * are called in the order they were added.
3714  */
3715 interface ICustomRenderer {
3716     /**
3717      * A unique renderer id.
3718      */
3719     id: string;
3720     /**
3721      * The custom renderer's render pass.
3722      *
3723      * @description The {@link ICustomRenderer.render} method
3724      * will be called during this render pass.
3725      */
3726     renderPass: RenderPass;
3727     /**
3728      * Method called when the renderer has been added to the
3729      * viewer. This gives the
3730      * renderer a chance to initialize gl resources and
3731      * register event listeners.
3732      *
3733      * @description Custom renderers are added with the
3734      * with {@link Viewer.addCustomRenderer} method.
3735      *
3736      * Calculate the topocentric positions
3737      * for scene objects using the provided reference and
3738      * the {@link geodeticToEnu} function.
3739      *
3740      * @param {IViewer} viewer - The viewer this custom renderer
3741      * was just added to.
3742      * @param {LngLatAlt} reference - The viewer's current
3743      * reference position.
3744      * @param {WebGLRenderingContext | WebGL2RenderingContext} context -
3745      * The viewer's gl context.
3746      */
3747     onAdd(viewer: IViewer, reference: LngLatAlt, context: WebGLRenderingContext | WebGL2RenderingContext): void;
3748     /**
3749      * Method called when the viewer's reference position has changed.
3750      * This gives the renderer a chance to reposition its scene objects.
3751      *
3752      * @description Calculate the updated topocentric positions
3753      * for scene objects using the provided reference and
3754      * the {@link geodeticToEnu} function.
3755      *
3756      * @param {IViewer} viewer - The viewer this custom renderer
3757      * is added to.
3758      * @param {LngLatAlt} reference - The viewer's current
3759      * reference position.
3760      */
3761     onReference(viewer: IViewer, reference: LngLatAlt): void;
3762     /**
3763      * Method called when the renderer has been removed from the
3764      * viewer. This gives the
3765      * renderer a chance to clean up gl resources and event
3766      * listeners.
3767      *
3768      * @description Custom renderers are remove with the
3769      * {@link Viewer.removeCustomRenderer} method.
3770      *
3771      * @param {IViewer} viewer - The viewer this custom renderer
3772      * was just removed from.
3773      * @param {WebGLRenderingContext | WebGL2RenderingContext} context -
3774      * The viewer's gl context.
3775      */
3776     onRemove(viewer: IViewer, context: WebGLRenderingContext | WebGL2RenderingContext): void;
3777     /**
3778      * Called during an animation frame allowing the renderer to draw
3779      * into the GL context. The layer cannot make assumptions
3780      * about the current GL state.
3781      *
3782      * @description Take a look at the
3783      * [WebGL model view projection article](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_model_view_projection)
3784      * on MDN for an introduction to the view and projection matrices.
3785      *
3786      * @param {WebGLRenderingContext | WebGL2RenderingContext} context The
3787      * viewer's WebGL context.
3788      * @param {Array<number>} viewMatrix The viewer's view matrix.
3789      * @param {Array<number>} projectionMatrix The viewers's projection
3790      * matrix.
3791      */
3792     render(context: WebGLRenderingContext | WebGL2RenderingContext, viewMatrix: number[], projectionMatrix: number[]): void;
3793 }
3794
3795 /**
3796  * @interface PointOfView
3797  *
3798  * Interface that represents the point of view of the viewer.
3799  */
3800 interface PointOfView {
3801     /**
3802      * Value indicating the current bearing of the viewer
3803      * measured in degrees clockwise with respect to north.
3804      * Ranges from 0° to 360°.
3805      */
3806     bearing: number;
3807     /**
3808      * The camera tilt in degrees, relative to a horizontal plane.
3809      * Ranges from 90° (directly upwards) to -90° (directly downwards).
3810      */
3811     tilt: number;
3812 }
3813
3814 interface IViewer {
3815     readonly isNavigable: boolean;
3816     activateCombinedPanning(): void;
3817     activateComponent(name: string): void;
3818     activateCover(): void;
3819     addCustomRenderer(renderer: ICustomRenderer): void;
3820     deactivateCombinedPanning(): void;
3821     deactivateComponent(name: string): void;
3822     deactivateCover(): void;
3823     fire<T>(type: ViewerEventType, event: T): void;
3824     getBearing(): Promise<number>;
3825     getCanvas(): HTMLCanvasElement;
3826     getCanvasContainer(): HTMLDivElement;
3827     getCenter(): Promise<number[]>;
3828     getComponent<TComponent extends Component<ComponentConfiguration>>(name: string): TComponent;
3829     getContainer(): HTMLElement;
3830     getFieldOfView(): Promise<number>;
3831     getPointOfView(): Promise<PointOfView>;
3832     getPosition(): Promise<LngLat>;
3833     getZoom(): Promise<number>;
3834     hasCustomRenderer(rendererId: string): boolean;
3835     moveDir(direction: NavigationDirection): Promise<Image>;
3836     moveTo(imageId: string): Promise<Image>;
3837     off<T>(type: ViewerEventType, handler: (event: T) => void): void;
3838     on<T>(type: ViewerEventType, handler: (event: T) => void): void;
3839     project(lngLat: LngLat): Promise<number[]>;
3840     projectFromBasic(basicPoint: number[]): Promise<number[]>;
3841     remove(): void;
3842     removeCustomRenderer(rendererId: string): void;
3843     resize(): void;
3844     setCenter(center: number[]): void;
3845     setFieldOfView(fov: number): void;
3846     setFilter(filter: FilterExpression): Promise<void>;
3847     setRenderMode(renderMode: RenderMode): void;
3848     setTransitionMode(transitionMode: TransitionMode): void;
3849     setAccessToken(accessToken?: string): Promise<void>;
3850     setZoom(zoom: number): void;
3851     triggerRerender(): void;
3852     unproject(pixelPoint: number[]): Promise<LngLat>;
3853     unprojectToBasic(pixelPoint: number[]): Promise<number[]>;
3854 }
3855
3856 /**
3857  * @interface
3858  *
3859  * @description Interface for custom camera controls.
3860  * This is a specification for implementers to model:
3861  * it is not an exported method or class.
3862  *
3863  * Custom camera controls allow the API user to freely
3864  * move the viewer's camera and define the camera
3865  * projection used. These camera properties are used
3866  * to render the viewer 3D scene directly into the
3867  * viewer's GL context.
3868  *
3869  * Custom camera controls must implement the
3870  * onActivate, onAnimationFrame, onAttach, onDeactivate,
3871  * onDetach, onReference, and onResize methods.
3872  *
3873  * Custom camera controls trigger rerendering
3874  * automatically when the camera pose or projection
3875  * is changed through the projectionMatrix and
3876  * viewMatrix callbacks.
3877  *
3878  * See the
3879  * [model view projection article]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_model_view_projection}
3880  * on MDN for an introduction to view and projection matrices.
3881  *
3882  * Custom camera controls can choose to make updates on
3883  * each animation frame or only based on user input.
3884  * Invoking updates on each camera frame is more resource
3885  * intensive.
3886  *
3887  * Only a single custom camera control instance can be
3888  * attached to the viewer at any given time.
3889  */
3890 interface ICustomCameraControls {
3891     /**
3892      * Method called when the camera controls have been
3893      * activated and is responsible for moving the
3894      * viewer's camera and defining its projection. This
3895      * method gives the camera controls a chance to initialize
3896      * resources, perform any transitions, and determine
3897      * initial state.
3898      *
3899      * @description Use the {@link Viewer.getContainer} method
3900      * to get the container for determining the viewer size
3901      * and aspect as well as for attaching event handlers.
3902      *
3903      * Use the view matrix to determine initial properties such
3904      * as camera position, forward vector, and up vector.
3905      *
3906      * Use the projection matrix to determine the initial
3907      * projection properties.
3908      *
3909      * Store the reference coordiante translations
3910      * during future reference reference changes.
3911      *
3912      * @param {IViewer} viewer - The viewer this custom
3913      * camera controls instance was just added to.
3914      * @param {Array<number>} viewMatrix - The viewer's view matrix.
3915      * @param {Array<number>} projectionMatrix - The viewers's
3916      * projection matrix.
3917      * @param {LngLatAlt} reference - The viewer's reference.
3918      */
3919     onActivate(viewer: IViewer, viewMatrix: number[], projectionMatrix: number[], reference: LngLatAlt): void;
3920     /**
3921      * Method called for each animation frame.
3922      *
3923      * @desdcription Custom camera controls can choose to
3924      * make updates on each animation frame or only based on
3925      * user input. Invoking updates on each animation frame is
3926      * more resource intensive.
3927      *
3928      * @param {IViewer} viewer - The viewer this custom
3929      * camera controls instance is attached to.
3930      *
3931      * @param {number} frameId - The request animation frame's id.
3932      */
3933     onAnimationFrame(viewer: IViewer, frameId: number): void;
3934     /**
3935      * Method called when the camera controls have been
3936      * attached to the viewer.
3937      * This gives the camera controls a chance to initialize
3938      * resources.
3939      *
3940      * @description Camera controls are attached to the
3941      * viewer with the  with {@link Viewer.attachCustomCameraControls}
3942      * method.
3943      *
3944      * Use the matrix callback functions
3945      * to modify the camera pose and projection of the
3946      * viewer's camera.
3947      *
3948      * Invoking the matrix callbacks has no effect if the
3949      * custom camera controls have not been activated.
3950      *
3951      * @param {IViewer} viewer - The viewer this custom
3952      * camera controls instance was just added to.
3953      */
3954     onAttach(viewer: IViewer, viewMatrixCallback: (viewMatrix: number[]) => void, projectionMatrixCallback: (projectionMatrix: number[]) => void): void;
3955     /**
3956      * Method called when the camera controls have been deactivated.
3957      * This gives the camera controls a chance to clean up resources
3958      * and event listeners.
3959      *
3960      * @param {IViewer} viewer - The viewer this custom camera controls
3961      * instance is attached to.
3962      */
3963     onDeactivate(viewer: IViewer): void;
3964     /**
3965      * Method called when the camera controls have been detached from
3966      * the viewer. This gives the camera controls a chance to clean
3967      * up resources and event listeners.
3968      *
3969      * @description Camera controls are attached to the
3970      * viewer with the  with {@link Viewer.detachCustomCameraControls}
3971      * method.
3972      *
3973      * @param {IViewer} viewer - The viewer this custom camera
3974      * controls instance was just detached from.
3975      */
3976     onDetach(viewer: IViewer): void;
3977     /**
3978      * Method called when the viewer's reference position has changed.
3979      * This gives the custom camera controls a chance to reposition
3980      * the camera.
3981      *
3982      * @description Calculate the updated topocentric positions
3983      * for scene objects using the previous reference, the
3984      * new provided reference as well as the
3985      * {@link geodeticToEnu} and
3986      * {@link enuToGeodetic} functions.
3987      *
3988      * @param {IViewer} viewer - The viewer this custom renderer
3989      * is added to.
3990      * @param {LngLatAlt} reference - The viewer's current
3991      * reference position.
3992      */
3993     onReference(viewer: IViewer, reference: LngLatAlt): void;
3994     /**
3995      * Method called when the viewer has been resized.
3996      *
3997      * @description Use this method to modify the projection.
3998      */
3999     onResize(viewer: IViewer): void;
4000 }
4001
4002 /**
4003  * Interface for general viewer events.
4004  */
4005 interface ViewerEvent {
4006     /**
4007      * The viewer object that fired the event.
4008      */
4009     target: IViewer;
4010     /**
4011      * The event type.
4012      */
4013     type: ViewerEventType;
4014 }
4015
4016 /**
4017  * Interface for bearing viewer events.
4018  */
4019 interface ViewerBearingEvent extends ViewerEvent {
4020     /**
4021      * Bearing is measured in degrees
4022      * clockwise with respect to north.
4023      *
4024      * @description Bearing is related to the computed
4025      * compass angle ({@link Image.computedCompassAngle})
4026      * from SfM, not the original EXIF compass angle.
4027      */
4028     bearing: number;
4029     type: "bearing";
4030 }
4031
4032 /**
4033  * Interface for viewer data loading events.
4034  *
4035  * @description Fired when any viewer data (image, mesh, metadata, etc)
4036  * begins loading or changing asyncronously as a result of viewer
4037  * navigation.
4038  *
4039  * Also fired when the data has finished loading and the viewer
4040  * is able to perform the navigation.
4041  */
4042 interface ViewerDataLoadingEvent extends ViewerEvent {
4043     /**
4044      * Indicates if the viewer navigation is awaiting data load.
4045      */
4046     loading: boolean;
4047     type: "dataloading";
4048 }
4049
4050 /**
4051  * Interface for mouse-related viewer events.
4052  *
4053  * @example
4054  * ```js
4055  * // The `click` event is an example of a `ViewerMouseEvent`.
4056  * // Set up an event listener on the viewer.
4057  * viewer.on('click', function(e) {
4058  *   // The event object contains information like the
4059  *   // coordinates of the point in the viewer that was clicked.
4060  *   console.log('A click event has occurred at ' + e.lngLat);
4061  * });
4062  * ```
4063  */
4064 interface ViewerMouseEvent extends ViewerEvent {
4065     /**
4066      * The basic coordinates in the current image of the mouse
4067      * event target.
4068      *
4069      * @description In some situations mouse events can occur outside of
4070      * the border of a image. In that case the basic coordinates will be
4071      * `null`.
4072      *
4073      * The basic point is only provided when the
4074      * {@link CameraControls.Street} mode is active. For all other camera
4075      * control modes, the basic point will be `null`.
4076      *
4077      * Basic coordinates are 2D coordinates on the [0, 1] interval
4078      * and has the origin point, (0, 0), at the top left corner and the
4079      * maximum value, (1, 1), at the bottom right corner of the original
4080      * image.
4081      */
4082     basicPoint: number[];
4083     /**
4084      * The geographic location in the viewer of the mouse event target.
4085      *
4086      * @description In some situations the viewer can not determine a valid
4087      * geographic location for the mouse event target. In that case the
4088      * geographic coordinates will be `null`.
4089      */
4090     lngLat: LngLat;
4091     /**
4092      * The pixel coordinates of the mouse event target, relative to
4093      * the viewer and measured from the top left corner.
4094      */
4095     pixelPoint: number[];
4096     /**
4097      * The original event that triggered the viewer event.
4098      */
4099     originalEvent: MouseEvent;
4100     /**
4101      * The event type.
4102      */
4103     type: "click" | "contextmenu" | "dblclick" | "mousedown" | "mousemove" | "mouseout" | "mouseover" | "mouseup";
4104 }
4105
4106 /**
4107  * Interface for navigable viewer events.
4108  */
4109 interface ViewerNavigableEvent extends ViewerEvent {
4110     /**
4111      * The navigable state indicates if the viewer supports
4112      * moving, i.e. calling the `moveTo` and `moveDir`
4113      * methods. The viewer will not be in a navigable state if the cover
4114      * is activated and the viewer has been supplied a id. When the cover
4115      * is deactivated or activated without being supplied a id it will
4116      * be navigable.
4117      */
4118     navigable: boolean;
4119     type: "navigable";
4120 }
4121
4122 /**
4123  * Interface for navigation edge viewer events.
4124  */
4125 interface ViewerNavigationEdgeEvent extends ViewerEvent {
4126     /**
4127      * The viewer's current navigation edge status.
4128      */
4129     status: NavigationEdgeStatus;
4130     type: "sequenceedges" | "spatialedges";
4131 }
4132
4133 /**
4134  * Interface for viewer image events.
4135  */
4136 interface ViewerImageEvent extends ViewerEvent {
4137     /**
4138      * The viewer's current image.
4139      */
4140     image: Image;
4141     type: "image";
4142 }
4143
4144 /**
4145  * Interface for viewer state events.
4146  *
4147  * @example
4148  * ```js
4149  * // The `fov` event is an example of a `ViewerStateEvent`.
4150  * // Set up an event listener on the viewer.
4151  * viewer.on('fov', function(e) {
4152  *   console.log('A fov event has occured');
4153  * });
4154  * ```
4155  */
4156 interface ViewerStateEvent extends ViewerEvent {
4157     /**
4158      * The event type.
4159      */
4160     type: "fov" | "moveend" | "movestart" | "position" | "pov" | "remove";
4161 }
4162
4163 declare type ComponentName = "attribution" | "bearing" | "cache" | "cover" | "direction" | "image" | "keyboard" | "marker" | "pointer" | "popup" | "sequence" | "slider" | "spatial" | "tag" | "zoom";
4164
4165 declare type FallbackComponentName = "imagefallback" | "navigationfallback";
4166
4167 /**
4168  * Interface for viewer load events.
4169  *
4170  * @description Fired immediately after all necessary resources
4171  * have been downloaded and the first visually complete
4172  * rendering of the viewer has occurred.
4173  *
4174  * The visually complete rendering does not include custom
4175  * renderers.
4176  *
4177  * This event is only fired for viewer configurations where
4178  * the WebGL context is created, i.e. not when using the
4179  * fallback functionality only.
4180  *
4181  * @example
4182  * ```js
4183  * // Set up an event listener on the viewer.
4184  * viewer.on('load', function(e) {
4185  *   console.log('A load event has occured');
4186  * });
4187  * ```
4188  */
4189 interface ViewerLoadEvent extends ViewerEvent {
4190     type: "load";
4191 }
4192
4193 /**
4194  * @class Viewer
4195  *
4196  * @classdesc The Viewer object represents the navigable image viewer.
4197  * Create a Viewer by specifying a container, client ID, image id and
4198  * other options. The viewer exposes methods and events for programmatic
4199  * interaction.
4200  *
4201  * In the case of asynchronous methods, MapillaryJS returns promises to
4202  * the results. Notifications are always emitted through JavaScript events.
4203  */
4204 declare class Viewer extends EventEmitter implements IViewer {
4205     /**
4206      * Private component controller object which manages component states.
4207      */
4208     private _componentController;
4209     /**
4210      * Private container object which maintains the DOM Element,
4211      * renderers and relevant services.
4212      */
4213     private _container;
4214     /**
4215      * Private observer object which observes the viewer state and
4216      * fires events on behalf of the viewer.
4217      */
4218     private _observer;
4219     /**
4220      * Private navigator object which controls navigation.
4221      */
4222     private _navigator;
4223     /**
4224      * Private custom camera controls object which handles
4225      * custom control subscriptions.
4226      */
4227     private _customCameraControls;
4228     /**
4229      * Private custom renderer object which controls WebGL custom
4230      * rendering subscriptions.
4231      */
4232     private _customRenderer;
4233     /**
4234      * Create a new viewer instance.
4235      *
4236      * @description It is possible to initialize the viewer with or
4237      * without a id.
4238      *
4239      * When you want to show a specific image in the viewer from
4240      * the start you should initialize it with a id.
4241      *
4242      * When you do not know the first image id at implementation
4243      * time, e.g. in a map-viewer application you should initialize
4244      * the viewer without a id and call `moveTo` instead.
4245      *
4246      * When initializing with a id the viewer is bound to that id
4247      * until the image for that id has been successfully loaded.
4248      * Also, a cover with the image of the id will be shown.
4249      * If the data for that id can not be loaded because the id is
4250      * faulty or other errors occur it is not possible to navigate
4251      * to another id because the viewer is not navigable. The viewer
4252      * becomes navigable when the data for the id has been loaded and
4253      * the image is shown in the viewer. This way of initializing
4254      * the viewer is mostly for embedding in blog posts and similar
4255      * where one wants to show a specific image initially.
4256      *
4257      * If the viewer is initialized without a id (with null or
4258      * undefined) it is not bound to any particular id and it is
4259      * possible to move to any id with `viewer.moveTo("<my-image-id>")`.
4260      * If the first move to a id fails it is possible to move to another
4261      * id. The viewer will show a black background until a move
4262      * succeeds. This way of intitializing is suited for a map-viewer
4263      * application when the initial id is not known at implementation
4264      * time.
4265      *
4266      * @param {ViewerOptions} options - Optional configuration object
4267      * specifing Viewer's and the components' initial setup.
4268      *
4269      * @example
4270      * ```js
4271      * var viewer = new Viewer({
4272      *     accessToken: "<my-access-token>",
4273      *     container: "<my-container-id>",
4274      * });
4275      * ```
4276      */
4277     constructor(options: ViewerOptions);
4278     /**
4279      * Return a boolean indicating if the viewer is in a navigable state.
4280      *
4281      * @description The navigable state indicates if the viewer supports
4282      * moving, i.e. calling the {@link moveTo} and {@link moveDir}
4283      * methods or changing the authentication state,
4284      * i.e. calling {@link setAccessToken}. The viewer will not be in a navigable
4285      * state if the cover is activated and the viewer has been supplied a id.
4286      * When the cover is deactivated or the viewer is activated without being
4287      * supplied a id it will be navigable.
4288      *
4289      * @returns {boolean} Boolean indicating whether the viewer is navigable.
4290      */
4291     get isNavigable(): boolean;
4292     /**
4293      * Activate the combined panning functionality.
4294      *
4295      * @description The combined panning functionality is active by default.
4296      */
4297     activateCombinedPanning(): void;
4298     /**
4299      * Activate a component.
4300      *
4301      * @param {ComponentName | FallbackComponentName} name - Name of
4302      * the component which will become active.
4303      *
4304      * @example
4305      * ```js
4306      * viewer.activateComponent("marker");
4307      * ```
4308      */
4309     activateComponent(name: ComponentName | FallbackComponentName): void;
4310     /**
4311      * Activate the cover (deactivates all other components).
4312      */
4313     activateCover(): void;
4314     /**
4315      * Add a custom renderer to the viewer's rendering pipeline.
4316      *
4317      * @description During a render pass, custom renderers
4318      * are called in the order they were added.
4319      *
4320      * @param renderer - The custom renderer implementation.
4321      */
4322     addCustomRenderer(renderer: ICustomRenderer): void;
4323     /**
4324      * Attach custom camera controls to control the viewer's
4325      * camera pose and projection.
4326      *
4327      * @description Custom camera controls allow the API user
4328      * to move the viewer's camera freely and define the camera
4329      * projection. These camera properties are used
4330      * to render the viewer 3D scene directly into the
4331      * viewer's GL context.
4332      *
4333      * Only a single custom camera control instance can be
4334      * attached to the viewer. A new custom camera control
4335      * instance can be attached after detaching a previous
4336      * one.
4337      *
4338      * Set the viewer's camera controls to
4339      * {@link CameraControls.Custom} to activate attached
4340      * camera controls. If {@link CameraControls.Custom}
4341      * has already been set when a custom camera control
4342      * instance is attached, it will be activated immediately.
4343      *
4344      * Set the viewer's camera controls to any other
4345      * {@link CameraControls} mode to deactivate the
4346      * custom camera controls.
4347      *
4348      * @param controls - The custom camera controls implementation.
4349      *
4350      * @throws {MapillaryError} When camera controls attached
4351      * are already attached to the viewer.
4352      */
4353     attachCustomCameraControls(controls: ICustomCameraControls): void;
4354     /**
4355      * Deactivate the combined panning functionality.
4356      *
4357      * @description Deactivating the combined panning functionality
4358      * could be needed in scenarios involving sequence only navigation.
4359      */
4360     deactivateCombinedPanning(): void;
4361     /**
4362      * Deactivate a component.
4363      *
4364      * @param {ComponentName | FallbackComponentName} name - Name
4365      * of component which become inactive.
4366      *
4367      * @example
4368      * ```js
4369      * viewer.deactivateComponent("pointer");
4370      * ```
4371      */
4372     deactivateComponent(name: ComponentName | FallbackComponentName): void;
4373     /**
4374      * Deactivate the cover (activates all components marked as active).
4375      */
4376     deactivateCover(): void;
4377     /**
4378      * Detach a previously attached custom camera control
4379      * instance from the viewer.
4380      *
4381      * @description If no custom camera control instance
4382      * has previously been attached, calling this method
4383      * has no effect.
4384      *
4385      * Already attached custom camera controls need to
4386      * be detached before attaching another custom camera
4387      * control instance.
4388      */
4389     detachCustomCameraControls(): void;
4390     fire(type: ViewerBearingEvent["type"], event: ViewerBearingEvent): void;
4391     fire(type: ViewerDataLoadingEvent["type"], event: ViewerDataLoadingEvent): void;
4392     fire(type: ViewerNavigableEvent["type"], event: ViewerNavigableEvent): void;
4393     fire(type: ViewerImageEvent["type"], event: ViewerImageEvent): void;
4394     fire(type: ViewerNavigationEdgeEvent["type"], event: ViewerNavigationEdgeEvent): void;
4395     fire(type: ViewerStateEvent["type"], event: ViewerStateEvent): void;
4396     fire(type: ViewerMouseEvent["type"], event: ViewerMouseEvent): void;
4397     /**
4398      * Get the bearing of the current viewer camera.
4399      *
4400      * @description The bearing depends on how the camera
4401      * is currently rotated and does not correspond
4402      * to the compass angle of the current image if the view
4403      * has been panned.
4404      *
4405      * Bearing is measured in degrees clockwise with respect to
4406      * north.
4407      *
4408      * @returns {Promise<number>} Promise to the bearing
4409      * of the current viewer camera.
4410      *
4411      * @example
4412      * ```js
4413      * viewer.getBearing().then(b => { console.log(b); });
4414      * ```
4415      */
4416     getBearing(): Promise<number>;
4417     /**
4418      * Get the viewer's camera control mode.
4419      *
4420      * @description The camera control mode determines
4421      * how the camera is controlled when the viewer
4422      * recieves pointer and keyboard input.
4423      *
4424      * @returns {CameraControls} controls - Camera control mode.
4425      *
4426      * @example
4427      * ```js
4428      * viewer.getCameraControls().then(c => { console.log(c); });
4429      * ```
4430      */
4431     getCameraControls(): Promise<CameraControls>;
4432     /**
4433      * Returns the viewer's canvas element.
4434      *
4435      * @description This is the element onto which the viewer renders
4436      * the WebGL content.
4437      *
4438      * @returns {HTMLCanvasElement} The viewer's canvas element, or
4439      * null or not initialized.
4440      */
4441     getCanvas(): HTMLCanvasElement;
4442     /**
4443      * Returns the HTML element containing the viewer's canvas element.
4444      *
4445      * @description This is the element to which event bindings for viewer
4446      * interactivity (such as panning and zooming) are attached.
4447      *
4448      * @returns {HTMLDivElement} The container for the viewer's
4449      * canvas element.
4450      */
4451     getCanvasContainer(): HTMLDivElement;
4452     /**
4453      * Get the basic coordinates of the current image that is
4454      * at the center of the viewport.
4455      *
4456      * @description Basic coordinates are 2D coordinates on the [0, 1] interval
4457      * and have the origin point, (0, 0), at the top left corner and the
4458      * maximum value, (1, 1), at the bottom right corner of the original
4459      * image.
4460      *
4461      * @returns {Promise<number[]>} Promise to the basic coordinates
4462      * of the current image at the center for the viewport.
4463      *
4464      * @example
4465      * ```js
4466      * viewer.getCenter().then(c => { console.log(c); });
4467      * ```
4468      */
4469     getCenter(): Promise<number[]>;
4470     /**
4471      * Get a component.
4472      *
4473      * @param {string} name - Name of component.
4474      * @returns {Component} The requested component.
4475      *
4476      * @example
4477      * ```js
4478      * var pointerComponent = viewer.getComponent("pointer");
4479      * ```
4480      */
4481     getComponent<TComponent extends Component<ComponentConfiguration>>(name: ComponentName | FallbackComponentName): TComponent;
4482     /**
4483      * Returns the viewer's containing HTML element.
4484      *
4485      * @returns {HTMLElement} The viewer's container.
4486      */
4487     getContainer(): HTMLElement;
4488     /**
4489      * Get the viewer's current vertical field of view.
4490      *
4491      * @description The vertical field of view rendered on the viewer canvas
4492      * measured in degrees.
4493      *
4494      * @returns {Promise<number>} Promise to the current field of view
4495      * of the viewer camera.
4496      *
4497      * @example
4498      * ```js
4499      * viewer.getFieldOfView().then(fov => { console.log(fov); });
4500      * ```
4501      */
4502     getFieldOfView(): Promise<number>;
4503     /**
4504      * Get the viewer's current image.
4505      *
4506      * @returns {Promise<Image>} Promise to the current image.
4507      *
4508      * @example
4509      * ```js
4510      * viewer.getImage().then(image => { console.log(image.id); });
4511      * ```
4512      */
4513     getImage(): Promise<Image>;
4514     /**
4515      * Get the viewer's current point of view.
4516      *
4517      * @returns {Promise<PointOfView>} Promise to the current point of view
4518      * of the viewer camera.
4519      *
4520      * @example
4521      * ```js
4522      * viewer.getPointOfView().then(pov => { console.log(pov); });
4523      * ```
4524      */
4525     getPointOfView(): Promise<PointOfView>;
4526     /**
4527      * Get the viewer's current position
4528      *
4529      * @returns {Promise<LngLat>} Promise to the viewers's current
4530      * position.
4531      *
4532      * @example
4533      * ```js
4534      * viewer.getPosition().then(pos => { console.log(pos); });
4535      * ```
4536      */
4537     getPosition(): Promise<LngLat>;
4538     /**
4539      * Get the image's current zoom level.
4540      *
4541      * @returns {Promise<number>} Promise to the viewers's current
4542      * zoom level.
4543      *
4544      * @example
4545      * ```js
4546      * viewer.getZoom().then(z => { console.log(z); });
4547      * ```
4548      */
4549     getZoom(): Promise<number>;
4550     /**
4551      * Check if a custom renderer has been added to the viewer's
4552      * rendering pipeline.
4553      *
4554      * @param {string} id - Unique id of the custom renderer.
4555      * @returns {boolean} Value indicating whether the customer
4556      * renderer has been added.
4557      */
4558     hasCustomRenderer(rendererId: string): boolean;
4559     /**
4560      * Navigate in a given direction.
4561      *
4562      * @param {NavigationDirection} direction - Direction in which which to move.
4563      * @returns {Promise<Image>} Promise to the image that was navigated to.
4564      * @throws If the current image does not have the edge direction
4565      * or the edges has not yet been cached.
4566      * @throws Propagates any IO errors to the caller.
4567      * @throws When viewer is not navigable.
4568      * @throws {@link CancelMapillaryError} When a subsequent move request
4569      * is made before the move dir call has completed.
4570      *
4571      * @example
4572      * ```js
4573      * viewer.moveDir(NavigationDirection.Next).then(
4574      *     image => { console.log(image); },
4575      *     error => { console.error(error); });
4576      * ```
4577      */
4578     moveDir(direction: NavigationDirection): Promise<Image>;
4579     /**
4580      * Navigate to a given image id.
4581      *
4582      * @param {string} imageId - Id of the image to move to.
4583      * @returns {Promise<Image>} Promise to the image that was navigated to.
4584      * @throws Propagates any IO errors to the caller.
4585      * @throws When viewer is not navigable.
4586      * @throws {@link CancelMapillaryError} When a subsequent
4587      * move request is made before the move to id call has completed.
4588      *
4589      * @example
4590      * ```js
4591      * viewer.moveTo("<my-image-id>").then(
4592      *     image => { console.log(image); },
4593      *     error => { console.error(error); });
4594      * ```
4595      */
4596     moveTo(imageId: string): Promise<Image>;
4597     off(type: ViewerBearingEvent["type"], handler: (event: ViewerBearingEvent) => void): void;
4598     off(type: ViewerDataLoadingEvent["type"], handler: (event: ViewerDataLoadingEvent) => void): void;
4599     off(type: ViewerNavigableEvent["type"], handler: (event: ViewerNavigableEvent) => void): void;
4600     off(type: ViewerImageEvent["type"], handler: (event: ViewerImageEvent) => void): void;
4601     off(type: ViewerNavigationEdgeEvent["type"], handler: (event: ViewerNavigationEdgeEvent) => void): void;
4602     off(type: ViewerStateEvent["type"], handler: (event: ViewerStateEvent) => void): void;
4603     off(type: ViewerMouseEvent["type"], handler: (event: ViewerMouseEvent) => void): void;
4604     /**
4605      * Fired when the viewing direction of the camera changes.
4606      *
4607      * @event bearing
4608      * @example
4609      * ```js
4610      * // Initialize the viewer
4611      * var viewer = new Viewer({ // viewer options });
4612      * // Set an event listener
4613      * viewer.on("bearing", function() {
4614      *   console.log("A bearing event has occurred.");
4615      * });
4616      * ```
4617      */
4618     on(type: "bearing", handler: (event: ViewerBearingEvent) => void): void;
4619     /**
4620      * Fired when a pointing device (usually a mouse) is
4621      * pressed and released at the same point in the viewer.
4622      *
4623      * @event click
4624      * @example
4625      * ```js
4626      * // Initialize the viewer
4627      * var viewer = new Viewer({ // viewer options });
4628      * // Set an event listener
4629      * viewer.on("click", function() {
4630      *   console.log("A click event has occurred.");
4631      * });
4632      * ```
4633      */
4634     on(type: "click", handler: (event: ViewerMouseEvent) => void): void;
4635     /**
4636      * Fired when the right button of the mouse is clicked
4637      * within the viewer.
4638      *
4639      * @event contextmenu
4640      * @example
4641      * ```js
4642      * // Initialize the viewer
4643      * var viewer = new Viewer({ // viewer options });
4644      * // Set an event listener
4645      * viewer.on("contextmenu", function() {
4646      *   console.log("A contextmenu event has occurred.");
4647      * });
4648      * ```
4649      */
4650     on(type: "contextmenu", handler: (event: ViewerMouseEvent) => void): void;
4651     /**
4652      * Fired when the viewer is loading data.
4653      *
4654      * @event loading
4655      * @example
4656      * ```js
4657      * // Initialize the viewer
4658      * var viewer = new Viewer({ // viewer options });
4659      * // Set an event listener
4660      * viewer.on("dataloading", function() {
4661      *   console.log("A loading event has occurred.");
4662      * });
4663      * ```
4664      */
4665     on(type: "dataloading", handler: (event: ViewerDataLoadingEvent) => void): void;
4666     /**
4667      * Fired when a pointing device (usually a mouse) is clicked twice at
4668      * the same point in the viewer.
4669      *
4670      * @event dblclick
4671      * @example
4672      * ```js
4673      * // Initialize the viewer
4674      * var viewer = new Viewer({ // viewer options });
4675      * // Set an event listener
4676      * viewer.on("dblclick", function() {
4677      *   console.log("A dblclick event has occurred.");
4678      * });
4679      * ```
4680      */
4681     on(type: "dblclick", handler: (event: ViewerMouseEvent) => void): void;
4682     /**
4683      * Fired when the viewer's vertical field of view changes.
4684      *
4685      * @event fov
4686      * @example
4687      * ```js
4688      * // Initialize the viewer
4689      * var viewer = new Viewer({ // viewer options });
4690      * // Set an event listener
4691      * viewer.on("fov", function() {
4692      *   console.log("A fov event has occurred.");
4693      * });
4694      * ```
4695      */
4696     on(type: "fov", handler: (event: ViewerStateEvent) => void): void;
4697     /**
4698      * Fired immediately after all necessary resources
4699      * have been downloaded and the first visually complete
4700      * rendering of the viewer has occurred.
4701      *
4702      * This event is only fired for viewer configurations where
4703      * the WebGL context is created, i.e. not when using the
4704      * fallback functionality only.
4705      *
4706      * @event load
4707      * @example
4708      * @example
4709      * ```js
4710      * // Set an event listener
4711      * viewer.on('load', function(event) {
4712      *   console.log('A load event has occured');
4713      * });
4714      * ```
4715      */
4716     on(type: "load", handler: (event: ViewerLoadEvent) => void): void;
4717     /**
4718      * Fired when a pointing device (usually a mouse) is pressed
4719      * within the viewer.
4720      *
4721      * @event mousedown
4722      * @example
4723      * ```js
4724      * // Initialize the viewer
4725      * var viewer = new Viewer({ // viewer options });
4726      * // Set an event listener
4727      * viewer.on("mousedown", function() {
4728      *   console.log("A mousedown event has occurred.");
4729      * });
4730      * ```
4731      */
4732     on(type: "mousedown", handler: (event: ViewerMouseEvent) => void): void;
4733     /**
4734      * Fired when a pointing device (usually a mouse)
4735      * is moved within the viewer.
4736      *
4737      * @event mousemove
4738      * @example
4739      * ```js
4740      * // Initialize the viewer
4741      * var viewer = new Viewer({ // viewer options });
4742      * // Set an event listener
4743      * viewer.on("mousemove", function() {
4744      *   console.log("A mousemove event has occurred.");
4745      * });
4746      * ```
4747      */
4748     on(type: "mousemove", handler: (event: ViewerMouseEvent) => void): void;
4749     /**
4750      * Fired when a pointing device (usually a mouse)
4751      * leaves the viewer's canvas.
4752      *
4753      * @event mouseout
4754      * @example
4755      * ```js
4756      * // Initialize the viewer
4757      * var viewer = new Viewer({ // viewer options });
4758      * // Set an event listener
4759      * viewer.on("mouseout", function() {
4760      *   console.log("A mouseout event has occurred.");
4761      * });
4762      * ```
4763      */
4764     on(type: "mouseout", handler: (event: ViewerMouseEvent) => void): void;
4765     /**
4766      * Fired when a pointing device (usually a mouse)
4767      * is moved onto the viewer's canvas.
4768      *
4769      * @event mouseover
4770      * @example
4771      * ```js
4772      * // Initialize the viewer
4773      * var viewer = new Viewer({ // viewer options });
4774      * // Set an event listener
4775      * viewer.on("mouseover", function() {
4776      *   console.log("A mouseover event has occurred.");
4777      * });
4778      * ```
4779      */
4780     on(type: "mouseover", handler: (event: ViewerMouseEvent) => void): void;
4781     /**
4782      * Fired when a pointing device (usually a mouse)
4783      * is released within the viewer.
4784      *
4785      * @event mouseup
4786      * @example
4787      * ```js
4788      * // Initialize the viewer
4789      * var viewer = new Viewer({ // viewer options });
4790      * // Set an event listener
4791      * viewer.on("mouseup", function() {
4792      *   console.log("A mouseup event has occurred.");
4793      * });
4794      * ```
4795      */
4796     on(type: "mouseup", handler: (event: ViewerMouseEvent) => void): void;
4797     /**
4798      * Fired when the viewer motion stops and it is in a fixed
4799      * position with a fixed point of view.
4800      *
4801      * @event moveend
4802      * @example
4803      * ```js
4804      * // Initialize the viewer
4805      * var viewer = new Viewer({ // viewer options });
4806      * // Set an event listener
4807      * viewer.on("moveend", function() {
4808      *   console.log("A moveend event has occurred.");
4809      * });
4810      * ```
4811      */
4812     on(type: "moveend", handler: (event: ViewerStateEvent) => void): void;
4813     /**
4814      * Fired when the motion from one view to another start,
4815      * either by changing the position (e.g. when changing image)
4816      * or when changing point of view
4817      * (e.g. by interaction such as pan and zoom).
4818      *
4819      * @event movestart
4820      * @example
4821      * ```js
4822      * // Initialize the viewer
4823      * var viewer = new Viewer({ // viewer options });
4824      * // Set an event listener
4825      * viewer.on("movestart", function() {
4826      *   console.log("A movestart event has occurred.");
4827      * });
4828      * ```
4829      */
4830     on(type: "movestart", handler: (event: ViewerStateEvent) => void): void;
4831     /**
4832      * Fired when the navigable state of the viewer changes.
4833      *
4834      * @event navigable
4835      * @example
4836      * ```js
4837      * // Initialize the viewer
4838      * var viewer = new Viewer({ // viewer options });
4839      * // Set an event listener
4840      * viewer.on("navigable", function() {
4841      *   console.log("A navigable event has occurred.");
4842      * });
4843      * ```
4844      */
4845     on(type: "navigable", handler: (event: ViewerNavigableEvent) => void): void;
4846     /**
4847      * Fired every time the viewer navigates to a new image.
4848      *
4849      * @event image
4850      * @example
4851      * ```js
4852      * // Initialize the viewer
4853      * var viewer = new Viewer({ // viewer options });
4854      * // Set an event listener
4855      * viewer.on("image", function() {
4856      *   console.log("A image event has occurred.");
4857      * });
4858      * ```
4859      */
4860     on(type: "image", handler: (event: ViewerImageEvent) => void): void;
4861     /**
4862      * Fired when the viewer's position changes.
4863      *
4864      * @description The viewer's position changes when transitioning
4865      * between images.
4866      *
4867      * @event position
4868      * @example
4869      * ```js
4870      * // Initialize the viewer
4871      * var viewer = new Viewer({ // viewer options });
4872      * // Set an event listener
4873      * viewer.on("position", function() {
4874      *   console.log("A position event has occurred.");
4875      * });
4876      * ```
4877      */
4878     on(type: "position", handler: (event: ViewerStateEvent) => void): void;
4879     /**
4880      * Fired when the viewer's point of view changes. The
4881      * point of view changes when the bearing, or tilt changes.
4882      *
4883      * @event pov
4884      * @example
4885      * ```js
4886      * // Initialize the viewer
4887      * var viewer = new Viewer({ // viewer options });
4888      * // Set an event listener
4889      * viewer.on("pov", function() {
4890      *   console.log("A pov event has occurred.");
4891      * });
4892      * ```
4893      */
4894     on(type: "pov", handler: (event: ViewerStateEvent) => void): void;
4895     /**
4896      * Fired when the viewer is removed. After this event is emitted
4897      * you must not call any methods on the viewer.
4898      *
4899      * @event remove
4900      * @example
4901      * ```js
4902      * // Initialize the viewer
4903      * var viewer = new Viewer({ // viewer options });
4904      * // Set an event listener
4905      * viewer.on("remove", function() {
4906      *   console.log("A remove event has occurred.");
4907      * });
4908      * ```
4909      */
4910     on(type: "remove", handler: (event: ViewerStateEvent) => void): void;
4911     /**
4912      * Fired every time the sequence edges of the current image changes.
4913      *
4914      * @event sequenceedges
4915      * @example
4916      * ```js
4917      * // Initialize the viewer
4918      * var viewer = new Viewer({ // viewer options });
4919      * // Set an event listener
4920      * viewer.on("sequenceedges", function() {
4921      *   console.log("A sequenceedges event has occurred.");
4922      * });
4923      * ```
4924      */
4925     on(type: "sequenceedges", handler: (event: ViewerNavigationEdgeEvent) => void): void;
4926     /**
4927      * Fired every time the spatial edges of the current image changes.
4928      *
4929      * @event spatialedges
4930      * @example
4931      * ```js
4932      * // Initialize the viewer
4933      * var viewer = new Viewer({ // viewer options });
4934      * // Set an event listener
4935      * viewer.on("spatialedges", function() {
4936      *   console.log("A spatialedges event has occurred.");
4937      * });
4938      * ```
4939      */
4940     on(type: "spatialedges", handler: (event: ViewerNavigationEdgeEvent) => void): void;
4941     /**
4942      * Project geodetic coordinates to canvas pixel coordinates.
4943      *
4944      * @description The geodetic coordinates may not always correspond to pixel
4945      * coordinates, e.g. if the geodetic coordinates have a position behind the
4946      * viewer camera. In the case of no correspondence the returned value will
4947      * be `null`.
4948      *
4949      * If the distance from the viewer camera position to the provided
4950      * longitude-latitude is more than 1000 meters `null` will be returned.
4951      *
4952      * The projection is performed from the ground plane, i.e.
4953      * the altitude with respect to the ground plane for the geodetic
4954      * point is zero.
4955      *
4956      * Note that whenever the camera moves, the result of the method will be
4957      * different.
4958      *
4959      * @param {LngLat} lngLat - Geographical coordinates to project.
4960      * @returns {Promise<Array<number>>} Promise to the pixel coordinates corresponding
4961      * to the lngLat.
4962      *
4963      * @example
4964      * ```js
4965      * viewer.project({ lat: 0, lng: 0 })
4966      *     .then(pixelPoint => {
4967      *          if (!pixelPoint) {
4968      *              console.log("no correspondence");
4969      *          }
4970      *
4971      *          console.log(pixelPoint);
4972      *     });
4973      * ```
4974      */
4975     project(lngLat: LngLat): Promise<number[]>;
4976     /**
4977      * Project basic image coordinates for the current image to canvas pixel
4978      * coordinates.
4979      *
4980      * @description The basic image coordinates may not always correspond to a
4981      * pixel point that lies in the visible area of the viewer container. In the
4982      * case of no correspondence the returned value can be `null`.
4983      *
4984      *
4985      * @param {Array<number>} basicPoint - Basic images coordinates to project.
4986      * @returns {Promise<Array<number>>} Promise to the pixel coordinates corresponding
4987      * to the basic image point.
4988      *
4989      * @example
4990      * ```js
4991      * viewer.projectFromBasic([0.3, 0.7])
4992      *     .then(pixelPoint => { console.log(pixelPoint); });
4993      * ```
4994      */
4995     projectFromBasic(basicPoint: number[]): Promise<number[]>;
4996     /**
4997      * Clean up and release all internal resources associated with
4998      * this viewer.
4999      *
5000      * @description This includes DOM elements, event bindings, and
5001      * WebGL resources.
5002      *
5003      * Use this method when you are done using the viewer and wish to
5004      * ensure that it no longer consumes browser resources. Afterwards,
5005      * you must not call any other methods on the viewer.
5006      *
5007      * @fires remove
5008      *
5009      * @example
5010      * ```js
5011      * viewer.remove();
5012      * ```
5013      */
5014     remove(): void;
5015     /**
5016      * Remove a custom renderer from the viewer's rendering pipeline.
5017      *
5018      * @param id - Unique id of the custom renderer.
5019      */
5020     removeCustomRenderer(rendererId: string): void;
5021     /**
5022      * Detect the viewer's new width and height and resize it
5023      * manually.
5024      *
5025      * @description The components will also detect the viewer's
5026      * new size and resize their rendered elements if needed.
5027      *
5028      * When the {@link ViewerOptions.trackResize} option is
5029      * set to true, the viewer will automatically resize
5030      * when the browser window is resized. If any other
5031      * custom behavior is preferred, the option should be set
5032      * to false and the {@link Viewer.resize} method should
5033      * be called on demand.
5034      *
5035      * @example
5036      * ```js
5037      * viewer.resize();
5038      * ```
5039      */
5040     resize(): void;
5041     /**
5042      * Set the viewer's camera control mode.
5043      *
5044      * @description The camera control mode determines
5045      * how the camera is controlled when the viewer
5046      * recieves pointer and keyboard input.
5047      *
5048      * Changing the camera control mode is not possible
5049      * when the slider component is active and attempts
5050      * to do so will be ignored.
5051      *
5052      * @param {CameraControls} controls - Camera control mode.
5053      *
5054      * @example
5055      * ```js
5056      * viewer.setCameraControls(CameraControls.Street);
5057      * ```
5058      */
5059     setCameraControls(controls: CameraControls): void;
5060     /**
5061      * Set the basic coordinates of the current image to be in the
5062      * center of the viewport.
5063      *
5064      * @description Basic coordinates are 2D coordinates on the [0, 1] interval
5065      * and has the origin point, (0, 0), at the top left corner and the
5066      * maximum value, (1, 1), at the bottom right corner of the original
5067      * image.
5068      *
5069      * @param {number[]} The basic coordinates of the current
5070      * image to be at the center for the viewport.
5071      *
5072      * @example
5073      * ```js
5074      * viewer.setCenter([0.5, 0.5]);
5075      * ```
5076      */
5077     setCenter(center: number[]): void;
5078     /**
5079      * Set the viewer's current vertical field of view.
5080      *
5081      * @description Sets the vertical field of view rendered
5082      * on the viewer canvas measured in degrees. The value
5083      * will be clamped to be able to set a valid zoom level
5084      * based on the projection model of the current image and
5085      * the viewer's current render mode.
5086      *
5087      * @param {number} fov - Vertical field of view in degrees.
5088      *
5089      * @example
5090      * ```js
5091      * viewer.setFieldOfView(45);
5092      * ```
5093      */
5094     setFieldOfView(fov: number): void;
5095     /**
5096      * Set the filter selecting images to use when calculating
5097      * the spatial edges.
5098      *
5099      * @description The following filter types are supported:
5100      *
5101      * Comparison
5102      *
5103      * `["==", key, value]` equality: `image[key] = value`
5104      *
5105      * `["!=", key, value]` inequality: `image[key] â‰  value`
5106      *
5107      * `["<", key, value]` less than: `image[key] < value`
5108      *
5109      * `["<=", key, value]` less than or equal: `image[key] â‰¤ value`
5110      *
5111      * `[">", key, value]` greater than: `image[key] > value`
5112      *
5113      * `[">=", key, value]` greater than or equal: `image[key] â‰¥ value`
5114      *
5115      * Set membership
5116      *
5117      * `["in", key, v0, ..., vn]` set inclusion: `image[key] âˆˆ {v0, ..., vn}`
5118      *
5119      * `["!in", key, v0, ..., vn]` set exclusion: `image[key] âˆ‰ {v0, ..., vn}`
5120      *
5121      * Combining
5122      *
5123      * `["all", f0, ..., fn]` logical `AND`: `f0 âˆ§ ... âˆ§ fn`
5124      *
5125      * A key must be a string that identifies a property name of a
5126      * simple {@link Image} property, i.e. a key of the {@link FilterKey}
5127      * type. A value must be a string, number, or
5128      * boolean. Strictly-typed comparisons are used. The values
5129      * `f0, ..., fn` of the combining filter must be filter expressions.
5130      *
5131      * Clear the filter by setting it to null or empty array.
5132      *
5133      * Commonly used filter properties (see the {@link Image} class
5134      * documentation for a full list of properties that can be used
5135      * in a filter) are shown the the example code.
5136      *
5137      * @param {FilterExpression} filter - The filter expression.
5138      * @returns {Promise<void>} Promise that resolves after filter is applied.
5139      *
5140      * @example
5141      * ```js
5142      * // Examples
5143      * viewer.setFilter(["==", "cameraType", "spherical"]);
5144      * viewer.setFilter([">=", "capturedAt", <my-time-stamp>]);
5145      * viewer.setFilter(["in", "sequenceId", "<sequence-id-1>", "<sequence-id-2>"]);
5146      * ```
5147      */
5148     setFilter(filter: FilterExpression): Promise<void>;
5149     /**
5150      * Set the viewer's render mode.
5151      *
5152      * @param {RenderMode} renderMode - Render mode.
5153      *
5154      * @example
5155      * ```js
5156      * viewer.setRenderMode(RenderMode.Letterbox);
5157      * ```
5158      */
5159     setRenderMode(renderMode: RenderMode): void;
5160     /**
5161      * Set the viewer's transition mode.
5162      *
5163      * @param {TransitionMode} transitionMode - Transition mode.
5164      *
5165      * @example
5166      * ```js
5167      * viewer.setTransitionMode(TransitionMode.Instantaneous);
5168      * ```
5169      */
5170     setTransitionMode(transitionMode: TransitionMode): void;
5171     /**
5172      * Set an access token for authenticated API requests of protected
5173      * resources.
5174      *
5175      * The token may be a user access token or a client access token.
5176      *
5177      * @description When the supplied user token is null or undefined,
5178      * any previously set user bearer token will be cleared and the
5179      * viewer will make unauthenticated requests.
5180      *
5181      * Calling setAccessToken aborts all outstanding move requests.
5182      * The promises of those move requests will be rejected with a
5183      * {@link CancelMapillaryError} the rejections need to be caught.
5184      *
5185      * Calling setAccessToken also resets the complete viewer cache
5186      * so it should not be called repeatedly.
5187      *
5188      * @param {string} [accessToken] accessToken - Optional user
5189      * access token or client access token.
5190      * @returns {Promise<void>} Promise that resolves after token
5191      * is set.
5192      *
5193      * @throws When viewer is not navigable.
5194      *
5195      * @example
5196      * ```js
5197      * viewer.setAccessToken("<my access token>")
5198      *     .then(() => { console.log("user token set"); });
5199      * ```
5200      */
5201     setAccessToken(accessToken?: string): Promise<void>;
5202     /**
5203      * Set the image's current zoom level.
5204      *
5205      * @description Possible zoom level values are on the [0, 3] interval.
5206      * Zero means zooming out to fit the image to the view whereas three
5207      * shows the highest level of detail.
5208      *
5209      * @param {number} The image's current zoom level.
5210      *
5211      * @example
5212      * ```js
5213      * viewer.setZoom(2);
5214      * ```
5215      */
5216     setZoom(zoom: number): void;
5217     /**
5218      * Trigger the rendering of a single frame.
5219      *
5220      * @description Use this method with custom renderers to
5221      * force the viewer to rerender when the custom content
5222      * changes. Calling this multiple times before the next
5223      * frame is rendered will still result in only a single
5224      * frame being rendered.
5225      */
5226     triggerRerender(): void;
5227     /**
5228      * Unproject canvas pixel coordinates to geodetic
5229      * coordinates.
5230      *
5231      * @description The pixel point may not always correspond to geodetic
5232      * coordinates. In the case of no correspondence the returned value will
5233      * be `null`.
5234      *
5235      * The unprojection to a lngLat will be performed towards the ground plane, i.e.
5236      * the altitude with respect to the ground plane for the returned lngLat is zero.
5237      *
5238      * @param {Array<number>} pixelPoint - Pixel coordinates to unproject.
5239      * @returns {Promise<LngLat>} Promise to the lngLat corresponding to the pixel point.
5240      *
5241      * @example
5242      * ```js
5243      * viewer.unproject([100, 100])
5244      *     .then(lngLat => { console.log(lngLat); });
5245      * ```
5246      */
5247     unproject(pixelPoint: number[]): Promise<LngLat>;
5248     /**
5249      * Unproject canvas pixel coordinates to basic image coordinates for the
5250      * current image.
5251      *
5252      * @description The pixel point may not always correspond to basic image
5253      * coordinates. In the case of no correspondence the returned value will
5254      * be `null`.
5255      *
5256      * @param {Array<number>} pixelPoint - Pixel coordinates to unproject.
5257      * @returns {Promise<LngLat>} Promise to the basic coordinates corresponding
5258      * to the pixel point.
5259      *
5260      * @example
5261      * ```js
5262      * viewer.unprojectToBasic([100, 100])
5263      *     .then(basicPoint => { console.log(basicPoint); });
5264      * ```
5265      */
5266     unprojectToBasic(pixelPoint: number[]): Promise<number[]>;
5267 }
5268
5269 /**
5270  * @class MapillaryError
5271  *
5272  * @classdesc Generic Mapillary error.
5273  */
5274 declare class MapillaryError extends Error {
5275     constructor(message?: string);
5276 }
5277
5278 /**
5279  * @class CancelMapillaryError
5280  *
5281  * @classdesc Error thrown when a move to request has been
5282  * cancelled before completing because of a subsequent request.
5283  */
5284 declare class CancelMapillaryError extends MapillaryError {
5285     constructor(message?: string);
5286 }
5287
5288 declare class ArgumentMapillaryError extends MapillaryError {
5289     constructor(message?: string);
5290 }
5291
5292 declare class GraphMapillaryError extends MapillaryError {
5293     constructor(message: string);
5294 }
5295
5296 declare class ConfigurationService {
5297     private _imageTiling$;
5298     private _exploreUrl$;
5299     constructor(options: ViewerOptions);
5300     get exploreUrl$(): Observable<string>;
5301     get imageTiling$(): Observable<boolean>;
5302 }
5303
5304 declare class Container {
5305     id: string;
5306     renderService: RenderService;
5307     glRenderer: GLRenderer;
5308     domRenderer: DOMRenderer;
5309     keyboardService: KeyboardService;
5310     mouseService: MouseService;
5311     touchService: TouchService;
5312     spriteService: SpriteService;
5313     readonly configurationService: ConfigurationService;
5314     private _canvasContainer;
5315     private _canvas;
5316     private _container;
5317     private _domContainer;
5318     private _dom;
5319     private readonly _trackResize;
5320     constructor(options: ViewerOptions, stateService: StateService, dom?: DOM);
5321     get canvas(): HTMLCanvasElement;
5322     get canvasContainer(): HTMLDivElement;
5323     get container(): HTMLElement;
5324     get domContainer(): HTMLDivElement;
5325     remove(): void;
5326     private _onWindowResize;
5327     private _removeNode;
5328 }
5329
5330 declare type Func<T, TResult> = (item: T) => TResult;
5331
5332 declare type FilterFunction = Func<Image, boolean>;
5333 /**
5334  * @class Filter
5335  *
5336  * @classdesc Represents a class for creating image filters. Implementation and
5337  * definitions based on https://github.com/mapbox/feature-filter.
5338  */
5339 declare class FilterCreator {
5340     /**
5341      * Create a filter from a filter expression.
5342      *
5343      * @description The following filters are supported:
5344      *
5345      * Comparison
5346      * `==`
5347      * `!=`
5348      * `<`
5349      * `<=`
5350      * `>`
5351      * `>=`
5352      *
5353      * Set membership
5354      * `in`
5355      * `!in`
5356      *
5357      * Combining
5358      * `all`
5359      *
5360      * @param {FilterExpression} filter - Comparison, set membership or combinding filter
5361      * expression.
5362      * @returns {FilterFunction} Function taking a image and returning a boolean that
5363      * indicates whether the image passed the test or not.
5364      */
5365     createFilter(filter: FilterExpression): FilterFunction;
5366     private _compile;
5367     private _compare;
5368     private _compileComparisonOp;
5369     private _compileInOp;
5370     private _compileLogicalOp;
5371     private _compileNegation;
5372     private _compilePropertyReference;
5373 }
5374
5375 /**
5376  * @class GraphCalculator
5377  *
5378  * @classdesc Represents a calculator for graph entities.
5379  */
5380 declare class GraphCalculator {
5381     /**
5382      * Get the bounding box corners for a circle with radius of a threshold
5383      * with center in a geodetic position.
5384      *
5385      * @param {LngLat} lngLat - Longitude, latitude to encode.
5386      * @param {number} threshold - Threshold distance from the position in meters.
5387      *
5388      * @returns {Array<LngLat>} The south west and north east corners of the
5389      * bounding box.
5390      */
5391     boundingBoxCorners(lngLat: LngLat, threshold: number): [LngLat, LngLat];
5392     /**
5393      * Convert a compass angle to an angle axis rotation vector.
5394      *
5395      * @param {number} compassAngle - The compass angle in degrees.
5396      * @param {number} orientation - The orientation of the original image.
5397      *
5398      * @returns {Array<number>} Angle axis rotation vector.
5399      */
5400     rotationFromCompass(compassAngle: number, orientation: number): number[];
5401 }
5402
5403 /**
5404  * @class Sequence
5405  *
5406  * @classdesc Represents a sequence of ordered images.
5407  */
5408 declare class Sequence {
5409     private _id;
5410     private _imageIds;
5411     /**
5412      * Create a new sequene instance.
5413      *
5414      * @param {SequenceEnt} sequence - Raw sequence data.
5415      */
5416     constructor(sequence: SequenceEnt);
5417     /**
5418      * Get id.
5419      *
5420      * @returns {string} Unique sequence id.
5421      */
5422     get id(): string;
5423     /**
5424      * Get ids.
5425      *
5426      * @returns {Array<string>} Array of ordered image ids in the sequence.
5427      */
5428     get imageIds(): string[];
5429     /**
5430      * Dispose the sequence.
5431      *
5432      * @description Disposes all cached assets.
5433      */
5434     dispose(): void;
5435     /**
5436      * Find the next image id in the sequence with respect to
5437      * the provided image id.
5438      *
5439      * @param {string} id - Reference image id.
5440      * @returns {string} Next id in sequence if it exists, null otherwise.
5441      */
5442     findNext(id: string): string;
5443     /**
5444      * Find the previous image id in the sequence with respect to
5445      * the provided image id.
5446      *
5447      * @param {string} id - Reference image id.
5448      * @returns {string} Previous id in sequence if it exists, null otherwise.
5449      */
5450     findPrev(id: string): string;
5451 }
5452
5453 /**
5454  * Interface for graph configuration.
5455  *
5456  * @interface GraphConfiguration
5457  */
5458 interface GraphConfiguration {
5459     /**
5460      * The maximum number of cached sequences left
5461      * after uncache.
5462      */
5463     maxSequences: number;
5464     /**
5465      * The maximum number of unused cached images left
5466      * after uncache.
5467      */
5468     maxUnusedImages: number;
5469     /**
5470      * The maximum number of unused pre-stored cached images left
5471      * after uncache.
5472      */
5473     maxUnusedPreStoredImages: number;
5474     /**
5475      * The maximum number of unused cached tiles left
5476      * after uncache.
5477      */
5478     maxUnusedTiles: number;
5479 }
5480
5481 declare class EdgeCalculatorCoefficients {
5482     sphericalPreferredDistance: number;
5483     sphericalMotion: number;
5484     sphericalSequencePenalty: number;
5485     sphericalMergeCCPenalty: number;
5486     stepPreferredDistance: number;
5487     stepMotion: number;
5488     stepRotation: number;
5489     stepSequencePenalty: number;
5490     stepMergeCCPenalty: number;
5491     similarDistance: number;
5492     similarRotation: number;
5493     turnDistance: number;
5494     turnMotion: number;
5495     turnSequencePenalty: number;
5496     turnMergeCCPenalty: number;
5497     constructor();
5498 }
5499
5500 interface SphericalDirection {
5501     direction: NavigationDirection;
5502     prev: NavigationDirection;
5503     next: NavigationDirection;
5504     directionChange: number;
5505 }
5506
5507 interface StepDirection {
5508     direction: NavigationDirection;
5509     motionChange: number;
5510     useFallback: boolean;
5511 }
5512
5513 interface TurnDirection {
5514     direction: NavigationDirection;
5515     directionChange: number;
5516     motionChange?: number;
5517 }
5518
5519 declare class EdgeCalculatorDirections {
5520     steps: {
5521         [direction: string]: StepDirection;
5522     };
5523     turns: {
5524         [direction: string]: TurnDirection;
5525     };
5526     spherical: {
5527         [direction: string]: SphericalDirection;
5528     };
5529     constructor();
5530 }
5531
5532 declare class EdgeCalculatorSettings {
5533     sphericalMinDistance: number;
5534     sphericalMaxDistance: number;
5535     sphericalPreferredDistance: number;
5536     sphericalMaxItems: number;
5537     sphericalMaxStepTurnChange: number;
5538     rotationMaxDistance: number;
5539     rotationMaxDirectionChange: number;
5540     rotationMaxVerticalDirectionChange: number;
5541     similarMaxDirectionChange: number;
5542     similarMaxDistance: number;
5543     similarMinTimeDifference: number;
5544     stepMaxDistance: number;
5545     stepMaxDirectionChange: number;
5546     stepMaxDrift: number;
5547     stepPreferredDistance: number;
5548     turnMaxDistance: number;
5549     turnMaxDirectionChange: number;
5550     turnMaxRigDistance: number;
5551     turnMinRigDirectionChange: number;
5552     constructor();
5553     get maxDistance(): number;
5554 }
5555
5556 /**
5557  * Interface that describes the properties for a image that is the destination of a
5558  * potential edge from an origin image.
5559  *
5560  * @interface PotentialEdge
5561  */
5562 interface PotentialEdge {
5563     /**
5564      * Timestamp when the image was captured.
5565      * @property {number} capturedAt
5566      */
5567     capturedAt: number;
5568     /**
5569      * Change in viewing direction with respect to the origin image.
5570      * @property {number} directionChange
5571      */
5572     directionChange: number;
5573     /**
5574      * Distance to the origin image.
5575      * @property {number} distance
5576      */
5577     distance: number;
5578     /**
5579      * Determines if the destination image is spherical.
5580      * @property {boolean} spherical
5581      */
5582     spherical: boolean;
5583     /**
5584      * Unique image id.
5585      * @property {string} id
5586      */
5587     id: string;
5588     /**
5589      * Change in motion with respect to the viewing direction
5590      * of the origin image.
5591      * @property {number} motionChange
5592      */
5593     motionChange: number;
5594     /**
5595      * General camera rotation with respect to the origin image.
5596      * @property {number} rotation
5597      */
5598     rotation: number;
5599     /**
5600      * Determines if the origin and destination image are considered
5601      * to be in the same merge connected component.
5602      * @property {boolean} sameMergeCC
5603      */
5604     sameMergeCC: boolean;
5605     /**
5606      * Determines if the origin and destination image are in the
5607      * same sequence.
5608      * @property {boolean} sameSequence
5609      */
5610     sameSequence: boolean;
5611     /**
5612      * Determines if the origin and destination image have been captured
5613      * by the same user.
5614      * @property {boolean} sameUser
5615      */
5616     sameUser: boolean;
5617     /**
5618      * Determines which sequence the destination image of the potential edge
5619      * belongs to.
5620      * @property {string} sequenceId
5621      */
5622     sequenceId: string;
5623     /**
5624      * Change in viewing direction with respect to the XY-plane.
5625      * @property {number} verticalDirectionChange
5626      */
5627     verticalDirectionChange: number;
5628     /**
5629      * The angle between motion vector and the XY-plane
5630      * @property {number} verticalMotion
5631      */
5632     verticalMotion: number;
5633     /**
5634      * The counter clockwise horizontal rotation angle from
5635      * the X-axis in a spherical coordiante system.
5636      * @propery {number} worldMotionAzimuth
5637      */
5638     worldMotionAzimuth: number;
5639 }
5640
5641 /**
5642  * @class EdgeCalculator
5643  *
5644  * @classdesc Represents a class for calculating node edges.
5645  */
5646 declare class EdgeCalculator {
5647     private _spatial;
5648     private _settings;
5649     private _directions;
5650     private _coefficients;
5651     /**
5652      * Create a new edge calculator instance.
5653      *
5654      * @param {EdgeCalculatorSettings} settings - Settings struct.
5655      * @param {EdgeCalculatorDirections} directions - Directions struct.
5656      * @param {EdgeCalculatorCoefficients} coefficients - Coefficients struct.
5657      */
5658     constructor(settings?: EdgeCalculatorSettings, directions?: EdgeCalculatorDirections, coefficients?: EdgeCalculatorCoefficients);
5659     /**
5660      * Returns the potential edges to destination nodes for a set
5661      * of nodes with respect to a source node.
5662      *
5663      * @param {Image} node - Source node.
5664      * @param {Array<Image>} nodes - Potential destination nodes.
5665      * @param {Array<string>} fallbackIds - Ids for destination nodes
5666      * that should be returned even if they do not meet the
5667      * criteria for a potential edge.
5668      * @throws {ArgumentMapillaryError} If node is not full.
5669      */
5670     getPotentialEdges(node: Image, potentialImages: Image[], fallbackIds: string[]): PotentialEdge[];
5671     /**
5672      * Computes the sequence edges for a node.
5673      *
5674      * @param {Image} node - Source node.
5675      * @throws {ArgumentMapillaryError} If node is not full.
5676      */
5677     computeSequenceEdges(node: Image, sequence: Sequence): NavigationEdge[];
5678     /**
5679      * Computes the similar edges for a node.
5680      *
5681      * @description Similar edges for perspective images
5682      * look roughly in the same direction and are positioned closed to the node.
5683      * Similar edges for spherical only target other spherical.
5684      *
5685      * @param {Image} node - Source node.
5686      * @param {Array<PotentialEdge>} potentialEdges - Potential edges.
5687      * @throws {ArgumentMapillaryError} If node is not full.
5688      */
5689     computeSimilarEdges(node: Image, potentialEdges: PotentialEdge[]): NavigationEdge[];
5690     /**
5691      * Computes the step edges for a perspective node.
5692      *
5693      * @description Step edge targets can only be other perspective nodes.
5694      * Returns an empty array for spherical.
5695      *
5696      * @param {Image} node - Source node.
5697      * @param {Array<PotentialEdge>} potentialEdges - Potential edges.
5698      * @param {string} prevId - Id of previous node in sequence.
5699      * @param {string} nextId - Id of next node in sequence.
5700      * @throws {ArgumentMapillaryError} If node is not full.
5701      */
5702     computeStepEdges(node: Image, potentialEdges: PotentialEdge[], prevId: string, nextId: string): NavigationEdge[];
5703     /**
5704      * Computes the turn edges for a perspective node.
5705      *
5706      * @description Turn edge targets can only be other perspective images.
5707      * Returns an empty array for spherical.
5708      *
5709      * @param {Image} node - Source node.
5710      * @param {Array<PotentialEdge>} potentialEdges - Potential edges.
5711      * @throws {ArgumentMapillaryError} If node is not full.
5712      */
5713     computeTurnEdges(node: Image, potentialEdges: PotentialEdge[]): NavigationEdge[];
5714     /**
5715      * Computes the spherical edges for a perspective node.
5716      *
5717      * @description Perspective to spherical edge targets can only be
5718      * spherical nodes. Returns an empty array for spherical.
5719      *
5720      * @param {Image} node - Source node.
5721      * @param {Array<PotentialEdge>} potentialEdges - Potential edges.
5722      * @throws {ArgumentMapillaryError} If node is not full.
5723      */
5724     computePerspectiveToSphericalEdges(node: Image, potentialEdges: PotentialEdge[]): NavigationEdge[];
5725     /**
5726      * Computes the spherical and step edges for a spherical node.
5727      *
5728      * @description Spherical to spherical edge targets can only be
5729      * spherical nodes. spherical to step edge targets can only be perspective
5730      * nodes.
5731      *
5732      * @param {Image} node - Source node.
5733      * @param {Array<PotentialEdge>} potentialEdges - Potential edges.
5734      * @throws {ArgumentMapillaryError} If node is not full.
5735      */
5736     computeSphericalEdges(node: Image, potentialEdges: PotentialEdge[]): NavigationEdge[];
5737 }
5738
5739 /**
5740  * @class API
5741  *
5742  * @classdesc Provides methods for access to the API.
5743  */
5744 declare class APIWrapper {
5745     private readonly _data;
5746     constructor(_data: DataProviderBase);
5747     get data(): DataProviderBase;
5748     getCoreImages$(cellId: string): Observable<CoreImagesContract>;
5749     getImages$(imageIds: string[]): Observable<ImagesContract>;
5750     getImageTiles$(tiles: ImageTilesRequestContract): Observable<ImageTilesContract>;
5751     getSequence$(sequenceId: string): Observable<SequenceContract>;
5752     getSpatialImages$(imageIds: string[]): Observable<SpatialImagesContract>;
5753     setAccessToken(accessToken?: string): void;
5754     private _wrap$;
5755 }
5756
5757 /**
5758  * @class Graph
5759  *
5760  * @classdesc Represents a graph of nodes with edges.
5761  */
5762 declare class Graph {
5763     private static _spatialIndex;
5764     private _api;
5765     /**
5766      * Nodes that have initialized cache with a timestamp of last access.
5767      */
5768     private _cachedNodes;
5769     /**
5770      * Nodes for which the required tiles are cached.
5771      */
5772     private _cachedNodeTiles;
5773     /**
5774      * Sequences for which the nodes are cached.
5775      */
5776     private _cachedSequenceNodes;
5777     /**
5778      * Nodes for which the spatial edges are cached.
5779      */
5780     private _cachedSpatialEdges;
5781     /**
5782      * Cached tiles with a timestamp of last access.
5783      */
5784     private _cachedTiles;
5785     /**
5786      * Nodes for which fill properties are being retreived.
5787      */
5788     private _cachingFill$;
5789     /**
5790      * Nodes for which full properties are being retrieved.
5791      */
5792     private _cachingFull$;
5793     /**
5794      * Sequences for which the nodes are being retrieved.
5795      */
5796     private _cachingSequenceNodes$;
5797     /**
5798      * Sequences that are being retrieved.
5799      */
5800     private _cachingSequences$;
5801     /**
5802      * Nodes for which the spatial area fill properties are being retrieved.
5803      */
5804     private _cachingSpatialArea$;
5805     /**
5806      * Tiles that are being retrieved.
5807      */
5808     private _cachingTiles$;
5809     private _changed$;
5810     private _defaultAlt;
5811     private _edgeCalculator;
5812     private _graphCalculator;
5813     private _configuration;
5814     private _filter;
5815     private _filterCreator;
5816     private _filterSubject$;
5817     private _filter$;
5818     private _filterSubscription;
5819     /**
5820      * All nodes in the graph.
5821      */
5822     private _nodes;
5823     /**
5824      * Contains all nodes in the graph. Used for fast spatial lookups.
5825      */
5826     private _nodeIndex;
5827     /**
5828      * All node index items sorted in tiles for easy uncache.
5829      */
5830     private _nodeIndexTiles;
5831     /**
5832      * Node to tile dictionary for easy tile access updates.
5833      */
5834     private _nodeToTile;
5835     /**
5836      * Nodes retrieved before tiles, stored on tile level.
5837      */
5838     private _preStored;
5839     /**
5840      * Tiles required for a node to retrive spatial area.
5841      */
5842     private _requiredNodeTiles;
5843     /**
5844      * Other nodes required for node to calculate spatial edges.
5845      */
5846     private _requiredSpatialArea;
5847     /**
5848      * All sequences in graph with a timestamp of last access.
5849      */
5850     private _sequences;
5851     private _tileThreshold;
5852     /**
5853      * Create a new graph instance.
5854      *
5855      * @param {APIWrapper} [api] - API instance for retrieving data.
5856      * @param {rbush.RBush<NodeIndexItem>} [nodeIndex] - Node index for fast spatial retreival.
5857      * @param {GraphCalculator} [graphCalculator] - Instance for graph calculations.
5858      * @param {EdgeCalculator} [edgeCalculator] - Instance for edge calculations.
5859      * @param {FilterCreator} [filterCreator] - Instance for  filter creation.
5860      * @param {GraphConfiguration} [configuration] - Configuration struct.
5861      */
5862     constructor(api: APIWrapper, nodeIndex?: any, graphCalculator?: GraphCalculator, edgeCalculator?: EdgeCalculator, filterCreator?: FilterCreator, configuration?: GraphConfiguration);
5863     static register(spatialIndex: new (...args: any[]) => any): void;
5864     /**
5865      * Get api.
5866      *
5867      * @returns {APIWrapper} The API instance used by
5868      * the graph.
5869      */
5870     get api(): APIWrapper;
5871     /**
5872      * Get changed$.
5873      *
5874      * @returns {Observable<Graph>} Observable emitting
5875      * the graph every time it has changed.
5876      */
5877     get changed$(): Observable<Graph>;
5878     /**
5879      * Get filter$.
5880      *
5881      * @returns {Observable<FilterFunction>} Observable emitting
5882      * the filter every time it has changed.
5883      */
5884     get filter$(): Observable<FilterFunction>;
5885     /**
5886      * Caches the full node data for all images within a bounding
5887      * box.
5888      *
5889      * @description The node assets are not cached.
5890      *
5891      * @param {LngLat} sw - South west corner of bounding box.
5892      * @param {LngLat} ne - North east corner of bounding box.
5893      * @returns {Observable<Array<Image>>} Observable emitting
5894      * the full nodes in the bounding box.
5895      */
5896     cacheBoundingBox$(sw: LngLat, ne: LngLat): Observable<Image[]>;
5897     /**
5898      * Caches the full node data for all images of a cell.
5899      *
5900      * @description The node assets are not cached.
5901      *
5902      * @param {string} cellId - Cell id.
5903      * @returns {Observable<Array<Image>>} Observable
5904      * emitting the full nodes of the cell.
5905      */
5906     cacheCell$(cellId: string): Observable<Image[]>;
5907     /**
5908      * Retrieve and cache node fill properties.
5909      *
5910      * @param {string} key - Key of node to fill.
5911      * @returns {Observable<Graph>} Observable emitting the graph
5912      * when the node has been updated.
5913      * @throws {GraphMapillaryError} When the operation is not valid on the
5914      * current graph.
5915      */
5916     cacheFill$(key: string): Observable<Graph>;
5917     /**
5918      * Retrieve and cache full node properties.
5919      *
5920      * @param {string} key - Key of node to fill.
5921      * @returns {Observable<Graph>} Observable emitting the graph
5922      * when the node has been updated.
5923      * @throws {GraphMapillaryError} When the operation is not valid on the
5924      * current graph.
5925      */
5926     cacheFull$(key: string): Observable<Graph>;
5927     /**
5928      * Retrieve and cache a node sequence.
5929      *
5930      * @param {string} key - Key of node for which to retrieve sequence.
5931      * @returns {Observable<Graph>} Observable emitting the graph
5932      * when the sequence has been retrieved.
5933      * @throws {GraphMapillaryError} When the operation is not valid on the
5934      * current graph.
5935      */
5936     cacheNodeSequence$(key: string): Observable<Graph>;
5937     /**
5938      * Retrieve and cache a sequence.
5939      *
5940      * @param {string} sequenceKey - Key of sequence to cache.
5941      * @returns {Observable<Graph>} Observable emitting the graph
5942      * when the sequence has been retrieved.
5943      * @throws {GraphMapillaryError} When the operation is not valid on the
5944      * current graph.
5945      */
5946     cacheSequence$(sequenceKey: string): Observable<Graph>;
5947     /**
5948      * Cache sequence edges for a node.
5949      *
5950      * @param {string} key - Key of node.
5951      * @throws {GraphMapillaryError} When the operation is not valid on the
5952      * current graph.
5953      */
5954     cacheSequenceEdges(key: string): void;
5955     /**
5956      * Retrieve and cache full nodes for all keys in a sequence.
5957      *
5958      * @param {string} sequenceKey - Key of sequence.
5959      * @param {string} referenceNodeKey - Key of node to use as reference
5960      * for optimized caching.
5961      * @returns {Observable<Graph>} Observable emitting the graph
5962      * when the nodes of the sequence has been cached.
5963      */
5964     cacheSequenceNodes$(sequenceKey: string, referenceNodeKey?: string): Observable<Graph>;
5965     /**
5966      * Retrieve and cache full nodes for a node spatial area.
5967      *
5968      * @param {string} key - Key of node for which to retrieve sequence.
5969      * @returns {Observable<Graph>} Observable emitting the graph
5970      * when the nodes in the spatial area has been made full.
5971      * @throws {GraphMapillaryError} When the operation is not valid on the
5972      * current graph.
5973      */
5974     cacheSpatialArea$(key: string): Observable<Graph>[];
5975     /**
5976      * Cache spatial edges for a node.
5977      *
5978      * @param {string} key - Key of node.
5979      * @throws {GraphMapillaryError} When the operation is not valid on the
5980      * current graph.
5981      */
5982     cacheSpatialEdges(key: string): void;
5983     /**
5984      * Retrieve and cache tiles for a node.
5985      *
5986      * @param {string} key - Key of node for which to retrieve tiles.
5987      * @returns {Array<Observable<Graph>>} Array of observables emitting
5988      * the graph for each tile required for the node has been cached.
5989      * @throws {GraphMapillaryError} When the operation is not valid on the
5990      * current graph.
5991      */
5992     cacheTiles$(key: string): Observable<Graph>[];
5993     /**
5994      * Initialize the cache for a node.
5995      *
5996      * @param {string} key - Key of node.
5997      * @throws {GraphMapillaryError} When the operation is not valid on the
5998      * current graph.
5999      */
6000     initializeCache(key: string): void;
6001     /**
6002      * Get a value indicating if the graph is fill caching a node.
6003      *
6004      * @param {string} key - Key of node.
6005      * @returns {boolean} Value indicating if the node is being fill cached.
6006      */
6007     isCachingFill(key: string): boolean;
6008     /**
6009      * Get a value indicating if the graph is fully caching a node.
6010      *
6011      * @param {string} key - Key of node.
6012      * @returns {boolean} Value indicating if the node is being fully cached.
6013      */
6014     isCachingFull(key: string): boolean;
6015     /**
6016      * Get a value indicating if the graph is caching a sequence of a node.
6017      *
6018      * @param {string} key - Key of node.
6019      * @returns {boolean} Value indicating if the sequence of a node is
6020      * being cached.
6021      */
6022     isCachingNodeSequence(key: string): boolean;
6023     /**
6024      * Get a value indicating if the graph is caching a sequence.
6025      *
6026      * @param {string} sequenceKey - Key of sequence.
6027      * @returns {boolean} Value indicating if the sequence is
6028      * being cached.
6029      */
6030     isCachingSequence(sequenceKey: string): boolean;
6031     /**
6032      * Get a value indicating if the graph is caching sequence nodes.
6033      *
6034      * @param {string} sequenceKey - Key of sequence.
6035      * @returns {boolean} Value indicating if the sequence nodes are
6036      * being cached.
6037      */
6038     isCachingSequenceNodes(sequenceKey: string): boolean;
6039     /**
6040      * Get a value indicating if the graph is caching the tiles
6041      * required for calculating spatial edges of a node.
6042      *
6043      * @param {string} key - Key of node.
6044      * @returns {boolean} Value indicating if the tiles of
6045      * a node are being cached.
6046      */
6047     isCachingTiles(key: string): boolean;
6048     /**
6049      * Get a value indicating if the cache has been initialized
6050      * for a node.
6051      *
6052      * @param {string} key - Key of node.
6053      * @returns {boolean} Value indicating if the cache has been
6054      * initialized for a node.
6055      */
6056     hasInitializedCache(key: string): boolean;
6057     /**
6058      * Get a value indicating if a node exist in the graph.
6059      *
6060      * @param {string} key - Key of node.
6061      * @returns {boolean} Value indicating if a node exist in the graph.
6062      */
6063     hasNode(key: string): boolean;
6064     /**
6065      * Get a value indicating if a node sequence exist in the graph.
6066      *
6067      * @param {string} key - Key of node.
6068      * @returns {boolean} Value indicating if a node sequence exist
6069      * in the graph.
6070      */
6071     hasNodeSequence(key: string): boolean;
6072     /**
6073      * Get a value indicating if a sequence exist in the graph.
6074      *
6075      * @param {string} sequenceKey - Key of sequence.
6076      * @returns {boolean} Value indicating if a sequence exist
6077      * in the graph.
6078      */
6079     hasSequence(sequenceKey: string): boolean;
6080     /**
6081      * Get a value indicating if sequence nodes has been cached in the graph.
6082      *
6083      * @param {string} sequenceKey - Key of sequence.
6084      * @returns {boolean} Value indicating if a sequence nodes has been
6085      * cached in the graph.
6086      */
6087     hasSequenceNodes(sequenceKey: string): boolean;
6088     /**
6089      * Get a value indicating if the graph has fully cached
6090      * all nodes in the spatial area of a node.
6091      *
6092      * @param {string} key - Key of node.
6093      * @returns {boolean} Value indicating if the spatial area
6094      * of a node has been cached.
6095      */
6096     hasSpatialArea(key: string): boolean;
6097     /**
6098      * Get a value indicating if the graph has a tiles required
6099      * for a node.
6100      *
6101      * @param {string} key - Key of node.
6102      * @returns {boolean} Value indicating if the the tiles required
6103      * by a node has been cached.
6104      */
6105     hasTiles(key: string): boolean;
6106     /**
6107      * Get a node.
6108      *
6109      * @param {string} key - Key of node.
6110      * @returns {Image} Retrieved node.
6111      */
6112     getNode(key: string): Image;
6113     /**
6114      * Get a sequence.
6115      *
6116      * @param {string} sequenceKey - Key of sequence.
6117      * @returns {Image} Retrieved sequence.
6118      */
6119     getSequence(sequenceKey: string): Sequence;
6120     /**
6121      * Reset all spatial edges of the graph nodes.
6122      */
6123     resetSpatialEdges(): void;
6124     /**
6125      * Reset the complete graph but keep the nodes corresponding
6126      * to the supplied keys. All other nodes will be disposed.
6127      *
6128      * @param {Array<string>} keepKeys - Keys for nodes to keep
6129      * in graph after reset.
6130      */
6131     reset(keepKeys: string[]): void;
6132     /**
6133      * Set the spatial node filter.
6134      *
6135      * @emits FilterFunction The filter function to the {@link Graph.filter$}
6136      * observable.
6137      *
6138      * @param {FilterExpression} filter - Filter expression to be applied
6139      * when calculating spatial edges.
6140      */
6141     setFilter(filter: FilterExpression): void;
6142     /**
6143      * Uncache the graph according to the graph configuration.
6144      *
6145      * @description Uncaches unused tiles, unused nodes and
6146      * sequences according to the numbers specified in the
6147      * graph configuration. Sequences does not have a direct
6148      * reference to either tiles or nodes and may be uncached
6149      * even if they are related to the nodes that should be kept.
6150      *
6151      * @param {Array<string>} keepIds - Ids of nodes to keep in
6152      * graph unrelated to last access. Tiles related to those keys
6153      * will also be kept in graph.
6154      * @param {Array<string>} keepCellIds - Ids of cells to keep in
6155      * graph unrelated to last access. The nodes of the cells may
6156      * still be uncached if not specified in the keep ids param
6157      * but are guaranteed to not be disposed.
6158      * @param {string} keepSequenceId - Optional id of sequence
6159      * for which the belonging nodes should not be disposed or
6160      * removed from the graph. These nodes may still be uncached if
6161      * not specified in keep ids param but are guaranteed to not
6162      * be disposed.
6163      */
6164     uncache(keepIds: string[], keepCellIds: string[], keepSequenceId?: string): void;
6165     /**
6166      * Updates existing cells with new core nodes.
6167      *
6168      * @description Non-existing cells are discarded
6169      * and not requested at all.
6170      *
6171      * Existing nodes are not changed.
6172      *
6173      * New nodes are not made full or getting assets
6174      * cached.
6175      *
6176      * @param {Array<string>} cellIds - Cell ids.
6177      * @returns {Observable<Array<Image>>} Observable
6178      * emitting the updated cells.
6179      */
6180     updateCells$(cellIds: string[]): Observable<string>;
6181     /**
6182      * Unsubscribes all subscriptions.
6183      *
6184      * @description Afterwards, you must not call any other methods
6185      * on the graph instance.
6186      */
6187     unsubscribe(): void;
6188     private _addNewKeys;
6189     private _cacheSequence$;
6190     private _cacheTile$;
6191     private _makeFull;
6192     private _preStore;
6193     private _removeFromPreStore;
6194     private _setNode;
6195     private _uncacheTile;
6196     private _uncachePreStored;
6197     private _updateCachedTileAccess;
6198     private _updateCachedNodeAccess;
6199     private _updateCell$;
6200 }
6201
6202 /**
6203  * Enumeration for graph modes.
6204  * @enum {number}
6205  * @readonly
6206  * @description Modes for the retrieval and caching performed
6207  * by the graph service on the graph.
6208  */
6209 declare enum GraphMode {
6210     /**
6211      * Caching is performed on sequences only and sequence edges are
6212      * calculated. Spatial tiles
6213      * are not retrieved and spatial edges are not calculated when
6214      * caching nodes. Complete sequences are being cached for requested
6215      * nodes within the graph.
6216      */
6217     Sequence = 0,
6218     /**
6219      * Caching is performed with emphasis on spatial data. Sequence edges
6220      * as well as spatial edges are cached. Sequence data
6221      * is still requested but complete sequences are not being cached
6222      * for requested nodes.
6223      *
6224      * This is the initial mode of the graph service.
6225      */
6226     Spatial = 1
6227 }
6228
6229 /**
6230  * @class GraphService
6231  *
6232  * @classdesc Represents a service for graph operations.
6233  */
6234 declare class GraphService {
6235     private _graph$;
6236     private _graphMode;
6237     private _graphMode$;
6238     private _graphModeSubject$;
6239     private _firstGraphSubjects$;
6240     private _dataAdded$;
6241     private _initializeCacheSubscriptions;
6242     private _sequenceSubscriptions;
6243     private _spatialSubscriptions;
6244     private _subscriptions;
6245     /**
6246      * Create a new graph service instance.
6247      *
6248      * @param {Graph} graph - Graph instance to be operated on.
6249      */
6250     constructor(graph: Graph);
6251     /**
6252      * Get dataAdded$.
6253      *
6254      * @returns {Observable<string>} Observable emitting
6255      * a cell id every time data has been added to a cell.
6256      */
6257     get dataAdded$(): Observable<string>;
6258     /**
6259      * Get filter observable.
6260      *
6261      * @desciption Emits the filter every time it has changed.
6262      *
6263      * @returns {Observable<FilterFunction>} Observable
6264      * emitting the filter function every time it is set.
6265      */
6266     get filter$(): Observable<FilterFunction>;
6267     /**
6268      * Get graph mode observable.
6269      *
6270      * @description Emits the current graph mode.
6271      *
6272      * @returns {Observable<GraphMode>} Observable
6273      * emitting the current graph mode when it changes.
6274      */
6275     get graphMode$(): Observable<GraphMode>;
6276     /**
6277      * Cache full images in a bounding box.
6278      *
6279      * @description When called, the full properties of
6280      * the image are retrieved. The image cache is not initialized
6281      * for any new images retrieved and the image assets are not
6282      * retrieved, {@link cacheImage$} needs to be called for caching
6283      * assets.
6284      *
6285      * @param {LngLat} sw - South west corner of bounding box.
6286      * @param {LngLat} ne - North east corner of bounding box.
6287      * @return {Observable<Array<Image>>} Observable emitting a single item,
6288      * the images of the bounding box, when they have all been retrieved.
6289      * @throws {Error} Propagates any IO image caching errors to the caller.
6290      */
6291     cacheBoundingBox$(sw: LngLat, ne: LngLat): Observable<Image[]>;
6292     /**
6293      * Cache full images in a cell.
6294      *
6295      * @description When called, the full properties of
6296      * the image are retrieved. The image cache is not initialized
6297      * for any new images retrieved and the image assets are not
6298      * retrieved, {@link cacheImage$} needs to be called for caching
6299      * assets.
6300      *
6301      * @param {string} cellId - Id of the cell.
6302      * @return {Observable<Array<Image>>} Observable emitting a single item,
6303      * the images of the cell, when they have all been retrieved.
6304      * @throws {Error} Propagates any IO image caching errors to the caller.
6305      */
6306     cacheCell$(cellId: string): Observable<Image[]>;
6307     /**
6308      * Cache a image in the graph and retrieve it.
6309      *
6310      * @description When called, the full properties of
6311      * the image are retrieved and the image cache is initialized.
6312      * After that the image assets are cached and the image
6313      * is emitted to the observable when.
6314      * In parallel to caching the image assets, the sequence and
6315      * spatial edges of the image are cached. For this, the sequence
6316      * of the image and the required tiles and spatial images are
6317      * retrieved. The sequence and spatial edges may be set before
6318      * or after the image is returned.
6319      *
6320      * @param {string} id - Id of the image to cache.
6321      * @return {Observable<Image>} Observable emitting a single item,
6322      * the image, when it has been retrieved and its assets are cached.
6323      * @throws {Error} Propagates any IO image caching errors to the caller.
6324      */
6325     cacheImage$(id: string): Observable<Image>;
6326     /**
6327      * Cache a sequence in the graph and retrieve it.
6328      *
6329      * @param {string} sequenceId - Sequence id.
6330      * @returns {Observable<Sequence>} Observable emitting a single item,
6331      * the sequence, when it has been retrieved and its assets are cached.
6332      * @throws {Error} Propagates any IO image caching errors to the caller.
6333      */
6334     cacheSequence$(sequenceId: string): Observable<Sequence>;
6335     /**
6336      * Cache a sequence and its images in the graph and retrieve the sequence.
6337      *
6338      * @description Caches a sequence and its assets are cached and
6339      * retrieves all images belonging to the sequence. The image assets
6340      * or edges will not be cached.
6341      *
6342      * @param {string} sequenceId - Sequence id.
6343      * @param {string} referenceImageId - Id of image to use as reference
6344      * for optimized caching.
6345      * @returns {Observable<Sequence>} Observable emitting a single item,
6346      * the sequence, when it has been retrieved, its assets are cached and
6347      * all images belonging to the sequence has been retrieved.
6348      * @throws {Error} Propagates any IO image caching errors to the caller.
6349      */
6350     cacheSequenceImages$(sequenceId: string, referenceImageId?: string): Observable<Sequence>;
6351     /**
6352      * Dispose the graph service and its children.
6353      */
6354     dispose(): void;
6355     /**
6356      * Set a spatial edge filter on the graph.
6357      *
6358      * @description Resets the spatial edges of all cached images.
6359      *
6360      * @param {FilterExpression} filter - Filter expression to be applied.
6361      * @return {Observable<Graph>} Observable emitting a single item,
6362      * the graph, when the spatial edges have been reset.
6363      */
6364     setFilter$(filter: FilterExpression): Observable<void>;
6365     /**
6366      * Set the graph mode.
6367      *
6368      * @description If graph mode is set to spatial, caching
6369      * is performed with emphasis on spatial edges. If graph
6370      * mode is set to sequence no tile data is requested and
6371      * no spatial edges are computed.
6372      *
6373      * When setting graph mode to sequence all spatial
6374      * subscriptions are aborted.
6375      *
6376      * @param {GraphMode} mode - Graph mode to set.
6377      */
6378     setGraphMode(mode: GraphMode): void;
6379     /**
6380      * Reset the graph.
6381      *
6382      * @description Resets the graph but keeps the images of the
6383      * supplied ids.
6384      *
6385      * @param {Array<string>} keepIds - Ids of images to keep in graph.
6386      * @return {Observable<Image>} Observable emitting a single item,
6387      * the graph, when it has been reset.
6388      */
6389     reset$(keepIds: string[]): Observable<void>;
6390     /**
6391      * Uncache the graph.
6392      *
6393      * @description Uncaches the graph by removing tiles, images and
6394      * sequences. Keeps the images of the supplied ids and the tiles
6395      * related to those images.
6396      *
6397      * @param {Array<string>} keepIds - Ids of images to keep in graph.
6398      * @param {Array<string>} keepCellIds - Ids of cells to keep in graph.
6399      * @param {string} keepSequenceId - Optional id of sequence
6400      * for which the belonging images should not be disposed or
6401      * removed from the graph. These images may still be uncached if
6402      * not specified in keep ids param.
6403      * @return {Observable<Graph>} Observable emitting a single item,
6404      * the graph, when the graph has been uncached.
6405      */
6406     uncache$(keepIds: string[], keepCellIds: string[], keepSequenceId?: string): Observable<void>;
6407     private _abortSubjects;
6408     private _onDataAdded;
6409     private _removeFromArray;
6410     private _resetSubscriptions;
6411 }
6412
6413 interface CacheServiceConfiguration {
6414     cellDepth: number;
6415 }
6416 declare class CacheService {
6417     private readonly _graphService;
6418     private readonly _stateService;
6419     private readonly _api;
6420     private _subscriptions;
6421     private _started;
6422     private _cellDepth;
6423     constructor(_graphService: GraphService, _stateService: StateService, _api: APIWrapper);
6424     get started(): boolean;
6425     configure(configuration?: CacheServiceConfiguration): void;
6426     start(): void;
6427     stop(): void;
6428     private _keyToEdges;
6429 }
6430
6431 declare class LoadingService {
6432     private _loaders$;
6433     private _loadersSubject$;
6434     constructor();
6435     get loading$(): Observable<boolean>;
6436     taskLoading$(task: string): Observable<boolean>;
6437     startLoading(task: string): void;
6438     stopLoading(task: string): void;
6439 }
6440
6441 /**
6442  * @class Spatial
6443  *
6444  * @classdesc Provides methods for scalar, vector and matrix calculations.
6445  */
6446 declare class Spatial {
6447     private _epsilon;
6448     /**
6449      * Converts azimuthal phi rotation (counter-clockwise with origin on X-axis) to
6450      * bearing (clockwise with origin at north or Y-axis).
6451      *
6452      * @param {number} phi - Azimuthal phi angle in radians.
6453      * @returns {number} Bearing in radians.
6454      */
6455     azimuthalToBearing(phi: number): number;
6456     /**
6457      * Converts degrees to radians.
6458      *
6459      * @param {number} deg - Degrees.
6460      * @returns {number} Radians.
6461      */
6462     degToRad(deg: number): number;
6463     /**
6464      * Converts radians to degrees.
6465      *
6466      * @param {number} rad - Radians.
6467      * @returns {number} Degrees.
6468      */
6469     radToDeg(rad: number): number;
6470     /**
6471      * Creates a rotation matrix from an angle-axis vector.
6472      *
6473      * @param {Array<number>} angleAxis - Angle-axis representation of a rotation.
6474      * @returns {THREE.Matrix4} Rotation matrix.
6475      */
6476     rotationMatrix(angleAxis: number[]): Matrix4;
6477     /**
6478      * Rotates a vector according to a angle-axis rotation vector.
6479      *
6480      * @param {Array<number>} vector - Vector to rotate.
6481      * @param {Array<number>} angleAxis - Angle-axis representation of a rotation.
6482      * @returns {THREE.Vector3} Rotated vector.
6483      */
6484     rotate(vector: number[], angleAxis: number[]): Vector3;
6485     /**
6486      * Calculates the optical center from a rotation vector
6487      * on the angle-axis representation and a translation vector
6488      * according to C = -R^T t.
6489      *
6490      * @param {Array<number>} rotation - Angle-axis representation of a rotation.
6491      * @param {Array<number>} translation - Translation vector.
6492      * @returns {THREE.Vector3} Optical center.
6493      */
6494     opticalCenter(rotation: number[], translation: number[]): Vector3;
6495     /**
6496      * Calculates the viewing direction from a rotation vector
6497      * on the angle-axis representation.
6498      *
6499      * @param {number[]} rotation - Angle-axis representation of a rotation.
6500      * @returns {THREE.Vector3} Viewing direction.
6501      */
6502     viewingDirection(rotation: number[]): Vector3;
6503     /**
6504      * Wrap a number on the interval [min, max].
6505      *
6506      * @param {number} value - Value to wrap.
6507      * @param {number} min - Lower endpoint of interval.
6508      * @param {number} max - Upper endpoint of interval.
6509      * @returns {number} The wrapped number.
6510      */
6511     wrap(value: number, min: number, max: number): number;
6512     /**
6513      * Wrap an angle on the interval [-Pi, Pi].
6514      *
6515      * @param {number} angle - Value to wrap.
6516      * @returns {number} Wrapped angle.
6517      */
6518     wrapAngle(angle: number): number;
6519     /**
6520      * Limit the value to the interval [min, max] by changing the value to
6521      * the nearest available one when it is outside the interval.
6522      *
6523      * @param {number} value - Value to clamp.
6524      * @param {number} min - Minimum of the interval.
6525      * @param {number} max - Maximum of the interval.
6526      * @returns {number} Clamped value.
6527      */
6528     clamp(value: number, min: number, max: number): number;
6529     /**
6530      * Calculates the counter-clockwise angle from the first
6531      * vector (x1, y1)^T to the second (x2, y2)^T.
6532      *
6533      * @param {number} x1 - X coordinate of first vector.
6534      * @param {number} y1 - Y coordinate of first vector.
6535      * @param {number} x2 - X coordinate of second vector.
6536      * @param {number} y2 - Y coordinate of second vector.
6537      * @returns {number} Counter clockwise angle between the vectors.
6538      */
6539     angleBetweenVector2(x1: number, y1: number, x2: number, y2: number): number;
6540     /**
6541      * Calculates the minimum (absolute) angle change for rotation
6542      * from one angle to another on the [-Pi, Pi] interval.
6543      *
6544      * @param {number} angle1 - Start angle.
6545      * @param {number} angle2 - Destination angle.
6546      * @returns {number} Absolute angle change between angles.
6547      */
6548     angleDifference(angle1: number, angle2: number): number;
6549     /**
6550      * Calculates the relative rotation angle between two
6551      * angle-axis vectors.
6552      *
6553      * @param {number} rotation1 - First angle-axis vector.
6554      * @param {number} rotation2 - Second angle-axis vector.
6555      * @returns {number} Relative rotation angle.
6556      */
6557     relativeRotationAngle(rotation1: number[], rotation2: number[]): number;
6558     /**
6559      * Calculates the angle from a vector to a plane.
6560      *
6561      * @param {Array<number>} vector - The vector.
6562      * @param {Array<number>} planeNormal - Normal of the plane.
6563      * @returns {number} Angle from between plane and vector.
6564      */
6565     angleToPlane(vector: number[], planeNormal: number[]): number;
6566     azimuthal(direction: number[], up: number[]): number;
6567     /**
6568      * Calculates the distance between two coordinates
6569      * (longitude, latitude pairs) in meters according to
6570      * the haversine formula.
6571      *
6572      * @param {number} lat1 - Latitude of the first coordinate in degrees.
6573      * @param {number} lng1 - Longitude of the first coordinate in degrees.
6574      * @param {number} lat2 - Latitude of the second coordinate in degrees.
6575      * @param {number} lng2 - Longitude of the second coordinate in degrees.
6576      * @returns {number} Distance between lat lon positions in meters.
6577      */
6578     distanceFromLngLat(lng1: number, lat1: number, lng2: number, lat2: number): number;
6579 }
6580
6581 /**
6582  * @class ViewportCoords
6583  *
6584  * @classdesc Provides methods for calculating 2D coordinate conversions
6585  * as well as 3D projection and unprojection.
6586  *
6587  * Basic coordinates are 2D coordinates on the [0, 1] interval and
6588  * have the origin point, (0, 0), at the top left corner and the
6589  * maximum value, (1, 1), at the bottom right corner of the original
6590  * image.
6591  *
6592  * Viewport coordinates are 2D coordinates on the [-1, 1] interval and
6593  * have the origin point in the center. The bottom left corner point is
6594  * (-1, -1) and the top right corner point is (1, 1).
6595  *
6596  * Canvas coordiantes are 2D pixel coordinates on the [0, canvasWidth] and
6597  * [0, canvasHeight] intervals. The origin point (0, 0) is in the top left
6598  * corner and the maximum value is (canvasWidth, canvasHeight) is in the
6599  * bottom right corner.
6600  *
6601  * 3D coordinates are in the topocentric world reference frame.
6602  */
6603 declare class ViewportCoords {
6604     private _unprojectDepth;
6605     /**
6606      * Convert basic coordinates to canvas coordinates.
6607      *
6608      * @description Transform origin and camera position needs to be the
6609      * equal for reliable return value.
6610      *
6611      * @param {number} basicX - Basic X coordinate.
6612      * @param {number} basicY - Basic Y coordinate.
6613      * @param {HTMLElement} container - The viewer container.
6614      * @param {Transform} transform - Transform of the image to unproject from.
6615      * @param {THREE.Camera} camera - Camera used in rendering.
6616      * @returns {Array<number>} 2D canvas coordinates.
6617      */
6618     basicToCanvas(basicX: number, basicY: number, container: {
6619         offsetHeight: number;
6620         offsetWidth: number;
6621     }, transform: Transform, camera: Camera$1): number[];
6622     /**
6623      * Convert basic coordinates to canvas coordinates safely. If 3D point is
6624      * behind camera null will be returned.
6625      *
6626      * @description Transform origin and camera position needs to be the
6627      * equal for reliable return value.
6628      *
6629      * @param {number} basicX - Basic X coordinate.
6630      * @param {number} basicY - Basic Y coordinate.
6631      * @param {HTMLElement} container - The viewer container.
6632      * @param {Transform} transform - Transform of the image to unproject from.
6633      * @param {THREE.Camera} camera - Camera used in rendering.
6634      * @returns {Array<number>} 2D canvas coordinates if the basic point represents a 3D point
6635      * in front of the camera, otherwise null.
6636      */
6637     basicToCanvasSafe(basicX: number, basicY: number, container: {
6638         offsetHeight: number;
6639         offsetWidth: number;
6640     }, transform: Transform, camera: Camera$1): number[];
6641     /**
6642      * Convert basic coordinates to viewport coordinates.
6643      *
6644      * @description Transform origin and camera position needs to be the
6645      * equal for reliable return value.
6646      *
6647      * @param {number} basicX - Basic X coordinate.
6648      * @param {number} basicY - Basic Y coordinate.
6649      * @param {Transform} transform - Transform of the image to unproject from.
6650      * @param {THREE.Camera} camera - Camera used in rendering.
6651      * @returns {Array<number>} 2D viewport coordinates.
6652      */
6653     basicToViewport(basicX: number, basicY: number, transform: Transform, camera: Camera$1): number[];
6654     /**
6655      * Convert basic coordinates to viewport coordinates safely. If 3D point is
6656      * behind camera null will be returned.
6657      *
6658      * @description Transform origin and camera position needs to be the
6659      * equal for reliable return value.
6660      *
6661      * @param {number} basicX - Basic X coordinate.
6662      * @param {number} basicY - Basic Y coordinate.
6663      * @param {Transform} transform - Transform of the image to unproject from.
6664      * @param {THREE.Camera} camera - Camera used in rendering.
6665      * @returns {Array<number>} 2D viewport coordinates.
6666      */
6667     basicToViewportSafe(basicX: number, basicY: number, transform: Transform, camera: Camera$1): number[];
6668     /**
6669      * Convert camera 3D coordinates to viewport coordinates.
6670      *
6671      * @param {number} pointCamera - 3D point in camera coordinate system.
6672      * @param {THREE.Camera} camera - Camera used in rendering.
6673      * @returns {Array<number>} 2D viewport coordinates.
6674      */
6675     cameraToViewport(pointCamera: number[], camera: Camera$1): number[];
6676     /**
6677      * Get canvas pixel position from event.
6678      *
6679      * @param {Event} event - Event containing clientX and clientY properties.
6680      * @param {HTMLElement} element - HTML element.
6681      * @returns {Array<number>} 2D canvas coordinates.
6682      */
6683     canvasPosition(event: {
6684         clientX: number;
6685         clientY: number;
6686     }, element: HTMLElement): number[];
6687     /**
6688      * Convert canvas coordinates to basic coordinates.
6689      *
6690      * @description Transform origin and camera position needs to be the
6691      * equal for reliable return value.
6692      *
6693      * @param {number} canvasX - Canvas X coordinate.
6694      * @param {number} canvasY - Canvas Y coordinate.
6695      * @param {HTMLElement} container - The viewer container.
6696      * @param {Transform} transform - Transform of the image to unproject from.
6697      * @param {THREE.Camera} camera - Camera used in rendering.
6698      * @returns {Array<number>} 2D basic coordinates.
6699      */
6700     canvasToBasic(canvasX: number, canvasY: number, container: {
6701         offsetHeight: number;
6702         offsetWidth: number;
6703     }, transform: Transform, camera: Camera$1): number[];
6704     /**
6705      * Convert canvas coordinates to viewport coordinates.
6706      *
6707      * @param {number} canvasX - Canvas X coordinate.
6708      * @param {number} canvasY - Canvas Y coordinate.
6709      * @param {HTMLElement} container - The viewer container.
6710      * @returns {Array<number>} 2D viewport coordinates.
6711      */
6712     canvasToViewport(canvasX: number, canvasY: number, container: {
6713         offsetHeight: number;
6714         offsetWidth: number;
6715     }): number[];
6716     /**
6717      * Determines the width and height of the container in canvas coordinates.
6718      *
6719      * @param {HTMLElement} container - The viewer container.
6720      * @returns {Array<number>} 2D canvas coordinates.
6721      */
6722     containerToCanvas(container: {
6723         offsetHeight: number;
6724         offsetWidth: number;
6725     }): number[];
6726     /**
6727      * Determine basic distances from image to canvas corners.
6728      *
6729      * @description Transform origin and camera position needs to be the
6730      * equal for reliable return value.
6731      *
6732      * Determines the smallest basic distance for every side of the canvas.
6733      *
6734      * @param {Transform} transform - Transform of the image to unproject from.
6735      * @param {THREE.Camera} camera - Camera used in rendering.
6736      * @returns {Array<number>} Array of basic distances as [top, right, bottom, left].
6737      */
6738     getBasicDistances(transform: Transform, camera: Camera$1): number[];
6739     /**
6740      * Determine pixel distances from image to canvas corners.
6741      *
6742      * @description Transform origin and camera position needs to be the
6743      * equal for reliable return value.
6744      *
6745      * Determines the smallest pixel distance for every side of the canvas.
6746      *
6747      * @param {HTMLElement} container - The viewer container.
6748      * @param {Transform} transform - Transform of the image to unproject from.
6749      * @param {THREE.Camera} camera - Camera used in rendering.
6750      * @returns {Array<number>} Array of pixel distances as [top, right, bottom, left].
6751      */
6752     getPixelDistances(container: {
6753         offsetHeight: number;
6754         offsetWidth: number;
6755     }, transform: Transform, camera: Camera$1): number[];
6756     /**
6757      * Determine if an event occured inside an element.
6758      *
6759      * @param {Event} event - Event containing clientX and clientY properties.
6760      * @param {HTMLElement} element - HTML element.
6761      * @returns {boolean} Value indicating if the event occured inside the element or not.
6762      */
6763     insideElement(event: {
6764         clientX: number;
6765         clientY: number;
6766     }, element: HTMLElement): boolean;
6767     /**
6768      * Project 3D world coordinates to canvas coordinates.
6769      *
6770      * @param {Array<number>} point3D - 3D world coordinates.
6771      * @param {HTMLElement} container - The viewer container.
6772      * @param {THREE.Camera} camera - Camera used in rendering.
6773      * @returns {Array<number>} 2D canvas coordinates.
6774      */
6775     projectToCanvas(point3d: number[], container: {
6776         offsetHeight: number;
6777         offsetWidth: number;
6778     }, camera: Camera$1): number[];
6779     /**
6780      * Project 3D world coordinates to canvas coordinates safely. If 3D
6781      * point is behind camera null will be returned.
6782      *
6783      * @param {Array<number>} point3D - 3D world coordinates.
6784      * @param {HTMLElement} container - The viewer container.
6785      * @param {THREE.Camera} camera - Camera used in rendering.
6786      * @returns {Array<number>} 2D canvas coordinates.
6787      */
6788     projectToCanvasSafe(point3d: number[], container: {
6789         offsetHeight: number;
6790         offsetWidth: number;
6791     }, camera: Camera$1): number[];
6792     /**
6793      * Project 3D world coordinates to viewport coordinates.
6794      *
6795      * @param {Array<number>} point3D - 3D world coordinates.
6796      * @param {THREE.Camera} camera - Camera used in rendering.
6797      * @returns {Array<number>} 2D viewport coordinates.
6798      */
6799     projectToViewport(point3d: number[], camera: Camera$1): number[];
6800     /**
6801      * Uproject canvas coordinates to 3D world coordinates.
6802      *
6803      * @param {number} canvasX - Canvas X coordinate.
6804      * @param {number} canvasY - Canvas Y coordinate.
6805      * @param {HTMLElement} container - The viewer container.
6806      * @param {THREE.Camera} camera - Camera used in rendering.
6807      * @returns {Array<number>} 3D world coordinates.
6808      */
6809     unprojectFromCanvas(canvasX: number, canvasY: number, container: {
6810         offsetHeight: number;
6811         offsetWidth: number;
6812     }, camera: Camera$1): Vector3;
6813     /**
6814      * Unproject viewport coordinates to 3D world coordinates.
6815      *
6816      * @param {number} viewportX - Viewport X coordinate.
6817      * @param {number} viewportY - Viewport Y coordinate.
6818      * @param {THREE.Camera} camera - Camera used in rendering.
6819      * @returns {Array<number>} 3D world coordinates.
6820      */
6821     unprojectFromViewport(viewportX: number, viewportY: number, camera: Camera$1): Vector3;
6822     /**
6823      * Convert viewport coordinates to basic coordinates.
6824      *
6825      * @description Transform origin and camera position needs to be the
6826      * equal for reliable return value.
6827      *
6828      * @param {number} viewportX - Viewport X coordinate.
6829      * @param {number} viewportY - Viewport Y coordinate.
6830      * @param {Transform} transform - Transform of the image to unproject from.
6831      * @param {THREE.Camera} camera - Camera used in rendering.
6832      * @returns {Array<number>} 2D basic coordinates.
6833      */
6834     viewportToBasic(viewportX: number, viewportY: number, transform: Transform, camera: Camera$1): number[];
6835     /**
6836      * Convert viewport coordinates to canvas coordinates.
6837      *
6838      * @param {number} viewportX - Viewport X coordinate.
6839      * @param {number} viewportY - Viewport Y coordinate.
6840      * @param {HTMLElement} container - The viewer container.
6841      * @returns {Array<number>} 2D canvas coordinates.
6842      */
6843     viewportToCanvas(viewportX: number, viewportY: number, container: {
6844         offsetHeight: number;
6845         offsetWidth: number;
6846     }): number[];
6847     /**
6848      * Convert 3D world coordinates to 3D camera coordinates.
6849      *
6850      * @param {number} point3D - 3D point in world coordinate system.
6851      * @param {THREE.Camera} camera - Camera used in rendering.
6852      * @returns {Array<number>} 3D camera coordinates.
6853      */
6854     worldToCamera(point3d: number[], camera: Camera$1): number[];
6855 }
6856
6857 declare class PanService {
6858     private _graphService;
6859     private _stateService;
6860     private _graphCalculator;
6861     private _spatial;
6862     private _viewportCoords;
6863     private _panImagesSubject$;
6864     private _panImages$;
6865     private _panImagesSubscription;
6866     private _subscriptions;
6867     private _mode;
6868     constructor(graphService: GraphService, stateService: StateService, enabled?: boolean, graphCalculator?: GraphCalculator, spatial?: Spatial, viewportCoords?: ViewportCoords);
6869     get panImages$(): Observable<[Image, Transform, number][]>;
6870     dispose(): void;
6871     enable(): void;
6872     disable(): void;
6873     start(): void;
6874     stop(): void;
6875     private _distance;
6876     private _timeDifference;
6877     private _createTransform;
6878     private _computeProjectedPoints;
6879     private _computeHorizontalFov;
6880     private _coordToFov;
6881 }
6882
6883 declare class PlayService {
6884     static readonly sequenceSpeed: number;
6885     private _graphService;
6886     private _stateService;
6887     private _imagesAhead;
6888     private _playing;
6889     private _speed;
6890     private _direction$;
6891     private _directionSubject$;
6892     private _playing$;
6893     private _playingSubject$;
6894     private _speed$;
6895     private _speedSubject$;
6896     private _playingSubscription;
6897     private _cacheSubscription;
6898     private _clearSubscription;
6899     private _earthSubscription;
6900     private _graphModeSubscription;
6901     private _stopSubscription;
6902     private _subscriptions;
6903     private _bridging$;
6904     constructor(graphService: GraphService, stateService: StateService);
6905     get playing(): boolean;
6906     get direction$(): Observable<NavigationDirection>;
6907     get playing$(): Observable<boolean>;
6908     get speed$(): Observable<number>;
6909     play(): void;
6910     dispose(): void;
6911     setDirection(direction: NavigationDirection): void;
6912     setSpeed(speed: number): void;
6913     stop(): void;
6914     private _mapSpeed;
6915     private _mapImagesAhead;
6916     private _setPlaying;
6917     private _setSpeed;
6918 }
6919
6920 declare class Navigator {
6921     private _api;
6922     private _cacheService;
6923     private _graphService;
6924     private _loadingService;
6925     private _loadingName;
6926     private _panService;
6927     private _playService;
6928     private _stateService;
6929     private _idRequested$;
6930     private _movedToId$;
6931     private _request$;
6932     private _requestSubscription;
6933     private _imageRequestSubscription;
6934     constructor(options: ViewerOptions, api?: APIWrapper, graphService?: GraphService, loadingService?: LoadingService, stateService?: StateService, cacheService?: CacheService, playService?: PlayService, panService?: PanService);
6935     get api(): APIWrapper;
6936     get cacheService(): CacheService;
6937     get graphService(): GraphService;
6938     get loadingService(): LoadingService;
6939     get movedToId$(): Observable<string>;
6940     get panService(): PanService;
6941     get playService(): PlayService;
6942     get stateService(): StateService;
6943     dispose(): void;
6944     moveTo$(id: string): Observable<Image>;
6945     moveDir$(direction: NavigationDirection): Observable<Image>;
6946     setFilter$(filter: FilterExpression): Observable<void>;
6947     setAccessToken$(accessToken?: string): Observable<void>;
6948     private _cacheIds$;
6949     private _abortRequest;
6950     private _makeRequest$;
6951     private _moveTo$;
6952     private _trajectoryIds$;
6953 }
6954
6955 declare class SubscriptionHolder {
6956     private _subscriptions;
6957     push(subscription: Subscription): void;
6958     unsubscribe(): void;
6959 }
6960
6961 interface IComponent {
6962     /**
6963      * Value indicating if the component is currently active.
6964      */
6965     readonly activated: boolean;
6966     /**
6967      * Default configuration for the component.
6968      */
6969     readonly defaultConfiguration: ComponentConfiguration;
6970     /**
6971      * The name of the component. Used when interacting with the
6972      * component through the Viewer's API.
6973      */
6974     readonly name: string;
6975     /**
6976      * Configure the component.
6977      */
6978     configure(configuration: ComponentConfiguration): void;
6979 }
6980
6981 /**
6982  * @event
6983  */
6984 declare type ComponentEventType = "geometrycreate" | "hover" | "markerdragend" | "markerdragstart" | "markerposition" | "playing" | "tagcreateend" | "tagcreatestart" | "tagmode" | "tags";
6985
6986 declare abstract class Component<TConfiguration extends ComponentConfiguration> extends EventEmitter implements IComponent {
6987     static componentName: ComponentName | FallbackComponentName;
6988     protected _activated: boolean;
6989     protected _container: Container;
6990     protected _name: string;
6991     protected _navigator: Navigator;
6992     protected readonly _subscriptions: SubscriptionHolder;
6993     protected _activated$: BehaviorSubject<boolean>;
6994     protected _configuration$: Observable<TConfiguration>;
6995     protected _configurationSubject$: Subject<TConfiguration>;
6996     constructor(name: string, container: Container, navigator: Navigator);
6997     /**
6998      * Get activated.
6999      *
7000      * @returns {boolean} Value indicating if the component is
7001      * currently active.
7002      */
7003     get activated(): boolean;
7004     /** @ignore */
7005     get activated$(): Observable<boolean>;
7006     /**
7007      * Get default configuration.
7008      *
7009      * @returns {TConfiguration} Default configuration for component.
7010      */
7011     get defaultConfiguration(): TConfiguration;
7012     /** @ignore */
7013     get configuration$(): Observable<TConfiguration>;
7014     /**
7015      * Get name.
7016      *
7017      * @description The name of the component. Used when interacting with the
7018      * component through the Viewer's API.
7019      */
7020     get name(): string;
7021     /** @ignore */
7022     activate(conf?: TConfiguration): void;
7023     /**
7024      * Configure the component.
7025      *
7026      * @param configuration Component configuration.
7027      */
7028     configure(configuration: TConfiguration): void;
7029     /** @ignore */
7030     deactivate(): void;
7031     /** @inheritdoc */
7032     fire<T>(type: ComponentEventType, event: T): void;
7033     /** @inheritdoc */
7034     off<T>(type: ComponentEventType, handler: (event: T) => void): void;
7035     /** @inheritdoc */
7036     on<T>(type: ComponentEventType, handler: (event: T) => void): void;
7037     /**
7038      * Detect the viewer's new width and height and resize the component's
7039      * rendered elements accordingly if applicable.
7040      *
7041      * @ignore
7042      */
7043     resize(): void;
7044     protected abstract _activate(): void;
7045     protected abstract _deactivate(): void;
7046     protected abstract _getDefaultConfiguration(): TConfiguration;
7047 }
7048
7049 /**
7050  * @class BearingComponent
7051  *
7052  * @classdesc Component for indicating bearing and field of view.
7053  *
7054  * @example
7055  * ```js
7056  * var viewer = new Viewer({ ... });
7057  * var bearingComponent = viewer.getComponent("bearing");
7058  * bearingComponent.configure({ size: ComponentSize.Small });
7059  * ```
7060  */
7061 declare class BearingComponent extends Component<BearingConfiguration> {
7062     static componentName: ComponentName;
7063     private _spatial;
7064     private _viewportCoords;
7065     private _svgNamespace;
7066     private _distinctThreshold;
7067     private _animationSpeed;
7068     private _unitBezier;
7069     /** @ignore */
7070     constructor(name: string, container: Container, navigator: Navigator);
7071     protected _activate(): void;
7072     protected _deactivate(): void;
7073     protected _getDefaultConfiguration(): BearingConfiguration;
7074     private _createFovIndicator;
7075     private _createFovArc;
7076     private _createCircleSectorCompass;
7077     private _createCircleSector;
7078     private _createNorth;
7079     private _createBackground;
7080     private _computeProjectedPoints;
7081     private _computeHorizontalFov;
7082     private _coordToFov;
7083     private _interpolate;
7084 }
7085
7086 declare class CacheComponent extends Component<CacheConfiguration> {
7087     static componentName: ComponentName;
7088     /** @ignore */
7089     constructor(name: string, container: Container, navigator: Navigator);
7090     protected _activate(): void;
7091     protected _deactivate(): void;
7092     protected _getDefaultConfiguration(): CacheConfiguration;
7093     private _cache$;
7094     private _imageToEdges$;
7095 }
7096
7097 /**
7098  * Interface for general component events.
7099  */
7100 interface ComponentEvent {
7101     /**
7102      * The component object that fired the event.
7103      */
7104     target: IComponent;
7105     /**
7106      * The event type.
7107      */
7108     type: ComponentEventType;
7109 }
7110
7111 /**
7112  * Interface for component hover events.
7113  */
7114 interface ComponentHoverEvent extends ComponentEvent {
7115     /**
7116      * The image id corresponding to the element or object that
7117      * is being hovered. When the mouse leaves the element or
7118      * object the id will be null.
7119      */
7120     id: string;
7121     type: "hover";
7122 }
7123
7124 /**
7125  * @class Geometry
7126  * @abstract
7127  * @classdesc Represents a geometry.
7128  */
7129 declare abstract class Geometry {
7130     protected _notifyChanged$: Subject<Geometry>;
7131     /**
7132      * Create a geometry.
7133      *
7134      * @constructor
7135      * @ignore
7136      */
7137     constructor();
7138     /**
7139      * Get changed observable.
7140      *
7141      * @description Emits the geometry itself every time the geometry
7142      * has changed.
7143      *
7144      * @returns {Observable<Geometry>} Observable emitting the geometry instance.
7145      * @ignore
7146      */
7147     get changed$(): Observable<Geometry>;
7148     /**
7149      * Get the 2D basic coordinates for the centroid of the geometry.
7150      *
7151      * @returns {Array<number>} 2D basic coordinates representing the centroid.
7152      * @ignore
7153      */
7154     abstract getCentroid2d(): number[];
7155     /**
7156      * Get the 3D world coordinates for the centroid of the geometry.
7157      *
7158      * @param {Transform} transform - The transform of the image related to the geometry.
7159      * @returns {Array<number>} 3D world coordinates representing the centroid.
7160      * @ignore
7161      */
7162     abstract getCentroid3d(transform: Transform): number[];
7163     /**
7164      * Set the 2D centroid of the geometry.
7165      *
7166      * @param {Array<number>} value - The new value of the centroid in basic coordinates.
7167      * @param {Transform} transform - The transform of the image related to the geometry.
7168      * @ignore
7169      */
7170     abstract setCentroid2d(value: number[], transform: Transform): void;
7171 }
7172
7173 /**
7174  * Interface for component geometry events.
7175  */
7176 interface ComponentGeometryEvent extends ComponentEvent {
7177     /**
7178      * Geometry related to the event.
7179      */
7180     geometry: Geometry;
7181     type: "geometrycreate";
7182 }
7183
7184 /**
7185  * @class Marker
7186  *
7187  * @classdesc Represents an abstract marker class that should be extended
7188  * by marker implementations used in the marker component.
7189  */
7190 declare abstract class Marker {
7191     protected _id: string;
7192     protected _geometry: Object3D;
7193     protected _lngLat: LngLat;
7194     constructor(id: string, lngLat: LngLat);
7195     /**
7196      * Get id.
7197      * @returns {string} The id of the marker.
7198      */
7199     get id(): string;
7200     /**
7201      * Get geometry.
7202      *
7203      * @ignore
7204      */
7205     get geometry(): Object3D;
7206     /**
7207      * Get lngLat.
7208      * @returns {LngLat} The geographic coordinates of the marker.
7209      */
7210     get lngLat(): LngLat;
7211     /** @ignore */
7212     createGeometry(position: number[]): void;
7213     /** @ignore */
7214     disposeGeometry(): void;
7215     /** @ignore */
7216     getInteractiveObjects(): Object3D[];
7217     /** @ignore */
7218     lerpAltitude(alt: number, alpha: number): void;
7219     /** @ignore */
7220     updatePosition(position: number[], lngLat?: LngLat): void;
7221     protected abstract _createGeometry(position: number[]): void;
7222     protected abstract _disposeGeometry(): void;
7223     protected abstract _getInteractiveObjects(): Object3D[];
7224 }
7225
7226 /**
7227  * Interface for component marker events.
7228  */
7229 interface ComponentMarkerEvent extends ComponentEvent {
7230     /**
7231      * The marker that was affected by the event.
7232      */
7233     marker: Marker;
7234     type: "markerdragend" | "markerdragstart" | "markerposition";
7235 }
7236
7237 /**
7238  * Interface for component play events.
7239  */
7240 interface ComponentPlayEvent extends ComponentEvent {
7241     /**
7242      * Value indiciating if the component is playing or not.
7243      */
7244     playing: boolean;
7245     type: "playing";
7246 }
7247
7248 /**
7249  * Interface for component state events.
7250  *
7251  * @example
7252  * ```js
7253  * // The `hover` event is an example of a `ComponentStateEvent`.
7254  * // Set up an event listener on the direction component.
7255  * var directionComponent = viewer.getComponent('direction');
7256  * directionComponent.on('hover', function(e) {
7257  *   console.log('A hover event has occured');
7258  * });
7259  * ```
7260  */
7261 interface ComponentStateEvent extends ComponentEvent {
7262     type: "tagcreateend" | "tagcreatestart" | "tags";
7263 }
7264
7265 /**
7266  * Interface for component tag mode events.
7267  */
7268 interface ComponentTagModeEvent extends ComponentEvent {
7269     /**
7270      * Value indicating the current tag mode of the component.
7271      */
7272     mode: TagMode;
7273     type: "tagmode";
7274 }
7275
7276 /**
7277  * @class DirectionDOMRenderer
7278  * @classdesc DOM renderer for direction arrows.
7279  */
7280 declare class DirectionDOMRenderer {
7281     private _spatial;
7282     private _calculator;
7283     private _image;
7284     private _rotation;
7285     private _epsilon;
7286     private _highlightKey;
7287     private _distinguishSequence;
7288     private _needsRender;
7289     private _stepEdges;
7290     private _turnEdges;
7291     private _sphericalEdges;
7292     private _sequenceEdgeKeys;
7293     private _stepDirections;
7294     private _turnDirections;
7295     private _turnNames;
7296     private _isEdge;
7297     constructor(configuration: DirectionConfiguration, size: ViewportSize);
7298     /**
7299      * Get needs render.
7300      *
7301      * @returns {boolean} Value indicating whether render should be called.
7302      */
7303     get needsRender(): boolean;
7304     /**
7305      * Renders virtual DOM elements.
7306      *
7307      * @description Calling render resets the needs render property.
7308      */
7309     render(navigator: Navigator): VNode;
7310     setEdges(edgeStatus: NavigationEdgeStatus, sequence: Sequence): void;
7311     /**
7312      * Set image for which to show edges.
7313      *
7314      * @param {Image} image
7315      */
7316     setImage(image: Image): void;
7317     /**
7318      * Set the render camera to use for calculating rotations.
7319      *
7320      * @param {RenderCamera} renderCamera
7321      */
7322     setRenderCamera(renderCamera: RenderCamera): void;
7323     /**
7324      * Set configuration values.
7325      *
7326      * @param {DirectionConfiguration} configuration
7327      */
7328     setConfiguration(configuration: DirectionConfiguration): void;
7329     /**
7330      * Detect the element's width and height and resize
7331      * elements accordingly.
7332      *
7333      * @param {ViewportSize} size Size of vßiewer container element.
7334      */
7335     resize(size: ViewportSize): void;
7336     private _setNeedsRender;
7337     private _clearEdges;
7338     private _setEdges;
7339     private _createSphericalArrows;
7340     private _createSphericalToPerspectiveArrow;
7341     private _createPerspectiveToSphericalArrows;
7342     private _createStepArrows;
7343     private _createTurnArrows;
7344     private _createVNodeByKey;
7345     private _createVNodeByDirection;
7346     private _createVNodeByTurn;
7347     private _createVNodeInactive;
7348     private _createVNode;
7349     private _getContainer;
7350 }
7351
7352 /**
7353  * @class DirectionComponent
7354  * @classdesc Component showing navigation arrows for steps and turns.
7355  */
7356 declare class DirectionComponent extends Component<DirectionConfiguration> {
7357     /** @inheritdoc */
7358     static componentName: ComponentName;
7359     private _renderer;
7360     private _hoveredIdSubject$;
7361     private _hoveredId$;
7362     /** @ignore */
7363     constructor(name: string, container: Container, navigator: Navigator, directionDOMRenderer?: DirectionDOMRenderer);
7364     fire(type: "hover", event: ComponentHoverEvent): void;
7365     /** @ignore */
7366     fire(type: ComponentEventType, event: ComponentStateEvent): void;
7367     off(type: "hover", handler: (event: ComponentHoverEvent) => void): void;
7368     /** @ignore */
7369     off(type: ComponentEventType, handler: (event: ComponentStateEvent) => void): void;
7370     /**
7371      * Fired when the hovered element of a component changes.
7372      *
7373      * @event hover
7374      * @example
7375      * ```js
7376      * // Initialize the viewer
7377      * var viewer = new Viewer({ // viewer options });
7378      * var component = viewer.getComponent('<component-name>');
7379      * // Set an event listener
7380      * component.on('hover', function() {
7381      *   console.log("A hover event has occurred.");
7382      * });
7383      * ```
7384      */
7385     on(type: "hover", handler: (event: ComponentHoverEvent) => void): void;
7386     /** @ignore */
7387     on(type: ComponentEventType, handler: (event: ComponentStateEvent) => void): void;
7388     protected _activate(): void;
7389     protected _deactivate(): void;
7390     protected _getDefaultConfiguration(): DirectionConfiguration;
7391 }
7392
7393 declare abstract class HandlerBase<TConfiguration extends ComponentConfiguration> {
7394     protected _component: Component<TConfiguration>;
7395     protected _container: Container;
7396     protected _navigator: Navigator;
7397     protected _enabled: boolean;
7398     /** @ignore */
7399     constructor(component: Component<TConfiguration>, container: Container, navigator: Navigator);
7400     /**
7401      * Returns a Boolean indicating whether the interaction is enabled.
7402      *
7403      * @returns {boolean} `true` if the interaction is enabled.
7404      */
7405     get isEnabled(): boolean;
7406     /**
7407      * Enables the interaction.
7408      *
7409      * @example
7410      * ```js
7411      * <component-name>.<handler-name>.enable();
7412      * ```
7413      */
7414     enable(): void;
7415     /**
7416      * Disables the interaction.
7417      *
7418      * @example
7419      * ```js
7420      * <component-name>.<handler-name>.disable();
7421      * ```
7422      */
7423     disable(): void;
7424     protected abstract _enable(): void;
7425     protected abstract _disable(): void;
7426     protected abstract _getConfiguration(enable: boolean): TConfiguration;
7427 }
7428
7429 /**
7430  * The `KeySequenceNavigationHandler` allows the user to navigate through a sequence using the
7431  * following key commands:
7432  *
7433  * `ALT` + `Up Arrow`: Navigate to next image in the sequence.
7434  * `ALT` + `Down Arrow`: Navigate to previous image in sequence.
7435  *
7436  * @example
7437  * ```js
7438  * var keyboardComponent = viewer.getComponent("keyboard");
7439  *
7440  * keyboardComponent.keySequenceNavigation.disable();
7441  * keyboardComponent.keySequenceNavigation.enable();
7442  *
7443  * var isEnabled = keyboardComponent.keySequenceNavigation.isEnabled;
7444  * ```
7445  */
7446 declare class KeySequenceNavigationHandler extends HandlerBase<KeyboardConfiguration> {
7447     private _keyDownSubscription;
7448     protected _enable(): void;
7449     protected _disable(): void;
7450     protected _getConfiguration(enable: boolean): KeyboardConfiguration;
7451 }
7452
7453 /**
7454  * The `KeySpatialNavigationHandler` allows the user to navigate through a sequence using the
7455  * following key commands:
7456  *
7457  * `Up Arrow`: Step forward.
7458  * `Down Arrow`: Step backward.
7459  * `Left Arrow`: Step to the left.
7460  * `Rigth Arrow`: Step to the right.
7461  * `SHIFT` + `Down Arrow`: Turn around.
7462  * `SHIFT` + `Left Arrow`: Turn to the left.
7463  * `SHIFT` + `Rigth Arrow`: Turn to the right.
7464  *
7465  * @example
7466  * ```js
7467  * var keyboardComponent = viewer.getComponent("keyboard");
7468  *
7469  * keyboardComponent.keySpatialNavigation.disable();
7470  * keyboardComponent.keySpatialNavigation.enable();
7471  *
7472  * var isEnabled = keyboardComponent.keySpatialNavigation.isEnabled;
7473  * ```
7474  */
7475 declare class KeySpatialNavigationHandler extends HandlerBase<KeyboardConfiguration> {
7476     private _spatial;
7477     private _keyDownSubscription;
7478     /** @ignore */
7479     constructor(component: Component<KeyboardConfiguration>, container: Container, navigator: Navigator, spatial: Spatial);
7480     protected _enable(): void;
7481     protected _disable(): void;
7482     protected _getConfiguration(enable: boolean): KeyboardConfiguration;
7483     private _moveDir;
7484     private _moveTo;
7485     private _rotationFromCamera;
7486 }
7487
7488 /**
7489  * The `KeyZoomHandler` allows the user to zoom in and out using the
7490  * following key commands:
7491  *
7492  * `+`: Zoom in.
7493  * `-`: Zoom out.
7494  *
7495  * @example
7496  * ```js
7497  * var keyboardComponent = viewer.getComponent("keyboard");
7498  *
7499  * keyboardComponent.keyZoom.disable();
7500  * keyboardComponent.keyZoom.enable();
7501  *
7502  * var isEnabled = keyboardComponent.keyZoom.isEnabled;
7503  * ```
7504  */
7505 declare class KeyZoomHandler extends HandlerBase<KeyboardConfiguration> {
7506     private _keyDownSubscription;
7507     private _viewportCoords;
7508     /** @ignore */
7509     constructor(component: Component<KeyboardConfiguration>, container: Container, navigator: Navigator, viewportCoords: ViewportCoords);
7510     protected _enable(): void;
7511     protected _disable(): void;
7512     protected _getConfiguration(enable: boolean): KeyboardConfiguration;
7513 }
7514
7515 /**
7516  * The `KeyPlayHandler` allows the user to control the play behavior
7517  * using the following key commands:
7518  *
7519  * `Spacebar`: Start or stop playing.
7520  * `SHIFT` + `D`: Switch direction.
7521  * `<`: Decrease speed.
7522  * `>`: Increase speed.
7523  *
7524  * @example
7525  * ```js
7526  * var keyboardComponent = viewer.getComponent("keyboard");
7527  *
7528  * keyboardComponent.keyPlay.disable();
7529  * keyboardComponent.keyPlay.enable();
7530  *
7531  * var isEnabled = keyboardComponent.keyPlay.isEnabled;
7532  * ```
7533  */
7534 declare class KeyPlayHandler extends HandlerBase<KeyboardConfiguration> {
7535     private _keyDownSubscription;
7536     protected _enable(): void;
7537     protected _disable(): void;
7538     protected _getConfiguration(enable: boolean): KeyboardConfiguration;
7539 }
7540
7541 /**
7542  * @class KeyboardComponent
7543  *
7544  * @classdesc Component for keyboard event handling.
7545  *
7546  * To retrive and use the keyboard component
7547  *
7548  * @example
7549  * ```js
7550  * var viewer = new Viewer({ ... });
7551  *
7552  * var keyboardComponent = viewer.getComponent("keyboard");
7553  * ```
7554  */
7555 declare class KeyboardComponent extends Component<KeyboardConfiguration> {
7556     static componentName: ComponentName;
7557     private _keyPlayHandler;
7558     private _keySequenceNavigationHandler;
7559     private _keySpatialNavigationHandler;
7560     private _keyZoomHandler;
7561     /** @ignore */
7562     constructor(name: string, container: Container, navigator: Navigator);
7563     /**
7564      * Get key play.
7565      *
7566      * @returns {KeyPlayHandler} The key play handler.
7567      */
7568     get keyPlay(): KeyPlayHandler;
7569     /**
7570      * Get key sequence navigation.
7571      *
7572      * @returns {KeySequenceNavigationHandler} The key sequence navigation handler.
7573      */
7574     get keySequenceNavigation(): KeySequenceNavigationHandler;
7575     /**
7576      * Get spatial.
7577      *
7578      * @returns {KeySpatialNavigationHandler} The spatial handler.
7579      */
7580     get keySpatialNavigation(): KeySpatialNavigationHandler;
7581     /**
7582      * Get key zoom.
7583      *
7584      * @returns {KeyZoomHandler} The key zoom handler.
7585      */
7586     get keyZoom(): KeyZoomHandler;
7587     protected _activate(): void;
7588     protected _deactivate(): void;
7589     protected _getDefaultConfiguration(): KeyboardConfiguration;
7590 }
7591
7592 /**
7593  * @interface CircleMarkerOptions
7594  *
7595  * Interface that represents the options for configuring a `CircleMarker`.
7596  */
7597 interface CircleMarkerOptions {
7598     /**
7599      * The color of the marker.
7600      *
7601      * @default "#fff"
7602      */
7603     color?: number | string;
7604     /**
7605      * The opacity of the marker.
7606      *
7607      * @default 0.4
7608      */
7609     opacity?: number;
7610     /**
7611      * The radius of the circle in meters.
7612      *
7613      * @default 1
7614      */
7615     radius?: number;
7616 }
7617
7618 /**
7619  * @class CircleMarker
7620  *
7621  * @classdesc Non-interactive marker with a flat circle shape. The circle
7622  * marker can not be configured to be interactive.
7623  *
7624  * Circle marker properties can not be updated after creation.
7625  *
7626  * To create and add one `CircleMarker` with default configuration
7627  * and one with configuration use
7628  *
7629  * @example
7630  * ```js
7631  * var defaultMarker = new CircleMarker(
7632  *     "id-1",
7633  *     { lat: 0, lng: 0, });
7634  *
7635  * var configuredMarker = new CircleMarker(
7636  *     "id-2",
7637  *     { lat: 0, lng: 0, },
7638  *     {
7639  *         color: "#0ff",
7640  *         opacity: 0.3,
7641  *         radius: 0.7,
7642  *     });
7643  *
7644  * markerComponent.add([defaultMarker, configuredMarker]);
7645  * ```
7646  */
7647 declare class CircleMarker extends Marker {
7648     private _color;
7649     private _opacity;
7650     private _radius;
7651     constructor(id: string, lngLat: LngLat, options?: CircleMarkerOptions);
7652     protected _createGeometry(position: number[]): void;
7653     protected _disposeGeometry(): void;
7654     protected _getInteractiveObjects(): Object3D[];
7655 }
7656
7657 /**
7658  * @class MarkerComponent
7659  *
7660  * @classdesc Component for showing and editing 3D marker objects.
7661  *
7662  * The `add` method is used for adding new markers or replacing
7663  * markers already in the set.
7664  *
7665  * If a marker already in the set has the same
7666  * id as one of the markers added, the old marker will be removed and
7667  * the added marker will take its place.
7668  *
7669  * It is not possible to update markers in the set by updating any properties
7670  * directly on the marker object. Markers need to be replaced by
7671  * re-adding them for updates to geographic position or configuration
7672  * to be reflected.
7673  *
7674  * Markers added to the marker component can be either interactive
7675  * or non-interactive. Different marker types define their behavior.
7676  * Markers with interaction support can be configured with options
7677  * to respond to dragging inside the viewer and be detected when
7678  * retrieving markers from pixel points with the `getMarkerIdAt` method.
7679  *
7680  * To retrive and use the marker component
7681  *
7682  * @example
7683  * ```js
7684  * var viewer = new Viewer({ component: { marker: true }, ... });
7685  *
7686  * var markerComponent = viewer.getComponent("marker");
7687  * ```
7688  */
7689 declare class MarkerComponent extends Component<MarkerConfiguration> {
7690     static componentName: ComponentName;
7691     private _graphCalculator;
7692     private _markerScene;
7693     private _markerSet;
7694     private _viewportCoords;
7695     private _relativeGroundAltitude;
7696     /** @ignore */
7697     constructor(name: string, container: Container, navigator: Navigator);
7698     /**
7699      * Add markers to the marker set or replace markers in the marker set.
7700      *
7701      * @description If a marker already in the set has the same
7702      * id as one of the markers added, the old marker will be removed
7703      * the added marker will take its place.
7704      *
7705      * Any marker inside the visible bounding bbox
7706      * will be initialized and placed in the viewer.
7707      *
7708      * @param {Array<Marker>} markers - Markers to add.
7709      *
7710      * @example
7711      * ```js
7712      * markerComponent.add([marker1, marker2]);
7713      * ```
7714      */
7715     add(markers: Marker[]): void;
7716     fire(type: "markerdragend" | "markerdragstart" | "markerposition", event: ComponentMarkerEvent): void;
7717     /** @ignore */
7718     fire(type: ComponentEventType, event: ComponentEvent): void;
7719     /**
7720      * Returns the marker in the marker set with the specified id, or
7721      * undefined if the id matches no marker.
7722      *
7723      * @param {string} markerId - Id of the marker.
7724      *
7725      * @example
7726      * ```js
7727      * var marker = markerComponent.get("markerId");
7728      * ```
7729      *
7730      */
7731     get(markerId: string): Marker;
7732     /**
7733      * Returns an array of all markers.
7734      *
7735      * @example
7736      * ```js
7737      * var markers = markerComponent.getAll();
7738      * ```
7739      */
7740     getAll(): Marker[];
7741     /**
7742      * Returns the id of the interactive marker closest to the current camera
7743      * position at the specified point.
7744      *
7745      * @description Notice that the pixelPoint argument requires x, y
7746      * coordinates from pixel space.
7747      *
7748      * With this function, you can use the coordinates provided by mouse
7749      * events to get information out of the marker component.
7750      *
7751      * If no interactive geometry of an interactive marker exist at the pixel
7752      * point, `null` will be returned.
7753      *
7754      * @param {Array<number>} pixelPoint - Pixel coordinates on the viewer element.
7755      * @returns {string} Id of the interactive marker closest to the camera. If no
7756      * interactive marker exist at the pixel point, `null` will be returned.
7757      *
7758      * @example
7759      * ```js
7760      * markerComponent.getMarkerIdAt([100, 100])
7761      *     .then((markerId) => { console.log(markerId); });
7762      * ```
7763      */
7764     getMarkerIdAt(pixelPoint: number[]): Promise<string>;
7765     /**
7766      * Check if a marker exist in the marker set.
7767      *
7768      * @param {string} markerId - Id of the marker.
7769      *
7770      * @example
7771      * ```js
7772      * var markerExists = markerComponent.has("markerId");
7773      * ```
7774      */
7775     has(markerId: string): boolean;
7776     off(type: "markerdragend" | "markerdragstart" | "markerposition", handler: (event: ComponentMarkerEvent) => void): void;
7777     /** @ignore */
7778     off(type: ComponentEventType, handler: (event: ComponentEvent) => void): void;
7779     /**
7780      * Fired when a marker drag interaction ends.
7781      *
7782      * @event markerdragend
7783      * @example
7784      * ```js
7785      * // Initialize the viewer
7786      * var viewer = new Viewer({ // viewer options });
7787      * var component = viewer.getComponent('<component-name>');
7788      * // Set an event listener
7789      * component.on('markerdragend', function() {
7790      *   console.log("A markerdragend event has occurred.");
7791      * });
7792      * ```
7793      */
7794     on(type: "markerdragend", handler: (event: ComponentMarkerEvent) => void): void;
7795     /**
7796      * Fired when a marker drag interaction starts.
7797      *
7798      * @event markerdragstart
7799      * @example
7800      * ```js
7801      * // Initialize the viewer
7802      * var viewer = new Viewer({ // viewer options });
7803      * var component = viewer.getComponent('<component-name>');
7804      * // Set an event listener
7805      * component.on('markerdragstart', function() {
7806      *   console.log("A markerdragstart event has occurred.");
7807      * });
7808      * ```
7809      */
7810     on(type: "markerdragstart", handler: (event: ComponentMarkerEvent) => void): void;
7811     /**
7812      * Fired when the position of a marker is changed.
7813      *
7814      * @event markerposition
7815      * @example
7816      * ```js
7817      * // Initialize the viewer
7818      * var viewer = new Viewer({ // viewer options });
7819      * var component = viewer.getComponent('<component-name>');
7820      * // Set an event listener
7821      * component.on('markerposition', function() {
7822      *   console.log("A markerposition event has occurred.");
7823      * });
7824      * ```
7825      */
7826     on(type: "markerposition", handler: (event: ComponentMarkerEvent) => void): void;
7827     /**
7828      * Remove markers with the specified ids from the marker set.
7829      *
7830      * @param {Array<string>} markerIds - Ids for markers to remove.
7831      *
7832      * @example
7833      * ```js
7834      * markerComponent.remove(["id-1", "id-2"]);
7835      * ```
7836      */
7837     remove(markerIds: string[]): void;
7838     /**
7839      * Remove all markers from the marker set.
7840      *
7841      * @example
7842      * ```js
7843      * markerComponent.removeAll();
7844      * ```
7845      */
7846     removeAll(): void;
7847     protected _activate(): void;
7848     protected _deactivate(): void;
7849     protected _getDefaultConfiguration(): MarkerConfiguration;
7850 }
7851
7852 /**
7853  * @interface SimpleMarkerOptions
7854  *
7855  * Interface that represents the options for configuring a `SimpleMarker`.
7856  */
7857 interface SimpleMarkerOptions {
7858     /**
7859      * The color of the ball inside the marker.
7860      *
7861      * @default "#f00"
7862      */
7863     ballColor?: number | string;
7864     /**
7865      * The opacity of the ball inside the marker.
7866      *
7867      * @default 0.8
7868      */
7869     ballOpacity?: number;
7870     /**
7871      * The color of the ice creame shape.
7872      *
7873      * @default "#f00"
7874      */
7875     color?: number | string;
7876     /**
7877      * Value indicating if the marker should be interactive or not.
7878      *
7879      * @description If the marker is configured to be interactive
7880      * it will be draggable in the viewer and retrievable with the
7881      * `getMarkerIdAt` method on the `MarkerComponent`.
7882      *
7883      * @default false
7884      */
7885     interactive?: boolean;
7886     /**
7887      * The opacity of the ice creame shape.
7888      *
7889      * @default 0.4
7890      */
7891     opacity?: number;
7892     /**
7893      * The radius of the ice cream shape in meters.
7894      *
7895      * @default 1
7896      */
7897     radius?: number;
7898 }
7899
7900 /**
7901  * @class SimpleMarker
7902  *
7903  * @classdesc Interactive marker with ice cream shape. The sphere
7904  * inside the ice cream can be configured to be interactive.
7905  *
7906  * Simple marker properties can not be updated after creation.
7907  *
7908  * To create and add one `SimpleMarker` with default configuration
7909  * (non-interactive) and one interactive with configuration use
7910  *
7911  * @example
7912  * ```js
7913  * var defaultMarker = new SimpleMarker(
7914  *     "id-1",
7915  *     { lat: 0, lng: 0, });
7916  *
7917  * var interactiveMarker = new SimpleMarker(
7918  *     "id-2",
7919  *     { lat: 0, lng: 0, },
7920  *     {
7921  *         ballColor: "#00f",
7922  *         ballOpacity: 0.5,
7923  *         color: "#00f",
7924  *         interactive: true,
7925  *         opacity: 0.3,
7926  *         radius: 0.7,
7927  *     });
7928  *
7929  * markerComponent.add([defaultMarker, interactiveMarker]);
7930  * ```
7931  */
7932 declare class SimpleMarker extends Marker {
7933     private _ballColor;
7934     private _ballOpacity;
7935     private _circleToRayAngle;
7936     private _color;
7937     private _interactive;
7938     private _opacity;
7939     private _radius;
7940     constructor(id: string, lngLat: LngLat, options?: SimpleMarkerOptions);
7941     protected _createGeometry(position: number[]): void;
7942     protected _disposeGeometry(): void;
7943     protected _getInteractiveObjects(): Object3D[];
7944     private _markerHeight;
7945     private _createMarkerGeometry;
7946 }
7947
7948 /**
7949  * The `DragPanHandler` allows the user to pan the viewer image by clicking and dragging the cursor.
7950  *
7951  * @example
7952  * ```js
7953  * var pointerComponent = viewer.getComponent("pointer");
7954  *
7955  * pointerComponent.dragPan.disable();
7956  * pointerComponent.dragPan.enable();
7957  *
7958  * var isEnabled = pointerComponent.dragPan.isEnabled;
7959  * ```
7960  */
7961 declare class DragPanHandler extends HandlerBase<PointerConfiguration> {
7962     private _spatial;
7963     private _viewportCoords;
7964     private _activeMouseSubscription;
7965     private _activeTouchSubscription;
7966     private _preventDefaultSubscription;
7967     private _rotateSubscription;
7968     private _rotateWithoutInertiaSubscription;
7969     /** @ignore */
7970     constructor(component: Component<PointerConfiguration>, container: Container, navigator: Navigator, viewportCoords: ViewportCoords, spatial: Spatial);
7971     protected _enable(): void;
7972     protected _disable(): void;
7973     protected _getConfiguration(enable: boolean): PointerConfiguration;
7974     private _drainBuffer;
7975 }
7976
7977 declare class EarthControlHandler extends HandlerBase<PointerConfiguration> {
7978     private _viewportCoords;
7979     private _spatial;
7980     private _subscriptions;
7981     /** @ignore */
7982     constructor(component: Component<PointerConfiguration>, container: Container, navigator: Navigator, viewportCoords: ViewportCoords, spatial: Spatial);
7983     protected _enable(): void;
7984     protected _disable(): void;
7985     protected _getConfiguration(): PointerConfiguration;
7986     private _eventToViewport;
7987     private _mousePairToRotation;
7988     private _planeIntersection;
7989 }
7990
7991 /**
7992  * The `ScrollZoomHandler` allows the user to zoom the viewer image by scrolling.
7993  *
7994  * @example
7995  * ```js
7996  * var pointerComponent = viewer.getComponent("pointer");
7997  *
7998  * pointerComponent.scrollZoom.disable();
7999  * pointerComponent.scrollZoom.enable();
8000  *
8001  * var isEnabled = pointerComponent.scrollZoom.isEnabled;
8002  * ```
8003  */
8004 declare class ScrollZoomHandler extends HandlerBase<PointerConfiguration> {
8005     private _viewportCoords;
8006     private _preventDefaultSubscription;
8007     private _zoomSubscription;
8008     /** @ignore */
8009     constructor(component: Component<PointerConfiguration>, container: Container, navigator: Navigator, viewportCoords: ViewportCoords);
8010     protected _enable(): void;
8011     protected _disable(): void;
8012     protected _getConfiguration(enable: boolean): PointerConfiguration;
8013 }
8014
8015 /**
8016  * The `TouchZoomHandler` allows the user to zoom the viewer image by pinching on a touchscreen.
8017  *
8018  * @example
8019  * ```js
8020  * var pointerComponent = viewer.getComponent("pointer");
8021  *
8022  * pointerComponent.touchZoom.disable();
8023  * pointerComponent.touchZoom.enable();
8024  *
8025  * var isEnabled = pointerComponent.touchZoom.isEnabled;
8026  * ```
8027  */
8028 declare class TouchZoomHandler extends HandlerBase<PointerConfiguration> {
8029     private _viewportCoords;
8030     private _activeSubscription;
8031     private _preventDefaultSubscription;
8032     private _zoomSubscription;
8033     /** @ignore */
8034     constructor(component: Component<PointerConfiguration>, container: Container, navigator: Navigator, viewportCoords: ViewportCoords);
8035     protected _enable(): void;
8036     protected _disable(): void;
8037     protected _getConfiguration(enable: boolean): PointerConfiguration;
8038 }
8039
8040 /**
8041  * @class PointerComponent
8042  *
8043  * @classdesc Component handling mouse, pen, and touch events for camera movement.
8044  *
8045  * To retrive and use the mouse component
8046  *
8047  * @example
8048  * ```js
8049  * var viewer = new Viewer({ ... });
8050  *
8051  * var pointerComponent = viewer.getComponent("pointer");
8052  * ```
8053  */
8054 declare class PointerComponent extends Component<PointerConfiguration> {
8055     /** @inheritdoc */
8056     static componentName: ComponentName;
8057     private _bounceHandler;
8058     private _dragPanHandler;
8059     private _earthControlHandler;
8060     private _scrollZoomHandler;
8061     private _touchZoomHandler;
8062     /** @ignore */
8063     constructor(name: string, container: Container, navigator: Navigator);
8064     /**
8065      * Get drag pan.
8066      *
8067      * @returns {DragPanHandler} The drag pan handler.
8068      */
8069     get dragPan(): DragPanHandler;
8070     /**
8071      * Get earth control.
8072      *
8073      * @returns {EarthControlHandler} The earth control handler.
8074      */
8075     get earthControl(): EarthControlHandler;
8076     /**
8077      * Get scroll zoom.
8078      *
8079      * @returns {ScrollZoomHandler} The scroll zoom handler.
8080      */
8081     get scrollZoom(): ScrollZoomHandler;
8082     /**
8083      * Get touch zoom.
8084      *
8085      * @returns {TouchZoomHandler} The touch zoom handler.
8086      */
8087     get touchZoom(): TouchZoomHandler;
8088     protected _activate(): void;
8089     protected _deactivate(): void;
8090     protected _getDefaultConfiguration(): PointerConfiguration;
8091 }
8092
8093 /**
8094  * Interface for the popup offset with respect to its anchor point.
8095  *
8096  * @description An object of number arrays specifing an offset for
8097  * each float direction. Negative offsets indicate left and up.
8098  *
8099  * @interface
8100  *
8101  * @example
8102  * ```js
8103  * var offset = = {
8104  *     bottom: [0, 10],
8105  *     bottomLeft: [-10, 10],
8106  *     bottomRight: [10, 10],
8107  *     center: [0, 0],
8108  *     left: [-10, 0],
8109  *     right: [10, 0],
8110  *     top: [0, -10],
8111  *     topLeft: [-10, -10],
8112  *     topRight: [10, -10],
8113  * }
8114  *
8115  * var popup = new Popup({ offset: offset });
8116  * ```
8117  */
8118 interface PopupOffset {
8119     bottom: number[];
8120     bottomLeft: number[];
8121     bottomRight: number[];
8122     center: number[];
8123     left: number[];
8124     right: number[];
8125     top: number[];
8126     topLeft: number[];
8127     topRight: number[];
8128 }
8129
8130 /**
8131  * Interface for the options that define behavior and
8132  * appearance of a popup.
8133  *
8134  * @interface
8135  */
8136 interface PopupOptions {
8137     /**
8138      * Specify if the popup should capture pointer events.
8139      *
8140      * @description If the popup is specified to not capture
8141      * pointer events the provided content can still override
8142      * this behavior for the individual content HTML elements
8143      * by specifying the appropriate CSS.
8144      *
8145      * @default true
8146      */
8147     capturePointer?: boolean;
8148     /**
8149      * Specify that the popup should not have any tooltip
8150      * like visuals around the provided content.
8151      *
8152      * @default false
8153      */
8154     clean?: boolean;
8155     /**
8156      * The direction in which the popup floats with respect to the
8157      * anchor point or points. If no value is supplied the popup
8158      * will change float automatically based on the its position
8159      * in the viewport so that as much of its area as possible is
8160      * visible.
8161      *
8162      * @description For automatic floating (undefined) the popup
8163      * will float in eight directions around a point or a position
8164      * in a rect. When a rectangle is set without a position option
8165      * specified, the popup will float outward from the rectangle
8166      * center based on the side it is currently rendered in. The
8167      * default floating direction is to the bottom for both points
8168      * and rectangles.
8169      *
8170      * @default undefined
8171      */
8172     float?: Alignment;
8173     /**
8174      * A pixel offset applied to the popup's location specfied as:
8175      *
8176      * - A single number in pixels in the float direction that the popup
8177      * will be translated with respect to the current anchor point.
8178      *
8179      * - An object of number arrays specifing an offset for
8180      * each float direction. Negative offsets indicate left and up.
8181      *
8182      * @default 0
8183      */
8184     offset?: number | PopupOffset;
8185     /**
8186      * Opacity of the popup visuals.
8187      *
8188      * @default 1
8189      */
8190     opacity?: number;
8191     /**
8192      * The popup position in a rectangle (does not apply to points).
8193      * When not set the popup will change position automatically
8194      * based on the viewport so that as much of it as possible is
8195      * visible.
8196      *
8197      * @default undefined
8198      */
8199     position?: Alignment;
8200 }
8201
8202 /**
8203  * @class Popup
8204  *
8205  * @classdesc Popup instance for rendering custom HTML content
8206  * on top of images. Popups are based on 2D basic image coordinates
8207  * (see the {@link Viewer} class documentation for more information about coordinate
8208  * systems) and a certain popup is therefore only relevant to a single image.
8209  * Popups related to a certain image should be removed when moving
8210  * to another image.
8211  *
8212  * A popup must have both its content and its point or rect set to be
8213  * rendered. Popup options can not be updated after creation but the
8214  * basic point or rect as well as its content can be changed by calling
8215  * the appropriate methods.
8216  *
8217  * To create and add one `Popup` with default configuration
8218  * (tooltip visuals and automatic float) and one with specific options
8219  * use
8220  *
8221  * @example
8222  * ```js
8223  * var defaultSpan = document.createElement('span');
8224  * defaultSpan.innerHTML = 'hello default';
8225  *
8226  * var defaultPopup = new Popup();
8227  * defaultPopup.setDOMContent(defaultSpan);
8228  * defaultPopup.setBasicPoint([0.3, 0.3]);
8229  *
8230  * var cleanSpan = document.createElement('span');
8231  * cleanSpan.innerHTML = 'hello clean';
8232  *
8233  * var cleanPopup = new Popup({
8234  *     clean: true,
8235  *     float: Alignment.Top,
8236  *     offset: 10,
8237  *     opacity: 0.7,
8238  * });
8239  *
8240  * cleanPopup.setDOMContent(cleanSpan);
8241  * cleanPopup.setBasicPoint([0.6, 0.6]);
8242  *
8243  * popupComponent.add([defaultPopup, cleanPopup]);
8244  * ```
8245  *
8246  * @description Implementation of API methods and API documentation inspired
8247  * by/used from https://github.com/mapbox/mapbox-gl-js/blob/v0.38.0/src/ui/popup.js
8248  */
8249 declare class Popup {
8250     protected _notifyChanged$: Subject<Popup>;
8251     private _container;
8252     private _content;
8253     private _parentContainer;
8254     private _options;
8255     private _tip;
8256     private _point;
8257     private _rect;
8258     private _dom;
8259     private _viewportCoords;
8260     constructor(options?: PopupOptions, viewportCoords?: ViewportCoords, dom?: DOM);
8261     /**
8262      * @description Internal observable used by the component to
8263      * render the popup when its position or content has changed.
8264      * @ignore
8265      */
8266     get changed$(): Observable<Popup>;
8267     /**
8268      * @description Internal method used by the component to
8269      * remove all references to the popup.
8270      * @ignore
8271      */
8272     remove(): void;
8273     /**
8274      * Sets a 2D basic image coordinates point to the popup's anchor, and
8275      * moves the popup to it.
8276      *
8277      * @description Overwrites any previously set point or rect.
8278      *
8279      * @param {Array<number>} basicPoint - Point in 2D basic image coordinates.
8280      *
8281      * @example
8282      * ```js
8283      * var popup = new Popup();
8284      * popup.setText('hello image');
8285      * popup.setBasicPoint([0.3, 0.3]);
8286      *
8287      * popupComponent.add([popup]);
8288      * ```
8289      */
8290     setBasicPoint(basicPoint: number[]): void;
8291     /**
8292      * Sets a 2D basic image coordinates rect to the popup's anchor, and
8293      * moves the popup to it.
8294      *
8295      * @description Overwrites any previously set point or rect.
8296      *
8297      * @param {Array<number>} basicRect - Rect in 2D basic image
8298      * coordinates ([topLeftX, topLeftY, bottomRightX, bottomRightY]) .
8299      *
8300      * @example
8301      * ```js
8302      * var popup = new Popup();
8303      * popup.setText('hello image');
8304      * popup.setBasicRect([0.3, 0.3, 0.5, 0.6]);
8305      *
8306      * popupComponent.add([popup]);
8307      * ```
8308      */
8309     setBasicRect(basicRect: number[]): void;
8310     /**
8311      * Sets the popup's content to the element provided as a DOM node.
8312      *
8313      * @param {Node} htmlNode - A DOM node to be used as content for the popup.
8314      *
8315      * @example
8316      * ```js
8317      * var div = document.createElement('div');
8318      * div.innerHTML = 'hello image';
8319      *
8320      * var popup = new Popup();
8321      * popup.setDOMContent(div);
8322      * popup.setBasicPoint([0.3, 0.3]);
8323      *
8324      * popupComponent.add([popup]);
8325      * ```
8326      */
8327     setDOMContent(htmlNode: Node): void;
8328     /**
8329      * Sets the popup's content to the HTML provided as a string.
8330      *
8331      * @description This method does not perform HTML filtering or sanitization,
8332      * and must be used only with trusted content. Consider
8333      * {@link Popup.setText} if the
8334      * content is an untrusted text string.
8335      *
8336      * @param {string} html - A string representing HTML content for the popup.
8337      *
8338      * @example
8339      * ```js
8340      * var popup = new Popup();
8341      * popup.setHTML('<div>hello image</div>');
8342      * popup.setBasicPoint([0.3, 0.3]);
8343      *
8344      * popupComponent.add([popup]);
8345      * ```
8346      */
8347     setHTML(html: string): void;
8348     /**
8349      * Sets the popup's content to a string of text.
8350      *
8351      * @description This function creates a Text node in the DOM, so it cannot insert raw HTML.
8352      * Use this method for security against XSS if the popup content is user-provided.
8353      *
8354      * @param {string} text - Textual content for the popup.
8355      *
8356      * @example
8357      * ```js
8358      * var popup = new Popup();
8359      * popup.setText('hello image');
8360      * popup.setBasicPoint([0.3, 0.3]);
8361      *
8362      * popupComponent.add([popup]);
8363      * ```
8364      */
8365     setText(text: string): void;
8366     /**
8367      * @description Internal method for attaching the popup to
8368      * its parent container so that it is rendered in the DOM tree.
8369      * @ignore
8370      */
8371     setParentContainer(parentContainer: HTMLElement): void;
8372     /**
8373      * @description Internal method for updating the rendered
8374      * position of the popup called by the popup component.
8375      * @ignore
8376      */
8377     update(renderCamera: RenderCamera, size: ViewportSize, transform: Transform): void;
8378     private _rectToPixel;
8379     private _alignmentToPopupAligment;
8380     private _normalizeOffset;
8381     private _pixelToFloats;
8382     private _pointFromRectPosition;
8383 }
8384
8385 /**
8386  * @class PopupComponent
8387  *
8388  * @classdesc Component for showing HTML popup objects.
8389  *
8390  * The `add` method is used for adding new popups. Popups are removed by reference.
8391  *
8392  * It is not possible to update popups in the set by updating any properties
8393  * directly on the popup object. Popups need to be replaced by
8394  * removing them and creating new ones with relevant changed properties and
8395  * adding those instead.
8396  *
8397  * Popups are only relevant to a single image because they are based on
8398  * 2D basic image coordinates. Popups related to a certain image should
8399  * be removed when the viewer is moved to another image.
8400  *
8401  * To retrive and use the popup component
8402  *
8403  * @example
8404  * ```js
8405  * var viewer = new Viewer({ component: { popup: true }, ... });
8406  *
8407  * var popupComponent = viewer.getComponent("popup");
8408  * ```
8409  */
8410 declare class PopupComponent extends Component<ComponentConfiguration> {
8411     static componentName: ComponentName;
8412     private _dom;
8413     private _popupContainer;
8414     private _popups;
8415     private _added$;
8416     private _popups$;
8417     /** @ignore */
8418     constructor(name: string, container: Container, navigator: Navigator, dom?: DOM);
8419     /**
8420      * Add popups to the popups set.
8421      *
8422      * @description Adding a new popup never replaces an old one
8423      * because they are stored by reference. Adding an already
8424      * existing popup has no effect.
8425      *
8426      * @param {Array<Popup>} popups - Popups to add.
8427      *
8428      * @example
8429      * ```js
8430      * popupComponent.add([popup1, popup2]);
8431      * ```
8432      */
8433     add(popups: Popup[]): void;
8434     /**
8435      * Returns an array of all popups.
8436      *
8437      * @example
8438      * ```js
8439      * var popups = popupComponent.getAll();
8440      * ```
8441      */
8442     getAll(): Popup[];
8443     /**
8444      * Remove popups based on reference from the popup set.
8445      *
8446      * @param {Array<Popup>} popups - Popups to remove.
8447      *
8448      * @example
8449      * ```js
8450      * popupComponent.remove([popup1, popup2]);
8451      * ```
8452      */
8453     remove(popups: Popup[]): void;
8454     /**
8455      * Remove all popups from the popup set.
8456      *
8457      * @example
8458      * ```js
8459      * popupComponent.removeAll();
8460      * ```
8461      */
8462     removeAll(): void;
8463     protected _activate(): void;
8464     protected _deactivate(): void;
8465     protected _getDefaultConfiguration(): ComponentConfiguration;
8466     private _remove;
8467 }
8468
8469 declare class SequenceDOMRenderer {
8470     private _container;
8471     private _minThresholdWidth;
8472     private _maxThresholdWidth;
8473     private _minThresholdHeight;
8474     private _maxThresholdHeight;
8475     private _stepperDefaultWidth;
8476     private _controlsDefaultWidth;
8477     private _defaultHeight;
8478     private _expandControls;
8479     private _mode;
8480     private _speed;
8481     private _changingSpeed;
8482     private _index;
8483     private _changingPosition;
8484     private _mouseEnterDirection$;
8485     private _mouseLeaveDirection$;
8486     private _notifyChanged$;
8487     private _notifyChangingPositionChanged$;
8488     private _notifySpeedChanged$;
8489     private _notifyIndexChanged$;
8490     private _changingSubscription;
8491     constructor(container: Container);
8492     get changed$(): Observable<SequenceDOMRenderer>;
8493     get changingPositionChanged$(): Observable<boolean>;
8494     get speed$(): Observable<number>;
8495     get index$(): Observable<number>;
8496     get mouseEnterDirection$(): Observable<NavigationDirection>;
8497     get mouseLeaveDirection$(): Observable<NavigationDirection>;
8498     activate(): void;
8499     deactivate(): void;
8500     render(edgeStatus: NavigationEdgeStatus, configuration: SequenceConfiguration, containerWidth: number, speed: number, index: number, max: number, playEnabled: boolean, component: SequenceComponent, navigator: Navigator): VNode;
8501     getContainerWidth(size: ViewportSize, configuration: SequenceConfiguration): number;
8502     private _createPositionInput;
8503     private _createSpeedInput;
8504     private _createPlaybackControls;
8505     private _createPlayingButton;
8506     private _createSequenceControls;
8507     private _createSequenceArrows;
8508     private _createStepper;
8509     private _createTimelineControls;
8510     private _getStepClassName;
8511     private _setChangingPosition;
8512 }
8513
8514 /**
8515  * @class SequenceComponent
8516  * @classdesc Component showing navigation arrows for sequence directions
8517  * as well as playing button. Exposes an API to start and stop play.
8518  */
8519 declare class SequenceComponent extends Component<SequenceConfiguration> {
8520     /** @inheritdoc */
8521     static componentName: ComponentName;
8522     private _sequenceDOMRenderer;
8523     private _scheduler;
8524     private _hoveredIdSubject$;
8525     private _hoveredId$;
8526     private _containerWidth$;
8527     constructor(name: string, container: Container, navigator: Navigator, renderer?: SequenceDOMRenderer, scheduler?: Scheduler);
8528     fire(type: "hover", event: ComponentHoverEvent): void;
8529     fire(type: "playing", event: ComponentPlayEvent): void;
8530     off(type: "hover", handler: (event: ComponentHoverEvent) => void): void;
8531     off(type: "playing", handler: (event: ComponentPlayEvent) => void): void;
8532     /**
8533      * Fired when the hovered element of a component changes.
8534      *
8535      * @event hover
8536      * @example
8537      * ```js
8538      * // Initialize the viewer
8539      * var viewer = new Viewer({ // viewer options });
8540      * var component = viewer.getComponent('<component-name>');
8541      * // Set an event listener
8542      * component.on('hover', function() {
8543      *   console.log("A hover event has occurred.");
8544      * });
8545      * ```
8546      */
8547     on(type: "hover", handler: (event: ComponentHoverEvent) => void): void;
8548     /**
8549      * Event fired when playing starts or stops.
8550      *
8551      * @event playing
8552      * @example
8553      * ```js
8554      * // Initialize the viewer
8555      * var viewer = new Viewer({ // viewer options });
8556      * var component = viewer.getComponent('<component-name>');
8557      * // Set an event listener
8558      * component.on('playing', function() {
8559      *   console.log("A playing event has occurred.");
8560      * });
8561      * ```
8562      */
8563     on(type: "playing", handler: (event: ComponentPlayEvent) => void): void;
8564     /**
8565      * Start playing.
8566      *
8567      * @fires playing
8568      */
8569     play(): void;
8570     /**
8571      * Stop playing.
8572      *
8573      * @fires playing
8574      */
8575     stop(): void;
8576     protected _activate(): void;
8577     protected _deactivate(): void;
8578     protected _getDefaultConfiguration(): SequenceConfiguration;
8579 }
8580
8581 /**
8582  * @class SliderComponent
8583  *
8584  * @classdesc Component for comparing pairs of images. Renders
8585  * a slider for adjusting the curtain of the first image.
8586  *
8587  * Deactivate the sequence, direction and image plane
8588  * components when activating the slider component to avoid
8589  * interfering UI elements.
8590  *
8591  * To retrive and use the slider component
8592  *
8593  * @example
8594  * ```js
8595  * var viewer = new Viewer({ ... });
8596  *
8597  * viewer.deactivateComponent("image");
8598  * viewer.deactivateComponent("direction");
8599  * viewer.deactivateComponent("sequence");
8600  *
8601  * viewer.activateComponent("slider");
8602  *
8603  * var sliderComponent = viewer.getComponent("slider");
8604  * ```
8605  */
8606 declare class SliderComponent extends Component<SliderConfiguration> {
8607     static componentName: ComponentName;
8608     private _viewportCoords;
8609     private _domRenderer;
8610     private _imageTileLoader;
8611     private _roiCalculator;
8612     private _spatial;
8613     private _glRendererOperation$;
8614     private _glRenderer$;
8615     private _glRendererCreator$;
8616     private _glRendererDisposer$;
8617     private _waitSubscription;
8618     /** @ignore */
8619     constructor(name: string, container: Container, navigator: Navigator, viewportCoords?: ViewportCoords);
8620     protected _activate(): void;
8621     protected _deactivate(): void;
8622     protected _getDefaultConfiguration(): SliderConfiguration;
8623     private _catchCacheImage$;
8624     private _getBasicCorners;
8625     private _clipBoundingBox;
8626 }
8627
8628 declare class SpatialComponent extends Component<SpatialConfiguration> {
8629     static componentName: ComponentName;
8630     private _cache;
8631     private _scene;
8632     private _viewportCoords;
8633     private _spatial;
8634     /** @ignore */
8635     constructor(name: string, container: Container, navigator: Navigator);
8636     /**
8637      * Returns the image id of the camera frame closest to the current
8638      * render camera position at the specified point.
8639      *
8640      * @description Notice that the pixelPoint argument requires x, y
8641      * coordinates from pixel space.
8642      *
8643      * With this function, you can use the coordinates provided by mouse
8644      * events to get information out of the spatial component.
8645      *
8646      * If no camera frame exist at the pixel
8647      * point, `null` will be returned.
8648      *
8649      * @param {Array<number>} pixelPoint - Pixel coordinates on
8650      * the viewer element.
8651      * @returns {string} Image id of the camera frame closest to
8652      * the camera. If no camera frame is intersected at the
8653      * pixel point, `null` will be returned.
8654      *
8655      * @example
8656      * ```js
8657      * spatialComponent.getFrameIdAt([100, 125])
8658      *     .then((imageId) => { console.log(imageId); });
8659      * ```
8660      */
8661     getFrameIdAt(pixelPoint: number[]): Promise<string>;
8662     protected _activate(): void;
8663     protected _deactivate(): void;
8664     protected _getDefaultConfiguration(): SpatialConfiguration;
8665     private _addSceneImages;
8666     private _cellsInFov;
8667     private _computeOriginalPosition;
8668     private _cellToTopocentric;
8669     private _computeTranslation;
8670     private _createTransform;
8671 }
8672
8673 declare class GeometryTagError extends MapillaryError {
8674     constructor(message?: string);
8675 }
8676
8677 /**
8678  * @class PointGeometry
8679  *
8680  * @classdesc Represents a point geometry in the 2D basic image coordinate system.
8681  *
8682  * @example
8683  * ```js
8684  * var basicPoint = [0.5, 0.7];
8685  * var pointGeometry = new PointGeometry(basicPoint);
8686  * ```
8687  */
8688 declare class PointGeometry extends Geometry {
8689     private _point;
8690     /**
8691      * Create a point geometry.
8692      *
8693      * @constructor
8694      * @param {Array<number>} point - An array representing the basic coordinates of
8695      * the point.
8696      *
8697      * @throws {GeometryTagError} Point coordinates must be valid basic coordinates.
8698      */
8699     constructor(point: number[]);
8700     /**
8701      * Get point property.
8702      * @returns {Array<number>} Array representing the basic coordinates of the point.
8703      */
8704     get point(): number[];
8705     /**
8706      * Get the 2D basic coordinates for the centroid of the point, i.e. the 2D
8707      * basic coordinates of the point itself.
8708      *
8709      * @returns {Array<number>} 2D basic coordinates representing the centroid.
8710      * @ignore
8711      */
8712     getCentroid2d(): number[];
8713     /**
8714      * Get the 3D world coordinates for the centroid of the point, i.e. the 3D
8715      * world coordinates of the point itself.
8716      *
8717      * @param {Transform} transform - The transform of the image related to the point.
8718      * @returns {Array<number>} 3D world coordinates representing the centroid.
8719      * @ignore
8720      */
8721     getCentroid3d(transform: Transform): number[];
8722     /**
8723      * Set the centroid of the point, i.e. the point coordinates.
8724      *
8725      * @param {Array<number>} value - The new value of the centroid.
8726      * @param {Transform} transform - The transform of the image related to the point.
8727      * @ignore
8728      */
8729     setCentroid2d(value: number[], transform: Transform): void;
8730 }
8731
8732 /**
8733  * @class PointsGeometry
8734  *
8735  * @classdesc Represents a point set in the 2D basic image coordinate system.
8736  *
8737  * @example
8738  * ```js
8739  * var points = [[0.5, 0.3], [0.7, 0.3], [0.6, 0.5]];
8740  * var pointsGeometry = new PointsGeometry(points);
8741  * ```
8742  */
8743 declare class PointsGeometry extends Geometry {
8744     private _points;
8745     /**
8746      * Create a points geometry.
8747      *
8748      * @constructor
8749      * @param {Array<Array<number>>} points - Array of 2D points on the basic coordinate
8750      * system. The number of points must be greater than or equal to two.
8751      *
8752      * @throws {GeometryTagError} Point coordinates must be valid basic coordinates.
8753      */
8754     constructor(points: number[][]);
8755     /**
8756      * Get points property.
8757      * @returns {Array<Array<number>>} Array of 2d points.
8758      */
8759     get points(): number[][];
8760     /**
8761      * Add a point to the point set.
8762      *
8763      * @param {Array<number>} point - Point to add.
8764      * @ignore
8765      */
8766     addPoint2d(point: number[]): void;
8767     /**
8768      * Get the coordinates of a point from the point set representation of the geometry.
8769      *
8770      * @param {number} index - Point index.
8771      * @returns {Array<number>} Array representing the 2D basic coordinates of the point.
8772      * @ignore
8773      */
8774     getPoint2d(index: number): number[];
8775     /**
8776      * Remove a point from the point set.
8777      *
8778      * @param {number} index - The index of the point to remove.
8779      * @ignore
8780      */
8781     removePoint2d(index: number): void;
8782     /** @ignore */
8783     setVertex2d(index: number, value: number[], transform: Transform): void;
8784     /** @ignore */
8785     setPoint2d(index: number, value: number[], transform: Transform): void;
8786     /** @ignore */
8787     getPoints3d(transform: Transform): number[][];
8788     /** @ignore */
8789     getPoint3d(index: number, transform: Transform): number[];
8790     /** @ignore */
8791     getPoints2d(): number[][];
8792     /** @ignore */
8793     getCentroid2d(transform?: Transform): number[];
8794     /** @ignore */
8795     getCentroid3d(transform: Transform): number[];
8796     /** @ignore */
8797     getRect2d(transform: Transform): number[];
8798     /** @ignore */
8799     setCentroid2d(value: number[], transform: Transform): void;
8800     private _getPoints3d;
8801 }
8802
8803 /**
8804  * @class VertexGeometry
8805  * @abstract
8806  * @classdesc Represents a vertex geometry.
8807  */
8808 declare abstract class VertexGeometry extends Geometry {
8809     private _subsampleThreshold;
8810     /**
8811      * Create a vertex geometry.
8812      *
8813      * @constructor
8814      * @ignore
8815      */
8816     constructor();
8817     /**
8818      * Get the 3D coordinates for the vertices of the geometry with possibly
8819      * subsampled points along the lines.
8820      *
8821      * @param {Transform} transform - The transform of the image related to
8822      * the geometry.
8823      * @returns {Array<Array<number>>} Polygon array of 3D world coordinates
8824      * representing the geometry.
8825      * @ignore
8826      */
8827     abstract getPoints3d(transform: Transform): number[][];
8828     /**
8829      * Get the polygon pole of inaccessibility, the most
8830      * distant internal point from the polygon outline.
8831      *
8832      * @returns {Array<number>} 2D basic coordinates for the pole of inaccessibility.
8833      * @ignore
8834      */
8835     abstract getPoleOfInaccessibility2d(): number[];
8836     /**
8837      * Get the polygon pole of inaccessibility, the most
8838      * distant internal point from the polygon outline.
8839      *
8840      * @param transform - The transform of the image related to
8841      * the geometry.
8842      * @returns {Array<number>} 3D world coordinates for the pole of inaccessibility.
8843      * @ignore
8844      */
8845     abstract getPoleOfInaccessibility3d(transform: Transform): number[];
8846     /**
8847      * Get the coordinates of a vertex from the polygon representation of the geometry.
8848      *
8849      * @param {number} index - Vertex index.
8850      * @returns {Array<number>} Array representing the 2D basic coordinates of the vertex.
8851      * @ignore
8852      */
8853     abstract getVertex2d(index: number): number[];
8854     /**
8855      * Get a vertex from the polygon representation of the 3D coordinates for the
8856      * vertices of the geometry.
8857      *
8858      * @param {number} index - Vertex index.
8859      * @param {Transform} transform - The transform of the image related to the geometry.
8860      * @returns {Array<number>} Array representing the 3D world coordinates of the vertex.
8861      * @ignore
8862      */
8863     abstract getVertex3d(index: number, transform: Transform): number[];
8864     /**
8865      * Get a polygon representation of the 2D basic coordinates for the vertices of the geometry.
8866      *
8867      * @returns {Array<Array<number>>} Polygon array of 2D basic coordinates representing
8868      * the vertices of the geometry.
8869      * @ignore
8870      */
8871     abstract getVertices2d(): number[][];
8872     /**
8873      * Get a polygon representation of the 3D world coordinates for the vertices of the geometry.
8874      *
8875      * @param {Transform} transform - The transform of the image related to the geometry.
8876      * @returns {Array<Array<number>>} Polygon array of 3D world coordinates representing
8877      * the vertices of the geometry.
8878      * @ignore
8879      */
8880     abstract getVertices3d(transform: Transform): number[][];
8881     /**
8882      * Get a flattend array of the 3D world coordinates for the
8883      * triangles filling the geometry.
8884      *
8885      * @param {Transform} transform - The transform of the image related to the geometry.
8886      * @returns {Array<number>} Flattened array of 3D world coordinates of the triangles.
8887      * @ignore
8888      */
8889     abstract getTriangles3d(transform: Transform): number[];
8890     /**
8891      * Set the value of a vertex in the polygon representation of the geometry.
8892      *
8893      * @description The polygon is defined to have the first vertex at the
8894      * bottom-left corner with the rest of the vertices following in clockwise order.
8895      *
8896      * @param {number} index - The index of the vertex to be set.
8897      * @param {Array<number>} value - The new value of the vertex.
8898      * @param {Transform} transform - The transform of the image related to the geometry.
8899      * @ignore
8900      */
8901     abstract setVertex2d(index: number, value: number[], transform: Transform): void;
8902     /**
8903      * Finds the polygon pole of inaccessibility, the most distant internal
8904      * point from the polygon outline.
8905      *
8906      * @param {Array<Array<number>>} points2d - 2d points of outline to triangulate.
8907      * @returns {Array<number>} Point of inaccessibility.
8908      * @ignore
8909      */
8910     protected _getPoleOfInaccessibility2d(points2d: number[][]): number[];
8911     protected _project(points2d: number[][], transform: Transform): number[][];
8912     protected _subsample(points2d: number[][], threshold?: number): number[][];
8913     /**
8914      * Triangulates a 2d polygon and returns the triangle
8915      * representation as a flattened array of 3d points.
8916      *
8917      * @param {Array<Array<number>>} points2d - 2d points of outline to triangulate.
8918      * @param {Array<Array<number>>} points3d - 3d points of outline corresponding to the 2d points.
8919      * @param {Array<Array<Array<number>>>} [holes2d] - 2d points of holes to triangulate.
8920      * @param {Array<Array<Array<number>>>} [holes3d] - 3d points of holes corresponding to the 2d points.
8921      * @returns {Array<number>} Flattened array of 3d points ordered based on the triangles.
8922      * @ignore
8923      */
8924     protected _triangulate(points2d: number[][], points3d: number[][], holes2d?: number[][][], holes3d?: number[][][]): number[];
8925     protected _triangulateSpherical(points2d: number[][], holes2d: number[][][], transform: Transform): number[];
8926     protected _unproject(points2d: number[][], transform: Transform, distance?: number): number[][];
8927     private _createCamera;
8928     private _deunproject;
8929     private _triangulateSubarea;
8930 }
8931
8932 /**
8933  * @class PolygonGeometry
8934  *
8935  * @classdesc Represents a polygon geometry in the 2D basic image coordinate system.
8936  * All polygons and holes provided to the constructor needs to be closed.
8937  *
8938  * @example
8939  * ```js
8940  * var basicPolygon = [[0.5, 0.3], [0.7, 0.3], [0.6, 0.5], [0.5, 0.3]];
8941  * var polygonGeometry = new PolygonGeometry(basicPolygon);
8942  * ```
8943  */
8944 declare class PolygonGeometry extends VertexGeometry {
8945     private _polygon;
8946     private _holes;
8947     /**
8948      * Create a polygon geometry.
8949      *
8950      * @constructor
8951      * @param {Array<Array<number>>} polygon - Array of polygon vertices. Must be closed.
8952      * @param {Array<Array<Array<number>>>} [holes] - Array of arrays of hole vertices.
8953      * Each array of holes vertices must be closed.
8954      *
8955      * @throws {GeometryTagError} Polygon coordinates must be valid basic coordinates.
8956      */
8957     constructor(polygon: number[][], holes?: number[][][]);
8958     /**
8959      * Get polygon property.
8960      * @returns {Array<Array<number>>} Closed 2d polygon.
8961      */
8962     get polygon(): number[][];
8963     /**
8964      * Get holes property.
8965      * @returns {Array<Array<Array<number>>>} Holes of 2d polygon.
8966      */
8967     get holes(): number[][][];
8968     /**
8969      * Add a vertex to the polygon by appending it after the last vertex.
8970      *
8971      * @param {Array<number>} vertex - Vertex to add.
8972      * @ignore
8973      */
8974     addVertex2d(vertex: number[]): void;
8975     /**
8976      * Get the coordinates of a vertex from the polygon representation of the geometry.
8977      *
8978      * @param {number} index - Vertex index.
8979      * @returns {Array<number>} Array representing the 2D basic coordinates of the vertex.
8980      * @ignore
8981      */
8982     getVertex2d(index: number): number[];
8983     /**
8984      * Remove a vertex from the polygon.
8985      *
8986      * @param {number} index - The index of the vertex to remove.
8987      * @ignore
8988      */
8989     removeVertex2d(index: number): void;
8990     /** @ignore */
8991     setVertex2d(index: number, value: number[], transform: Transform): void;
8992     /** @ignore */
8993     setCentroid2d(value: number[], transform: Transform): void;
8994     /** @ignore */
8995     getPoints3d(transform: Transform): number[][];
8996     /** @ignore */
8997     getVertex3d(index: number, transform: Transform): number[];
8998     /** @ignore */
8999     getVertices2d(): number[][];
9000     /** @ignore */
9001     getVertices3d(transform: Transform): number[][];
9002     /**
9003      * Get a polygon representation of the 3D coordinates for the vertices of each hole
9004      * of the geometry. Line segments between vertices will possibly be subsampled
9005      * resulting in a larger number of points than the total number of vertices.
9006      *
9007      * @param {Transform} transform - The transform of the image related to the geometry.
9008      * @returns {Array<Array<Array<number>>>} Array of hole polygons in 3D world coordinates
9009      * representing the vertices of each hole of the geometry.
9010      * @ignore
9011      */
9012     getHolePoints3d(transform: Transform): number[][][];
9013     /**
9014      * Get a polygon representation of the 3D coordinates for the vertices of each hole
9015      * of the geometry.
9016      *
9017      * @param {Transform} transform - The transform of the image related to the geometry.
9018      * @returns {Array<Array<Array<number>>>} Array of hole polygons in 3D world coordinates
9019      * representing the vertices of each hole of the geometry.
9020      * @ignore
9021      */
9022     getHoleVertices3d(transform: Transform): number[][][];
9023     /** @ignore */
9024     getCentroid2d(): number[];
9025     /** @ignore */
9026     getCentroid3d(transform: Transform): number[];
9027     /** @ignore */
9028     get3dDomainTriangles3d(transform: Transform): number[];
9029     /** @ignore */
9030     getTriangles3d(transform: Transform): number[];
9031     /** @ignore */
9032     getPoleOfInaccessibility2d(): number[];
9033     /** @ignore */
9034     getPoleOfInaccessibility3d(transform: Transform): number[];
9035     private _getPoints3d;
9036 }
9037
9038 /**
9039  * @class RectGeometry
9040  *
9041  * @classdesc Represents a rectangle geometry in the 2D basic image coordinate system.
9042  *
9043  * @example
9044  * ```js
9045  * var basicRect = [0.5, 0.3, 0.7, 0.4];
9046  * var rectGeometry = new RectGeometry(basicRect);
9047  * ```
9048  */
9049 declare class RectGeometry extends VertexGeometry {
9050     private _anchorIndex;
9051     private _inverted;
9052     private _rect;
9053     /**
9054      * Create a rectangle geometry.
9055      *
9056      * @constructor
9057      * @param {Array<number>} rect - An array representing the top-left and bottom-right
9058      * corners of the rectangle in basic coordinates. Ordered according to [x0, y0, x1, y1].
9059      *
9060      * @throws {GeometryTagError} Rectangle coordinates must be valid basic coordinates.
9061      */
9062     constructor(rect: number[]);
9063     /**
9064      * Get anchor index property.
9065      *
9066      * @returns {number} Index representing the current anchor property if
9067      * achoring indexing has been initialized. If anchor indexing has not been
9068      * initialized or has been terminated undefined will be returned.
9069      * @ignore
9070      */
9071     get anchorIndex(): number;
9072     /**
9073      * Get inverted property.
9074      *
9075      * @returns {boolean} Boolean determining whether the rect geometry is
9076      * inverted. For spherical the rect geometrye may be inverted.
9077      * @ignore
9078      */
9079     get inverted(): boolean;
9080     /**
9081      * Get rect property.
9082      *
9083      * @returns {Array<number>} Array representing the top-left and bottom-right
9084      * corners of the rectangle in basic coordinates.
9085      */
9086     get rect(): number[];
9087     /**
9088      * Initialize anchor indexing to enable setting opposite vertex.
9089      *
9090      * @param {number} [index] - The index of the vertex to use as anchor.
9091      *
9092      * @throws {GeometryTagError} If anchor indexing has already been initialized.
9093      * @throws {GeometryTagError} If index is not valid (0 to 3).
9094      * @ignore
9095      */
9096     initializeAnchorIndexing(index?: number): void;
9097     /**
9098      * Terminate anchor indexing to disable setting pposite vertex.
9099      * @ignore
9100      */
9101     terminateAnchorIndexing(): void;
9102     /**
9103      * Set the value of the vertex opposite to the anchor in the polygon
9104      * representation of the rectangle.
9105      *
9106      * @description Setting the opposite vertex may change the anchor index.
9107      *
9108      * @param {Array<number>} opposite - The new value of the vertex opposite to the anchor.
9109      * @param {Transform} transform - The transform of the image related to the rectangle.
9110      *
9111      * @throws {GeometryTagError} When anchor indexing has not been initialized.
9112      * @ignore
9113      */
9114     setOppositeVertex2d(opposite: number[], transform: Transform): void;
9115     /**
9116      * Set the value of a vertex in the polygon representation of the rectangle.
9117      *
9118      * @description The polygon is defined to have the first vertex at the
9119      * bottom-left corner with the rest of the vertices following in clockwise order.
9120      *
9121      * @param {number} index - The index of the vertex to be set.
9122      * @param {Array<number>} value - The new value of the vertex.
9123      * @param {Transform} transform - The transform of the image related to the rectangle.
9124      * @ignore
9125      */
9126     setVertex2d(index: number, value: number[], transform: Transform): void;
9127     /** @ignore */
9128     setCentroid2d(value: number[], transform: Transform): void;
9129     /**
9130      * Get the 3D coordinates for the vertices of the rectangle with
9131      * interpolated points along the lines.
9132      *
9133      * @param {Transform} transform - The transform of the image related to
9134      * the rectangle.
9135      * @returns {Array<Array<number>>} Polygon array of 3D world coordinates
9136      * representing the rectangle.
9137      * @ignore
9138      */
9139     getPoints3d(transform: Transform): number[][];
9140     /**
9141      * Get the coordinates of a vertex from the polygon representation of the geometry.
9142      *
9143      * @description The first vertex represents the bottom-left corner with the rest of
9144      * the vertices following in clockwise order. The method shifts the right side
9145      * coordinates of the rectangle by one unit to ensure that the vertices are ordered
9146      * clockwise.
9147      *
9148      * @param {number} index - Vertex index.
9149      * @returns {Array<number>} Array representing the 2D basic coordinates of the vertex.
9150      * @ignore
9151      */
9152     getVertex2d(index: number): number[];
9153     /**
9154      * Get the coordinates of a vertex from the polygon representation of the geometry.
9155      *
9156      * @description The first vertex represents the bottom-left corner with the rest of
9157      * the vertices following in clockwise order. The coordinates will not be shifted
9158      * so they may not appear in clockwise order when layed out on the plane.
9159      *
9160      * @param {number} index - Vertex index.
9161      * @returns {Array<number>} Array representing the 2D basic coordinates of the vertex.
9162      * @ignore
9163      */
9164     getNonAdjustedVertex2d(index: number): number[];
9165     /**
9166      * Get a vertex from the polygon representation of the 3D coordinates for the
9167      * vertices of the geometry.
9168      *
9169      * @description The first vertex represents the bottom-left corner with the rest of
9170      * the vertices following in clockwise order.
9171      *
9172      * @param {number} index - Vertex index.
9173      * @param {Transform} transform - The transform of the image related to the geometry.
9174      * @returns {Array<Array<number>>} Polygon array of 3D world coordinates representing
9175      * the vertices of the geometry.
9176      * @ignore
9177      */
9178     getVertex3d(index: number, transform: Transform): number[];
9179     /**
9180      * Get a polygon representation of the 2D basic coordinates for the vertices of the rectangle.
9181      *
9182      * @description The first vertex represents the bottom-left corner with the rest of
9183      * the vertices following in clockwise order.
9184      *
9185      * @returns {Array<Array<number>>} Polygon array of 2D basic coordinates representing
9186      * the rectangle vertices.
9187      * @ignore
9188      */
9189     getVertices2d(): number[][];
9190     /**
9191      * Get a polygon representation of the 3D coordinates for the vertices of the rectangle.
9192      *
9193      * @description The first vertex represents the bottom-left corner with the rest of
9194      * the vertices following in clockwise order.
9195      *
9196      * @param {Transform} transform - The transform of the image related to the rectangle.
9197      * @returns {Array<Array<number>>} Polygon array of 3D world coordinates representing
9198      * the rectangle vertices.
9199      * @ignore
9200      */
9201     getVertices3d(transform: Transform): number[][];
9202     /** @ignore */
9203     getCentroid2d(): number[];
9204     /** @ignore */
9205     getCentroid3d(transform: Transform): number[];
9206     /**
9207      * @ignore
9208      */
9209     getPoleOfInaccessibility2d(): number[];
9210     /** @ignore */
9211     getPoleOfInaccessibility3d(transform: Transform): number[];
9212     /** @ignore */
9213     getTriangles3d(transform: Transform): number[];
9214     /**
9215      * Check if a particular bottom-right value is valid according to the current
9216      * rectangle coordinates.
9217      *
9218      * @param {Array<number>} bottomRight - The bottom-right coordinates to validate
9219      * @returns {boolean} Value indicating whether the provided bottom-right coordinates
9220      * are valid.
9221      * @ignore
9222      */
9223     validate(bottomRight: number[]): boolean;
9224     /**
9225      * Get the 2D coordinates for the vertices of the rectangle with
9226      * interpolated points along the lines.
9227      *
9228      * @returns {Array<Array<number>>} Polygon array of 2D basic coordinates
9229      * representing the rectangle.
9230      */
9231     private _getPoints2d;
9232     /**
9233      * Convert the top-left, bottom-right representation of a rectangle to a polygon
9234      * representation of the vertices starting at the bottom-left corner going
9235      * clockwise.
9236      *
9237      * @description The method shifts the right side coordinates of the rectangle
9238      * by one unit to ensure that the vertices are ordered clockwise.
9239      *
9240      * @param {Array<number>} rect - Top-left, bottom-right representation of a
9241      * rectangle.
9242      * @returns {Array<Array<number>>} Polygon representation of the vertices of the
9243      * rectangle.
9244      */
9245     private _rectToVertices2d;
9246     /**
9247      * Convert the top-left, bottom-right representation of a rectangle to a polygon
9248      * representation of the vertices starting at the bottom-left corner going
9249      * clockwise.
9250      *
9251      * @description The first vertex represents the bottom-left corner with the rest of
9252      * the vertices following in clockwise order. The coordinates will not be shifted
9253      * to ensure that the vertices are ordered clockwise when layed out on the plane.
9254      *
9255      * @param {Array<number>} rect - Top-left, bottom-right representation of a
9256      * rectangle.
9257      * @returns {Array<Array<number>>} Polygon representation of the vertices of the
9258      * rectangle.
9259      */
9260     private _rectToNonAdjustedVertices2d;
9261 }
9262
9263 /**
9264  * @event
9265  */
9266 declare type TagEventType = "click" | "geometry" | "tag";
9267
9268 /**
9269  * Interface for tag state events.
9270  *
9271  * @example
9272  * ```js
9273  * var tag = new OutlineTag({ // tag options });
9274  * // Set an event listener
9275  * tag.on('tag', function() {
9276  *   console.log("A tag event has occurred.");
9277  * });
9278  * ```
9279  */
9280 interface TagStateEvent {
9281     /**
9282      * The component object that fired the event.
9283      */
9284     target: Tag;
9285     /**
9286      * The event type.
9287      */
9288     type: TagEventType;
9289 }
9290
9291 /**
9292  * @class Tag
9293  * @abstract
9294  * @classdesc Abstract class representing the basic functionality of for a tag.
9295  */
9296 declare abstract class Tag extends EventEmitter {
9297     protected _id: string;
9298     protected _geometry: Geometry;
9299     protected _notifyChanged$: Subject<Tag>;
9300     /**
9301      * Create a tag.
9302      *
9303      * @constructor
9304      * @param {string} id
9305      * @param {Geometry} geometry
9306      */
9307     constructor(id: string, geometry: Geometry);
9308     /**
9309      * Get id property.
9310      * @returns {string}
9311      */
9312     get id(): string;
9313     /**
9314      * Get geometry property.
9315      * @returns {Geometry} The geometry of the tag.
9316      */
9317     get geometry(): Geometry;
9318     /**
9319      * Get changed observable.
9320      * @returns {Observable<Tag>}
9321      * @ignore
9322      */
9323     get changed$(): Observable<Tag>;
9324     /**
9325      * Get geometry changed observable.
9326      * @returns {Observable<Tag>}
9327      * @ignore
9328      */
9329     get geometryChanged$(): Observable<Tag>;
9330     fire(type: "tag" | "geometry", event: TagStateEvent): void;
9331     /** @ignore */
9332     fire(type: TagEventType, event: TagStateEvent): void;
9333     off(type: "tag" | "geometry", handler: (event: TagStateEvent) => void): void;
9334     /** @ignore */
9335     off(type: TagEventType, handler: (event: TagStateEvent) => void): void;
9336     /**
9337      * Event fired when the geometry of the tag has changed.
9338      *
9339      * @event geometry
9340      * @example
9341      * ```js
9342      * var tag = new OutlineTag({ // tag options });
9343      * // Set an event listener
9344      * tag.on('geometry', function() {
9345      *   console.log("A geometry event has occurred.");
9346      * });
9347      * ```
9348      */
9349     on(type: "geometry", handler: (event: TagStateEvent) => void): void;
9350     /**
9351      * Event fired when a tag has been updated.
9352      *
9353      * @event tag
9354      * @example
9355      * ```js
9356      * var tag = new OutlineTag({ // tag options });
9357      * // Set an event listener
9358      * tag.on('tag', function() {
9359      *   console.log("A tag event has occurred.");
9360      * });
9361      * ```
9362      */
9363     on(type: "tag", handler: (event: TagStateEvent) => void): void;
9364     /** @ignore */
9365     on(type: TagEventType, handler: (event: TagStateEvent) => void): void;
9366 }
9367
9368 /**
9369  * Interface for the options that define the behavior and
9370  * appearance of the outline tag.
9371  *
9372  * @interface
9373  */
9374 interface ExtremePointTagOptions {
9375     /**
9376      * Indicate whether the tag geometry should be editable.
9377      *
9378      * @description Polygon tags with two dimensional domain
9379      * are never editable.
9380      *
9381      * @default false
9382      */
9383     editable?: boolean;
9384     /**
9385      * Color for the interior fill as a hexadecimal number.
9386      * @default 0xFFFFFF
9387      */
9388     fillColor?: number;
9389     /**
9390      * Opacity of the interior fill between 0 and 1.
9391      * @default 0.3
9392      */
9393     fillOpacity?: number;
9394     /**
9395      * Determines whether vertices should be indicated by points
9396      * when tag is editable.
9397      *
9398      * @default true
9399      */
9400     indicateVertices?: boolean;
9401     /**
9402      * Color for the edge lines as a hexadecimal number.
9403      * @default 0xFFFFFF
9404      */
9405     lineColor?: number;
9406     /**
9407      * Opacity of the edge lines on [0, 1].
9408      * @default 1
9409      */
9410     lineOpacity?: number;
9411     /**
9412      * Line width in pixels.
9413      * @default 1
9414      */
9415     lineWidth?: number;
9416 }
9417
9418 /**
9419  * @class ExtremePointTag
9420  *
9421  * @classdesc Tag holding properties for visualizing a extreme points
9422  * and their outline.
9423  *
9424  * @example
9425  * ```js
9426  * var geometry = new PointsGeometry([[0.3, 0.3], [0.5, 0.4]]);
9427  * var tag = new ExtremePointTag(
9428  *     "id-1",
9429  *     geometry
9430  *     { editable: true, lineColor: 0xff0000 });
9431  *
9432  * tagComponent.add([tag]);
9433  * ```
9434  */
9435 declare class ExtremePointTag extends Tag {
9436     protected _geometry: PointsGeometry;
9437     private _editable;
9438     private _indicateVertices;
9439     private _lineColor;
9440     private _lineOpacity;
9441     private _lineWidth;
9442     private _fillColor;
9443     private _fillOpacity;
9444     /**
9445      * Create an extreme point tag.
9446      *
9447      * @override
9448      * @constructor
9449      * @param {string} id - Unique identifier of the tag.
9450      * @param {PointsGeometry} geometry - Geometry defining points of tag.
9451      * @param {ExtremePointTagOptions} options - Options defining the visual appearance and
9452      * behavior of the extreme point tag.
9453      */
9454     constructor(id: string, geometry: PointsGeometry, options?: ExtremePointTagOptions);
9455     /**
9456      * Get editable property.
9457      * @returns {boolean} Value indicating if tag is editable.
9458      */
9459     get editable(): boolean;
9460     /**
9461      * Set editable property.
9462      * @param {boolean}
9463      *
9464      * @fires changed
9465      */
9466     set editable(value: boolean);
9467     /**
9468      * Get fill color property.
9469      * @returns {number}
9470      */
9471     get fillColor(): number;
9472     /**
9473      * Set fill color property.
9474      * @param {number}
9475      *
9476      * @fires changed
9477      */
9478     set fillColor(value: number);
9479     /**
9480      * Get fill opacity property.
9481      * @returns {number}
9482      */
9483     get fillOpacity(): number;
9484     /**
9485      * Set fill opacity property.
9486      * @param {number}
9487      *
9488      * @fires changed
9489      */
9490     set fillOpacity(value: number);
9491     /** @inheritdoc */
9492     get geometry(): PointsGeometry;
9493     /**
9494      * Get indicate vertices property.
9495      * @returns {boolean} Value indicating if vertices should be indicated
9496      * when tag is editable.
9497      */
9498     get indicateVertices(): boolean;
9499     /**
9500      * Set indicate vertices property.
9501      * @param {boolean}
9502      *
9503      * @fires changed
9504      */
9505     set indicateVertices(value: boolean);
9506     /**
9507      * Get line color property.
9508      * @returns {number}
9509      */
9510     get lineColor(): number;
9511     /**
9512      * Set line color property.
9513      * @param {number}
9514      *
9515      * @fires changed
9516      */
9517     set lineColor(value: number);
9518     /**
9519      * Get line opacity property.
9520      * @returns {number}
9521      */
9522     get lineOpacity(): number;
9523     /**
9524      * Set line opacity property.
9525      * @param {number}
9526      *
9527      * @fires changed
9528      */
9529     set lineOpacity(value: number);
9530     /**
9531      * Get line width property.
9532      * @returns {number}
9533      */
9534     get lineWidth(): number;
9535     /**
9536      * Set line width property.
9537      * @param {number}
9538      *
9539      * @fires changed
9540      */
9541     set lineWidth(value: number);
9542     /**
9543      * Set options for tag.
9544      *
9545      * @description Sets all the option properties provided and keeps
9546      * the rest of the values as is.
9547      *
9548      * @param {ExtremePointTagOptions} options - Extreme point tag options
9549      *
9550      * @fires changed
9551      */
9552     setOptions(options: ExtremePointTagOptions): void;
9553 }
9554
9555 /**
9556  * Enumeration for tag domains.
9557  * @enum {number}
9558  * @readonly
9559  * @description Defines where lines between two vertices are treated
9560  * as straight.
9561  *
9562  * Only applicable for polygons. For rectangles lines between
9563  * vertices are always treated as straight in the distorted 2D
9564  * projection and bended in the undistorted 3D space.
9565  */
9566 declare enum TagDomain {
9567     /**
9568      * Treats lines between two vertices as straight in the
9569      * distorted 2D projection, i.e. on the image. If the image
9570      * is distorted this will result in bended lines when rendered
9571      * in the undistorted 3D space.
9572      */
9573     TwoDimensional = 0,
9574     /**
9575      * Treats lines as straight in the undistorted 3D space. If the
9576      * image is distorted this will result in bended lines when rendered
9577      * on the distorted 2D projection of the image.
9578      */
9579     ThreeDimensional = 1
9580 }
9581
9582 /**
9583  * Interface for the options that define the behavior and
9584  * appearance of the outline tag.
9585  *
9586  * @interface
9587  */
9588 interface OutlineTagOptions {
9589     /**
9590      * The domain where lines between vertices are treated as straight.
9591      *
9592      * @description Only applicable for tags that renders polygons.
9593      *
9594      * If the domain is specified as two dimensional, editing of the
9595      * polygon will be disabled.
9596      *
9597      * @default {TagDomain.TwoDimensional}
9598      */
9599     domain?: TagDomain;
9600     /**
9601      * Indicate whether the tag geometry should be editable.
9602      *
9603      * @description Polygon tags with two dimensional domain
9604      * are never editable.
9605      *
9606      * @default false
9607      */
9608     editable?: boolean;
9609     /**
9610      * Color for the interior fill as a hexadecimal number.
9611      * @default 0xFFFFFF
9612      */
9613     fillColor?: number;
9614     /**
9615      * Opacity of the interior fill between 0 and 1.
9616      * @default 0.3
9617      */
9618     fillOpacity?: number;
9619     /**
9620      * A string referencing the sprite data property to pull from.
9621      *
9622      * @description Icon is not shown for tags with polygon
9623      * geometries in spherical.
9624      */
9625     icon?: string;
9626     /**
9627      * Value determining how the icon will float with respect to its anchor
9628      * position when rendering.
9629      *
9630      * @default {Alignment.Center}
9631      */
9632     iconFloat?: Alignment;
9633     /**
9634      * Number representing the index for where to show the icon or
9635      * text for a rectangle geometry.
9636      *
9637      * @description The default index corresponds to the bottom right corner.
9638      *
9639      * @default 3
9640      */
9641     iconIndex?: number;
9642     /**
9643      * Determines whether vertices should be indicated by points
9644      * when tag is editable.
9645      *
9646      * @default true
9647      */
9648     indicateVertices?: boolean;
9649     /**
9650      * Color for the edge lines as a hexadecimal number.
9651      * @default 0xFFFFFF
9652      */
9653     lineColor?: number;
9654     /**
9655      * Opacity of the edge lines on [0, 1].
9656      * @default 1
9657      */
9658     lineOpacity?: number;
9659     /**
9660      * Line width in pixels.
9661      * @default 1
9662      */
9663     lineWidth?: number;
9664     /**
9665      * Text shown as label if no icon is provided.
9666      *
9667      * @description Text is not shown for tags with
9668      * polygon geometries in spherical.
9669      */
9670     text?: string;
9671     /**
9672      * Text color as hexadecimal number.
9673      * @default 0xFFFFFF
9674      */
9675     textColor?: number;
9676 }
9677
9678 /**
9679  * Interface for the options that define the behavior and
9680  * appearance of the spot tag.
9681  *
9682  * @interface
9683  */
9684 interface SpotTagOptions {
9685     /**
9686      * Color for the spot specified as a hexadecimal number.
9687      * @default 0xFFFFFF
9688      */
9689     color?: number;
9690     /**
9691      * Indicate whether the tag geometry should be editable.
9692      * @default false
9693      */
9694     editable?: boolean;
9695     /**
9696      * A string referencing the sprite data property to pull from.
9697      */
9698     icon?: string;
9699     /**
9700      * Text shown as label if no icon is provided.
9701      */
9702     text?: string;
9703     /**
9704      * Text color as hexadecimal number.
9705      * @default 0xFFFFFF
9706      */
9707     textColor?: number;
9708 }
9709
9710 /**
9711  * @class OutlineTag
9712  *
9713  * @classdesc Tag holding properties for visualizing a geometry outline.
9714  *
9715  * @example
9716  * ```js
9717  * var geometry = new RectGeometry([0.3, 0.3, 0.5, 0.4]);
9718  * var tag = new OutlineTag(
9719  *     "id-1",
9720  *     geometry
9721  *     { editable: true, lineColor: 0xff0000 });
9722  *
9723  * tagComponent.add([tag]);
9724  * ```
9725  */
9726 declare class OutlineTag extends Tag {
9727     protected _geometry: VertexGeometry;
9728     private _domain;
9729     private _editable;
9730     private _icon;
9731     private _iconFloat;
9732     private _iconIndex;
9733     private _indicateVertices;
9734     private _lineColor;
9735     private _lineOpacity;
9736     private _lineWidth;
9737     private _fillColor;
9738     private _fillOpacity;
9739     private _text;
9740     private _textColor;
9741     private _click$;
9742     /**
9743      * Create an outline tag.
9744      *
9745      * @override
9746      * @constructor
9747      * @param {string} id - Unique identifier of the tag.
9748      * @param {VertexGeometry} geometry - Geometry defining vertices of tag.
9749      * @param {OutlineTagOptions} options - Options defining the visual appearance and
9750      * behavior of the outline tag.
9751      */
9752     constructor(id: string, geometry: VertexGeometry, options?: OutlineTagOptions);
9753     /**
9754      * Click observable.
9755      *
9756      * @description An observable emitting the tag when the icon of the
9757      * tag has been clicked.
9758      *
9759      * @returns {Observable<Tag>}
9760      */
9761     get click$(): Subject<OutlineTag>;
9762     /**
9763      * Get domain property.
9764      *
9765      * @description Readonly property that can only be set in constructor.
9766      *
9767      * @returns Value indicating the domain of the tag.
9768      */
9769     get domain(): TagDomain;
9770     /**
9771      * Get editable property.
9772      * @returns {boolean} Value indicating if tag is editable.
9773      */
9774     get editable(): boolean;
9775     /**
9776      * Set editable property.
9777      * @param {boolean}
9778      *
9779      * @fires changed
9780      */
9781     set editable(value: boolean);
9782     /**
9783      * Get fill color property.
9784      * @returns {number}
9785      */
9786     get fillColor(): number;
9787     /**
9788      * Set fill color property.
9789      * @param {number}
9790      *
9791      * @fires changed
9792      */
9793     set fillColor(value: number);
9794     /**
9795      * Get fill opacity property.
9796      * @returns {number}
9797      */
9798     get fillOpacity(): number;
9799     /**
9800      * Set fill opacity property.
9801      * @param {number}
9802      *
9803      * @fires changed
9804      */
9805     set fillOpacity(value: number);
9806     /** @inheritdoc */
9807     get geometry(): VertexGeometry;
9808     /**
9809      * Get icon property.
9810      * @returns {string}
9811      */
9812     get icon(): string;
9813     /**
9814      * Set icon property.
9815      * @param {string}
9816      *
9817      * @fires changed
9818      */
9819     set icon(value: string);
9820     /**
9821      * Get icon float property.
9822      * @returns {Alignment}
9823      */
9824     get iconFloat(): Alignment;
9825     /**
9826      * Set icon float property.
9827      * @param {Alignment}
9828      *
9829      * @fires changed
9830      */
9831     set iconFloat(value: Alignment);
9832     /**
9833      * Get icon index property.
9834      * @returns {number}
9835      */
9836     get iconIndex(): number;
9837     /**
9838      * Set icon index property.
9839      * @param {number}
9840      *
9841      * @fires changed
9842      */
9843     set iconIndex(value: number);
9844     /**
9845      * Get indicate vertices property.
9846      * @returns {boolean} Value indicating if vertices should be indicated
9847      * when tag is editable.
9848      */
9849     get indicateVertices(): boolean;
9850     /**
9851      * Set indicate vertices property.
9852      * @param {boolean}
9853      *
9854      * @fires changed
9855      */
9856     set indicateVertices(value: boolean);
9857     /**
9858      * Get line color property.
9859      * @returns {number}
9860      */
9861     get lineColor(): number;
9862     /**
9863      * Set line color property.
9864      * @param {number}
9865      *
9866      * @fires changed
9867      */
9868     set lineColor(value: number);
9869     /**
9870      * Get line opacity property.
9871      * @returns {number}
9872      */
9873     get lineOpacity(): number;
9874     /**
9875      * Set line opacity property.
9876      * @param {number}
9877      *
9878      * @fires changed
9879      */
9880     set lineOpacity(value: number);
9881     /**
9882      * Get line width property.
9883      * @returns {number}
9884      */
9885     get lineWidth(): number;
9886     /**
9887      * Set line width property.
9888      * @param {number}
9889      *
9890      * @fires changed
9891      */
9892     set lineWidth(value: number);
9893     /**
9894      * Get text property.
9895      * @returns {string}
9896      */
9897     get text(): string;
9898     /**
9899      * Set text property.
9900      * @param {string}
9901      *
9902      * @fires changed
9903      */
9904     set text(value: string);
9905     /**
9906      * Get text color property.
9907      * @returns {number}
9908      */
9909     get textColor(): number;
9910     /**
9911      * Set text color property.
9912      * @param {number}
9913      *
9914      * @fires changed
9915      */
9916     set textColor(value: number);
9917     fire(type: TagStateEvent["type"], event: TagStateEvent): void;
9918     /** @ignore */
9919     fire(type: TagEventType, event: TagStateEvent): void;
9920     off(type: TagStateEvent["type"], handler: (event: TagStateEvent) => void): void;
9921     /** @ignore */
9922     off(type: TagEventType, handler: (event: TagStateEvent) => void): void;
9923     /**
9924      * Event fired when the icon of the outline tag is clicked.
9925      *
9926      * @event click
9927      * @example
9928      * ```js
9929      * var tag = new OutlineTag({ // tag options });
9930      * // Set an event listener
9931      * tag.on('click', function() {
9932      *   console.log("A click event has occurred.");
9933      * });
9934      * ```
9935      */
9936     on(type: "click", handler: (event: TagStateEvent) => void): void;
9937     /**
9938      * Event fired when the geometry of the tag has changed.
9939      *
9940      * @event geometry
9941      * @example
9942      * ```js
9943      * var tag = new OutlineTag({ // tag options });
9944      * // Set an event listener
9945      * tag.on('geometry', function() {
9946      *   console.log("A geometry event has occurred.");
9947      * });
9948      * ```
9949      */
9950     on(type: "geometry", handler: (event: TagStateEvent) => void): void;
9951     /**
9952      * Event fired when a tag has been updated.
9953      *
9954      * @event tag
9955      * @example
9956      * ```js
9957      * var tag = new OutlineTag({ // tag options });
9958      * // Set an event listener
9959      * tag.on('tag', function() {
9960      *   console.log("A tag event has occurred.");
9961      * });
9962      * ```
9963      */
9964     on(type: "tag", handler: (event: TagStateEvent) => void): void;
9965     /**
9966      * Set options for tag.
9967      *
9968      * @description Sets all the option properties provided and keeps
9969      * the rest of the values as is.
9970      *
9971      * @param {OutlineTagOptions} options - Outline tag options
9972      *
9973      * @fires changed
9974      */
9975     setOptions(options: OutlineTagOptions): void;
9976     private _twoDimensionalPolygon;
9977 }
9978
9979 /**
9980  * @class SpotTag
9981  *
9982  * @classdesc Tag holding properties for visualizing the centroid of a geometry.
9983  *
9984  * @example
9985  * ```js
9986  * var geometry = new PointGeometry([0.3, 0.3]);
9987  * var tag = new SpotTag(
9988  *     "id-1",
9989  *     geometry
9990  *     { editable: true, color: 0xff0000 });
9991  *
9992  * tagComponent.add([tag]);
9993  * ```
9994  */
9995 declare class SpotTag extends Tag {
9996     protected _geometry: Geometry;
9997     private _color;
9998     private _editable;
9999     private _icon;
10000     private _text;
10001     private _textColor;
10002     /**
10003      * Create a spot tag.
10004      *
10005      * @override
10006      * @constructor
10007      * @param {string} id
10008      * @param {Geometry} geometry
10009      * @param {IOutlineTagOptions} options - Options defining the visual appearance and
10010      * behavior of the spot tag.
10011      */
10012     constructor(id: string, geometry: Geometry, options?: SpotTagOptions);
10013     /**
10014      * Get color property.
10015      * @returns {number} The color of the spot as a hexagonal number;
10016      */
10017     get color(): number;
10018     /**
10019      * Set color property.
10020      * @param {number}
10021      *
10022      * @fires changed
10023      */
10024     set color(value: number);
10025     /**
10026      * Get editable property.
10027      * @returns {boolean} Value indicating if tag is editable.
10028      */
10029     get editable(): boolean;
10030     /**
10031      * Set editable property.
10032      * @param {boolean}
10033      *
10034      * @fires changed
10035      */
10036     set editable(value: boolean);
10037     /**
10038      * Get icon property.
10039      * @returns {string}
10040      */
10041     get icon(): string;
10042     /**
10043      * Set icon property.
10044      * @param {string}
10045      *
10046      * @fires changed
10047      */
10048     set icon(value: string);
10049     /**
10050      * Get text property.
10051      * @returns {string}
10052      */
10053     get text(): string;
10054     /**
10055      * Set text property.
10056      * @param {string}
10057      *
10058      * @fires changed
10059      */
10060     set text(value: string);
10061     /**
10062      * Get text color property.
10063      * @returns {number}
10064      */
10065     get textColor(): number;
10066     /**
10067      * Set text color property.
10068      * @param {number}
10069      *
10070      * @fires changed
10071      */
10072     set textColor(value: number);
10073     /**
10074      * Set options for tag.
10075      *
10076      * @description Sets all the option properties provided and keps
10077      * the rest of the values as is.
10078      *
10079      * @param {SpotTagOptions} options - Spot tag options
10080      *
10081      * @fires changed
10082      */
10083     setOptions(options: SpotTagOptions): void;
10084 }
10085
10086 /**
10087  * @class TagComponent
10088  *
10089  * @classdesc Component for showing and editing tags with different
10090  * geometries composed from 2D basic image coordinates (see the
10091  * {@link Viewer} class documentation for more information about coordinate
10092  * systems).
10093  *
10094  * The `add` method is used for adding new tags or replacing
10095  * tags already in the set. Tags are removed by id.
10096  *
10097  * If a tag already in the set has the same
10098  * id as one of the tags added, the old tag will be removed and
10099  * the added tag will take its place.
10100  *
10101  * The tag component mode can be set to either be non interactive or
10102  * to be in creating mode of a certain geometry type.
10103  *
10104  * The tag properties can be updated at any time and the change will
10105  * be visibile immediately.
10106  *
10107  * Tags are only relevant to a single image because they are based on
10108  * 2D basic image coordinates. Tags related to a certain image should
10109  * be removed when the viewer is moved to another image.
10110  *
10111  * To retrive and use the tag component
10112  *
10113  * @example
10114  * ```js
10115  * var viewer = new Viewer({ component: { tag: true } }, ...);
10116  *
10117  * var tagComponent = viewer.getComponent("tag");
10118  * ```
10119  */
10120 declare class TagComponent extends Component<TagConfiguration> {
10121     /** @inheritdoc */
10122     static componentName: ComponentName;
10123     private _tagDomRenderer;
10124     private _tagScene;
10125     private _tagSet;
10126     private _tagCreator;
10127     private _viewportCoords;
10128     private _renderTags$;
10129     private _tagChanged$;
10130     private _renderTagGLChanged$;
10131     private _createGeometryChanged$;
10132     private _createGLObjectsChanged$;
10133     private _creatingConfiguration$;
10134     private _createHandlers;
10135     private _editVertexHandler;
10136     /** @ignore */
10137     constructor(name: string, container: Container, navigator: Navigator);
10138     /**
10139      * Add tags to the tag set or replace tags in the tag set.
10140      *
10141      * @description If a tag already in the set has the same
10142      * id as one of the tags added, the old tag will be removed
10143      * the added tag will take its place.
10144      *
10145      * @param {Array<Tag>} tags - Tags to add.
10146      *
10147      * @example
10148      * ```js
10149      * tagComponent.add([tag1, tag2]);
10150      * ```
10151      */
10152     add(tags: Tag[]): void;
10153     /**
10154      * Calculate the smallest rectangle containing all the points
10155      * in the points geometry.
10156      *
10157      * @description The result may be different depending on if the
10158      * current image is an spherical or not. If the
10159      * current image is an spherical the rectangle may
10160      * wrap the horizontal border of the image.
10161      *
10162      * @returns {Promise<Array<number>>} Promise to the rectangle
10163      * on the format specified for the {@link RectGeometry} in basic
10164      * coordinates.
10165      */
10166     calculateRect(geometry: PointsGeometry): Promise<number[]>;
10167     /**
10168      * Force the creation of a geometry programatically using its
10169      * current vertices.
10170      *
10171      * @description The method only has an effect when the tag
10172      * mode is either of the following modes:
10173      *
10174      * {@link TagMode.CreatePoints}
10175      * {@link TagMode.CreatePolygon}
10176      * {@link TagMode.CreateRect}
10177      * {@link TagMode.CreateRectDrag}
10178      *
10179      * In the case of points or polygon creation, only the created
10180      * vertices are used, i.e. the mouse position is disregarded.
10181      *
10182      * In the case of rectangle creation the position of the mouse
10183      * at the time of the method call is used as one of the vertices
10184      * defining the rectangle.
10185      *
10186      * @fires geometrycreate
10187      *
10188      * @example
10189      * ```js
10190      * tagComponent.on("geometrycreate", function(geometry) {
10191      *     console.log(geometry);
10192      * });
10193      *
10194      * tagComponent.create();
10195      * ```
10196      */
10197     create(): void;
10198     /**
10199      * Change the current tag mode.
10200      *
10201      * @description Change the tag mode to one of the create modes for creating new geometries.
10202      *
10203      * @param {TagMode} mode - New tag mode.
10204      *
10205      * @fires tagmode
10206      *
10207      * @example
10208      * ```js
10209      * tagComponent.changeMode(TagMode.CreateRect);
10210      * ```
10211      */
10212     changeMode(mode: TagMode): void;
10213     fire(type: "geometrycreate", event: ComponentGeometryEvent): void;
10214     fire(type: "tagmode", event: ComponentTagModeEvent): void;
10215     /** @ignore */
10216     fire(type: "tagcreateend" | "tagcreatestart" | "tags", event: ComponentStateEvent): void;
10217     /**
10218      * Returns the tag in the tag set with the specified id, or
10219      * undefined if the id matches no tag.
10220      *
10221      * @param {string} tagId - Id of the tag.
10222      *
10223      * @example
10224      * ```js
10225      * var tag = tagComponent.get("tagId");
10226      * ```
10227      */
10228     get(tagId: string): Tag;
10229     /**
10230      * Returns an array of all tags.
10231      *
10232      * @example
10233      * ```js
10234      * var tags = tagComponent.getAll();
10235      * ```
10236      */
10237     getAll(): Tag[];
10238     /**
10239      * Returns an array of tag ids for tags that contain the specified point.
10240      *
10241      * @description The pixel point must lie inside the polygon or rectangle
10242      * of an added tag for the tag id to be returned. Tag ids for
10243      * tags that do not have a fill will also be returned if the point is inside
10244      * the geometry of the tag. Tags with point geometries can not be retrieved.
10245      *
10246      * No tag ids will be returned for polygons rendered in cropped spherical or
10247      * rectangles rendered in spherical.
10248      *
10249      * Notice that the pixelPoint argument requires x, y coordinates from pixel space.
10250      *
10251      * With this function, you can use the coordinates provided by mouse
10252      * events to get information out of the tag component.
10253      *
10254      * If no tag at exist the pixel point, an empty array will be returned.
10255      *
10256      * @param {Array<number>} pixelPoint - Pixel coordinates on the viewer element.
10257      * @returns {Promise<Array<string>>} Promise to the ids of the tags that
10258      * contain the specified pixel point.
10259      *
10260      * @example
10261      * ```js
10262      * tagComponent.getTagIdsAt([100, 100])
10263      *     .then((tagIds) => { console.log(tagIds); });
10264      * ```
10265      */
10266     getTagIdsAt(pixelPoint: number[]): Promise<string[]>;
10267     /**
10268      * Check if a tag exist in the tag set.
10269      *
10270      * @param {string} tagId - Id of the tag.
10271      *
10272      * @example
10273      * ```js
10274      * var tagExists = tagComponent.has("tagId");
10275      * ```
10276      */
10277     has(tagId: string): boolean;
10278     off(type: "geometrycreate", handler: (event: ComponentGeometryEvent) => void): void;
10279     off(type: "tagmode", handler: (event: ComponentTagModeEvent) => void): void;
10280     off(type: "tagcreateend" | "tagcreatestart" | "tags", handler: (event: ComponentStateEvent) => void): void;
10281     /**
10282      * Event fired when a geometry has been created.
10283      *
10284      * @event geometrycreated
10285      * @example
10286      * ```js
10287      * // Initialize the viewer
10288      * var viewer = new Viewer({ // viewer options });
10289      * var component = viewer.getComponent('<component-name>');
10290      * // Set an event listener
10291      * component.on('geometrycreated', function() {
10292      *   console.log("A geometrycreated event has occurred.");
10293      * });
10294      * ```
10295      */
10296     on(type: "geometrycreate", handler: (event: ComponentGeometryEvent) => void): void;
10297     /**
10298      * Event fired when an interaction to create a geometry ends.
10299      *
10300      * @description A create interaction can by a geometry being created
10301      * or by the creation being aborted.
10302      *
10303      * @event tagcreateend
10304      * @example
10305      * ```js
10306      * // Initialize the viewer
10307      * var viewer = new Viewer({ // viewer options });
10308      * var component = viewer.getComponent('<component-name>');
10309      * // Set an event listener
10310      * component.on('tagcreateend', function() {
10311      *   console.log("A tagcreateend event has occurred.");
10312      * });
10313      * ```
10314      */
10315     on(type: "tagcreateend", handler: (event: ComponentStateEvent) => void): void;
10316     /**
10317      * Event fired when an interaction to create a geometry starts.
10318      *
10319      * @description A create interaction starts when the first vertex
10320      * is created in the geometry.
10321      *
10322      * @event tagcreatestart
10323      * @example
10324      * ```js
10325      * // Initialize the viewer
10326      * var viewer = new Viewer({ // viewer options });
10327      * var component = viewer.getComponent('<component-name>');
10328      * // Set an event listener
10329      * component.on('tagcreatestart', function() {
10330      *   console.log("A tagcreatestart event has occurred.");
10331      * });
10332      * ```
10333      */
10334     on(type: "tagcreatestart", handler: (event: ComponentStateEvent) => void): void;
10335     /**
10336      * Event fired when the create mode is changed.
10337      *
10338      * @event tagmode
10339      * @example
10340      * ```js
10341      * // Initialize the viewer
10342      * var viewer = new Viewer({ // viewer options });
10343      * var component = viewer.getComponent('<component-name>');
10344      * // Set an event listener
10345      * component.on('tagmode', function() {
10346      *   console.log("A tagmode event has occurred.");
10347      * });
10348      * ```
10349      */
10350     on(type: "tagmode", handler: (event: ComponentTagModeEvent) => void): void;
10351     /**
10352      * Event fired when the tags collection has changed.
10353      *
10354      * @event tags
10355      * @example
10356      * ```js
10357      * // Initialize the viewer
10358      * var viewer = new Viewer({ // viewer options });
10359      * var component = viewer.getComponent('<component-name>');
10360      * // Set an event listener
10361      * component.on('tags', function() {
10362      *   console.log("A tags event has occurred.");
10363      * });
10364      * ```
10365      */
10366     on(type: "tags", handler: (event: ComponentStateEvent) => void): void;
10367     /**
10368      * Remove tags with the specified ids from the tag set.
10369      *
10370      * @param {Array<string>} tagIds - Ids for tags to remove.
10371      *
10372      * @example
10373      * ```js
10374      * tagComponent.remove(["id-1", "id-2"]);
10375      * ```
10376      */
10377     remove(tagIds: string[]): void;
10378     /**
10379      * Remove all tags from the tag set.
10380      *
10381      * @example
10382      * ```js
10383      * tagComponent.removeAll();
10384      * ```
10385      */
10386     removeAll(): void;
10387     protected _activate(): void;
10388     protected _deactivate(): void;
10389     protected _getDefaultConfiguration(): TagConfiguration;
10390     private _disableCreateHandlers;
10391 }
10392
10393 /**
10394  * @class ZoomComponent
10395  *
10396  * @classdesc Component rendering UI elements used for zooming.
10397  *
10398  * @example
10399  * ```js
10400  * var viewer = new Viewer({ ... });
10401  *
10402  * var zoomComponent = viewer.getComponent("zoom");
10403  * zoomComponent.configure({ size: ComponentSize.Small });
10404  * ```
10405  */
10406 declare class ZoomComponent extends Component<ZoomConfiguration> {
10407     static componentName: ComponentName;
10408     private _viewportCoords;
10409     private _zoomDelta$;
10410     constructor(name: string, container: Container, navigator: Navigator);
10411     protected _activate(): void;
10412     protected _deactivate(): void;
10413     protected _getDefaultConfiguration(): ZoomConfiguration;
10414 }
10415
10416 export { Alignment, ArgumentMapillaryError, BearingComponent, BearingConfiguration, CacheComponent, CacheConfiguration, CacheDepthConfiguration, CameraControls, CameraEnt, CameraVisualizationMode, CancelMapillaryError, CircleMarker, CircleMarkerOptions, ClusterContract, CombiningFilterExpression, CombiningFilterOperator, ComparisonFilterExpression, ComparisonFilterOperator, Component, ComponentEvent, ComponentEventType, ComponentGeometryEvent, ComponentHoverEvent, ComponentMarkerEvent, ComponentName, ComponentOptions, ComponentPlayEvent, ComponentSize, ComponentStateEvent, ComponentTagModeEvent, CoreImageEnt, CoreImagesContract, CreatorEnt, DataProviderBase, DirectionComponent, DirectionConfiguration, DragPanHandler, EntContract, ExtremePointTag, ExtremePointTagOptions, FallbackComponentName, FallbackOptions, FilterExpression, FilterKey, FilterOperator, FilterValue, Geometry, GeometryProviderBase, GeometryTagError, GraphDataProvider, GraphDataProviderOptions, GraphMapillaryError, IComponent, ICustomCameraControls, ICustomRenderer, IDEnt, IViewer, Image, ImageEnt, ImageTileEnt, ImageTilesContract, ImageTilesRequestContract, ImagesContract, KeyPlayHandler, KeySequenceNavigationHandler, KeySpatialNavigationHandler, KeyZoomHandler, KeyboardComponent, KeyboardConfiguration, LngLat, LngLatAlt, MapillaryError, Marker, MarkerComponent, MarkerConfiguration, MeshContract, NavigationDirection, NavigationEdge, NavigationEdgeData, NavigationEdgeStatus, OriginalPositionMode, OutlineTag, OutlineTagOptions, PointContract, PointGeometry, PointOfView, PointerComponent, PointerConfiguration, PointsGeometry, PolygonGeometry, Popup, PopupComponent, PopupOffset, PopupOptions, ProviderCellEvent, ProviderEvent, ProviderEventType, RectGeometry, RenderMode, RenderPass, S2GeometryProvider, ScrollZoomHandler, SequenceComponent, SequenceConfiguration, SequenceContract, SequenceEnt, SetMembershipFilterExpression, SetMembershipFilterOperator, SimpleMarker, SimpleMarkerOptions, SliderComponent, SliderConfiguration, SliderConfigurationIds, SliderConfigurationMode, SpatialComponent, SpatialConfiguration, SpatialImageEnt, SpatialImagesContract, SpotTag, SpotTagOptions, Tag, TagComponent, TagConfiguration, TagDomain, TagEventType, TagMode, TagStateEvent, TouchZoomHandler, TransitionMode, URLEnt, UrlOptions, VertexGeometry, Viewer, ViewerBearingEvent, ViewerDataLoadingEvent, ViewerEvent, ViewerEventType, ViewerImageEvent, ViewerMouseEvent, ViewerNavigableEvent, ViewerNavigationEdgeEvent, ViewerOptions, ViewerStateEvent, ZoomComponent, ZoomConfiguration, decompress, enuToGeodetic, fetchArrayBuffer, geodeticToEnu, isFallbackSupported, isSupported, readMeshPbf };