@archilogic/floor-plan-sdk 3.1.7 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fpe.d.ts ADDED
@@ -0,0 +1,832 @@
1
+ /*
2
+ Archilogic Floor Plan Engine SDK v3.2.0 build 231130-191305-e945ff
3
+
4
+ (c) 2023 Archilogic AG
5
+
6
+ License: According to your license agreement with Archilogic AG
7
+ */
8
+ declare type Point2d = [number, number];
9
+ declare type Polygon = Point2d[];
10
+ declare type PolygonList = Polygon[];
11
+ /**
12
+ * boolean union of two or more polygon
13
+ */
14
+ declare function polygonUnion(polygons: PolygonList): PolygonList;
15
+ declare enum EndType {
16
+ etOpenSquare = 0,
17
+ etOpenRound = 1,
18
+ etOpenButt = 2,
19
+ etClosedLine = 3,
20
+ etClosedPolygon = 4
21
+ }
22
+ /**
23
+ * contour offset for one or multiple polygons
24
+ * https://sourceforge.net/p/jsclipper/wiki/documentation/#clipperlibendtype
25
+ */
26
+ declare function polygonOffset(polygons: PolygonList, delta?: number, endType?: EndType, skipCleaning?: boolean): PolygonList;
27
+ /**
28
+ * boolean intersection of two or more polygon
29
+ * the subject path can be an open polyline
30
+ */
31
+ declare function polygonIntersection(polygons?: PolygonList, clipPolygons?: PolygonList, subjectPathOpen?: boolean): PolygonList;
32
+ /**
33
+ * Point in polygon
34
+ * Returns 0 if false, -1 if pt is on poly and +1 if pt is in poly
35
+ */
36
+ declare function pointInPolygon(point: Point2d, polygon: Polygon, holes?: PolygonList): -1 | 0 | 1;
37
+
38
+ type StartupOptions = {
39
+ /**
40
+ * - option to hide certain elements
41
+ */
42
+ hideElements?: HideableElement[];
43
+ /**
44
+ * - option to disable panning and zooming
45
+ */
46
+ panZoom?: boolean;
47
+ /**
48
+ * - if set panning and zooming is restricted to the scene boundingbox plus the margin
49
+ */
50
+ panZoomMargin?: number;
51
+ /**
52
+ * - rotation angle for the floor plan in degrees (counterclockwise)
53
+ */
54
+ planRotation?: number;
55
+ /**
56
+ * - where the floor plan should be anchored to if the viewport resizes
57
+ */
58
+ preserveViewbox?: ViewboxAnchor;
59
+ /**
60
+ * - if set room stamps have a fixed size - otherwise they adapt to the zoom level
61
+ */
62
+ roomStampSize?: number;
63
+ /**
64
+ * - toggle overlaying UI elements
65
+ */
66
+ ui?: UI;
67
+ /**
68
+ * - floor plan theming
69
+ */
70
+ theme?: Theme;
71
+ /**
72
+ * - mapping table for custom space labels
73
+ */
74
+ spaceLabelMapping?: SpaceLabelMapping;
75
+ /**
76
+ * - set the unit system
77
+ */
78
+ units?: Units;
79
+ };
80
+ type AccessToken = {
81
+ /**
82
+ * - Space API v2 [publishable access token.](../space-api/v2/introduction.md#publishable-access-token)
83
+ */
84
+ publishableToken?: string;
85
+ /**
86
+ * - Authorization header value for a Space API v2 [temporary access token.](../space-api/v2/introduction.md#temporary-access-token)
87
+ */
88
+ authorization?: string;
89
+ };
90
+ /**
91
+ * Viewbox anchor described as `<x-axis>-<y-axis>`. This describes where the floor plan should be anchored to if the viewport (ie. the containing DOM element) resizes
92
+ */
93
+ type ViewboxAnchor = 'left-top' | 'left-center' | 'left-bottom' | 'center-top' | 'center-center' | 'center-bottom' | 'right-top' | 'right-center' | 'right-bottom';
94
+ /**
95
+ * Elements that can be hidden in the floor plan
96
+ */
97
+ type HideableElement = 'interior' | 'roomStamp';
98
+ type UI = {
99
+ /**
100
+ * - Shows bottom left menu buttons that include the measuring tool and a zoom extents button
101
+ */
102
+ menu?: boolean;
103
+ /**
104
+ * - Show a dynamic scale indicator
105
+ */
106
+ scale?: boolean;
107
+ /**
108
+ * - Show the current cursor position in plan coordinates
109
+ */
110
+ coordinates?: boolean;
111
+ };
112
+ /**
113
+ * Space properties that can be shown in room stamps
114
+ */
115
+ type RoomStampEntry = 'area' | 'customId' | 'name' | 'usage';
116
+ /**
117
+ * This is the place to give the floor plan your own style
118
+ */
119
+ type Theme = {
120
+ /**
121
+ * - define the background
122
+ */
123
+ background?: BackgroundOptions;
124
+ /**
125
+ * - wall contours are merged to one continuous outline, needed if you want white walls
126
+ */
127
+ wallContours?: boolean;
128
+ /**
129
+ * - render assets with textures rather than solid colors
130
+ */
131
+ showAssetTextures?: boolean;
132
+ elements?: Elements;
133
+ };
134
+ type Elements = {
135
+ asset?: NodeTheme;
136
+ roomStamp?: RoomStampTheme;
137
+ space?: SpaceTheme;
138
+ wall?: NodeTheme;
139
+ wallContour?: NodeTheme;
140
+ };
141
+ type RoomStampTheme = {
142
+ /**
143
+ * - show the usage information in room stamps
144
+ */
145
+ roomStampDisplay?: RoomStampEntry[];
146
+ /**
147
+ * - Deprecated: show the usage information in room stamps
148
+ */
149
+ showUsage?: boolean;
150
+ /**
151
+ * - Deprecated: show the area information in room stamps
152
+ */
153
+ showArea?: boolean;
154
+ /**
155
+ * - text color for room stamps
156
+ */
157
+ text?: RGBArray;
158
+ /**
159
+ * - whether the room stamp text should have an outline to assist with contrast issues
160
+ */
161
+ textOutline?: boolean;
162
+ };
163
+ type SpaceTheme = {
164
+ /**
165
+ * - set fill for all spaces
166
+ */
167
+ fill?: RGBArray;
168
+ /**
169
+ * - set fillOpacity for all spaces
170
+ */
171
+ fillOpacity?: number;
172
+ /**
173
+ * - set outline for all spaces
174
+ */
175
+ outline?: RGBArray;
176
+ /**
177
+ * - set outlineWidth for all spaces
178
+ */
179
+ outlineWidth?: number;
180
+ /**
181
+ * - set style by space program
182
+ */
183
+ program?: {
184
+ care?: NodeTheme;
185
+ support?: NodeTheme;
186
+ socialize?: NodeTheme;
187
+ circulate?: NodeTheme;
188
+ drive?: NodeTheme;
189
+ live?: NodeTheme;
190
+ meet?: NodeTheme;
191
+ operate?: NodeTheme;
192
+ wash?: NodeTheme;
193
+ work?: NodeTheme;
194
+ };
195
+ /**
196
+ * - set style by space usage
197
+ */
198
+ usage?: {
199
+ [x: string]: NodeTheme;
200
+ };
201
+ };
202
+ /**
203
+ * Map space labels by space usage or space id to a custom name
204
+ */
205
+ type SpaceLabelMapping = {
206
+ [x: string]: string;
207
+ };
208
+ /**
209
+ * - R,G,B color array 0 - 255
210
+ */
211
+ type RGBArray = number[];
212
+ /**
213
+ * Background of the floor plan canvas
214
+ */
215
+ type BackgroundOptions = {
216
+ /**
217
+ * - background-color: hex code for color, set to 'transparent' for transparent background
218
+ */
219
+ color?: string;
220
+ /**
221
+ * - show a dynamic grid
222
+ */
223
+ showGrid?: boolean;
224
+ };
225
+ /**
226
+ * Which unit system and how to display the units
227
+ */
228
+ type Units = {
229
+ /**
230
+ * - meters or feet?
231
+ */
232
+ system?: ('metric' | 'imperial');
233
+ /**
234
+ * - how many digits should be shown?
235
+ */
236
+ digits?: number;
237
+ /**
238
+ * - 12m2 or 4 x 3m ?
239
+ */
240
+ roomDimensions?: ('area' | 'boundingBox');
241
+ };
242
+ type Resources = {
243
+ spaces: Space[];
244
+ assets: Asset[];
245
+ };
246
+ /**
247
+ * Events that are exposed through the floor plan instance
248
+ */
249
+ type FloorPlanEvents = 'click' | 'dblclick' | 'mousemove' | 'drop' | 'viewbox';
250
+ /**
251
+ * Marker instance
252
+ */
253
+ type Marker = {
254
+ /**
255
+ * position of the marker in meters
256
+ */
257
+ pos: Point;
258
+ /**
259
+ * color of the marker
260
+ */
261
+ color: string;
262
+ /**
263
+ * destroys the marker
264
+ */
265
+ remove: Function;
266
+ /**
267
+ * change marker properties
268
+ */
269
+ set: Function;
270
+ /**
271
+ * add event listener to the marker
272
+ */
273
+ on: Function;
274
+ /**
275
+ * remove event listener from the marker
276
+ */
277
+ off: Function;
278
+ };
279
+ /**
280
+ * Info window instance
281
+ */
282
+ type InfoWindow = {
283
+ /**
284
+ * - pixel width of the window
285
+ */
286
+ width: number;
287
+ /**
288
+ * - pixel height of the window
289
+ */
290
+ height: number;
291
+ /**
292
+ * - html string as content of the info window
293
+ */
294
+ html: string;
295
+ /**
296
+ * - If true , a close button is visible in the top right corner of the info window
297
+ */
298
+ closeButton: boolean;
299
+ /**
300
+ * - position of the info window
301
+ */
302
+ pos: Point;
303
+ /**
304
+ * - destroys the info window
305
+ */
306
+ remove: Function;
307
+ /**
308
+ * - change info window properties
309
+ */
310
+ set: Function;
311
+ };
312
+ /**
313
+ * create a html marker that has a fix position on the floor plan
314
+ */
315
+ type HtmlMarker = {
316
+ /**
317
+ * - Dom Element to be added to the floor plan
318
+ */
319
+ el: Element;
320
+ /**
321
+ * - floor plan coordinates for the marker
322
+ */
323
+ pos: number[];
324
+ /**
325
+ * - pixel offset for the marker
326
+ */
327
+ offset: number[];
328
+ /**
329
+ * - destroys the html marker
330
+ */
331
+ remove: Function;
332
+ /**
333
+ * - change html marker properties .set({pos, offset})
334
+ */
335
+ set: Function;
336
+ };
337
+ /**
338
+ * Computed properties for spaces in the floor plan
339
+ */
340
+ type Space = {
341
+ /**
342
+ * Area in square meters
343
+ */
344
+ area: number;
345
+ /**
346
+ * axis aligned bounding box in world coordinates
347
+ */
348
+ boundingBox: BoundingBox;
349
+ /**
350
+ * center defined as most distant point from the contour
351
+ */
352
+ center: Point;
353
+ /**
354
+ * Array of [assets](#Asset) ids in the space
355
+ */
356
+ assets: string[];
357
+ /**
358
+ * unique identifier of the space
359
+ */
360
+ id: string;
361
+ /**
362
+ * optional custom id
363
+ */
364
+ customId: string;
365
+ /**
366
+ * custom space name
367
+ */
368
+ name: string;
369
+ /**
370
+ * reference to the corresponding scene node
371
+ */
372
+ node: SceneNode;
373
+ /**
374
+ * contour of the space in world coordinates
375
+ */
376
+ polygon: Point[];
377
+ /**
378
+ * optional holes of the space in world coordinates
379
+ */
380
+ polygonHoles: Point[];
381
+ /**
382
+ * Human readable description of space usage, e.g. "Work"
383
+ */
384
+ usage: string;
385
+ };
386
+ /**
387
+ * Computed properties for assets in the floor plan
388
+ */
389
+ type Asset = {
390
+ /**
391
+ * axis aligned bounding box in world coordinates
392
+ */
393
+ boundingBox: BoundingBox;
394
+ /**
395
+ * unique identifier of the asset resource
396
+ */
397
+ id: string;
398
+ /**
399
+ * optional custom asset id
400
+ */
401
+ customId: string;
402
+ /**
403
+ * reference to the corresponding scene node
404
+ */
405
+ node: SceneNode;
406
+ /**
407
+ * - x, y, z - y is up
408
+ */
409
+ position: {
410
+ x: number;
411
+ y: number;
412
+ z: number;
413
+ };
414
+ /**
415
+ * - object aligned bounding polygon in world coordinates
416
+ */
417
+ polygon: Point[];
418
+ /**
419
+ * - 3D dimensions
420
+ */
421
+ dimensions: Dimensions;
422
+ /**
423
+ * - categories of the asset
424
+ */
425
+ categories: string[];
426
+ /**
427
+ * - subCategories of the asset
428
+ */
429
+ subCategories: string[];
430
+ /**
431
+ * - Manufacturer
432
+ */
433
+ manufacturer: string;
434
+ /**
435
+ * - Name of the product
436
+ */
437
+ name: string;
438
+ /**
439
+ * - unique identifier of the product
440
+ */
441
+ productId: string;
442
+ /**
443
+ * - descriptive tags
444
+ */
445
+ tags: string[];
446
+ };
447
+ /**
448
+ * - Axis aligned 2D bounding box
449
+ */
450
+ type BoundingBox = {
451
+ /**
452
+ * - dimension on the x axis
453
+ */
454
+ length: number;
455
+ /**
456
+ * - dimension on the z axis
457
+ */
458
+ width: number;
459
+ /**
460
+ * - x min
461
+ */
462
+ x: number;
463
+ /**
464
+ * - x max
465
+ */
466
+ x2: number;
467
+ /**
468
+ * - z min
469
+ */
470
+ z: number;
471
+ /**
472
+ * - z max
473
+ */
474
+ z2: number;
475
+ };
476
+ /**
477
+ * - 3D Dimensions of the object aligned bounding box
478
+ */
479
+ type Dimensions = {
480
+ /**
481
+ * - dimension on the x axis
482
+ */
483
+ length: number;
484
+ /**
485
+ * - dimension on the z axis
486
+ */
487
+ width: number;
488
+ /**
489
+ * - dimension on the y axis ( up )
490
+ */
491
+ height: number;
492
+ };
493
+ type NodeTheme = {
494
+ fill?: RGBArray;
495
+ fillOpacity?: number;
496
+ outline?: RGBArray;
497
+ outlineWidth?: number;
498
+ };
499
+ type SceneNode = {
500
+ /**
501
+ * - Method to highlight a node, call with no argument to reset
502
+ */
503
+ setHighlight: (args?: NodeTheme) => void;
504
+ };
505
+ /**
506
+ * 2D Point with x and z coordinates, the array has exactly 2 entries ( x and z because y is up in our 3D space )
507
+ */
508
+ type Point = [number, number];
509
+ /**
510
+ * @typedef {Object} StartupOptions
511
+ * @property {HideableElement[]} [hideElements = []] - option to hide certain elements
512
+ * @property {boolean} [panZoom = true] - option to disable panning and zooming
513
+ * @property {number} [panZoomMargin] - if set panning and zooming is restricted to the scene boundingbox plus the margin
514
+ * @property {number} [planRotation = 0] - rotation angle for the floor plan in degrees (counterclockwise)
515
+ * @property {ViewboxAnchor} [preserveViewbox = 'center-center'] - where the floor plan should be anchored to if the viewport resizes
516
+ * @property {number} [roomStampSize] - if set room stamps have a fixed size - otherwise they adapt to the zoom level
517
+ * @property {UI} [ui] - toggle overlaying UI elements
518
+ * @property {Theme} [theme] - floor plan theming
519
+ * @property {SpaceLabelMapping} [spaceLabelMapping] - mapping table for custom space labels
520
+ * @property {Units} [units] - set the unit system
521
+ */
522
+ /**
523
+ * @typedef {Object} AccessToken
524
+ * @property {string} [publishableToken] - Space API v2 [publishable access token.](../space-api/v2/introduction.md#publishable-access-token)
525
+ * @property {string} [authorization] - Authorization header value for a Space API v2 [temporary access token.](../space-api/v2/introduction.md#temporary-access-token)
526
+ */
527
+ /**
528
+ * Viewbox anchor described as `<x-axis>-<y-axis>`. This describes where the floor plan should be anchored to if the viewport (ie. the containing DOM element) resizes
529
+ * @typedef {'left-top'|'left-center'|'left-bottom'|'center-top'|'center-center'|'center-bottom'|'right-top'|'right-center'|'right-bottom'} ViewboxAnchor
530
+ */
531
+ /**
532
+ * Elements that can be hidden in the floor plan
533
+ * @typedef {'interior'|'roomStamp'} HideableElement
534
+ */
535
+ /**
536
+ * @typedef {Object} UI
537
+ * @property {boolean} [menu = true] - Shows bottom left menu buttons that include the measuring tool and a zoom extents button
538
+ * @property {boolean} [scale = true] - Show a dynamic scale indicator
539
+ * @property {boolean} [coordinates = true] - Show the current cursor position in plan coordinates
540
+ */
541
+ /**
542
+ * Space properties that can be shown in room stamps
543
+ * @typedef {'area'|'customId'|'name'|'usage'} RoomStampEntry
544
+ */
545
+ /**
546
+ * This is the place to give the floor plan your own style
547
+ * @typedef {Object} Theme
548
+ * @property {BackgroundOptions} [background] - define the background
549
+ * @property {boolean} [wallContours = false] - wall contours are merged to one continuous outline, needed if you want white walls
550
+ * @property {boolean} [showAssetTextures = false] - render assets with textures rather than solid colors
551
+ * @property {Elements} [elements]
552
+ */
553
+ /**
554
+ * @typedef {Object} Elements
555
+ * @property {NodeTheme} [asset]
556
+ * @property {RoomStampTheme} [roomStamp]
557
+ * @property {SpaceTheme} [space]
558
+ * @property {NodeTheme} [wall]
559
+ * @property {NodeTheme} [wallContour]
560
+ */
561
+ /**
562
+ * @typedef {Object} RoomStampTheme
563
+ * @property {RoomStampEntry[]} [roomStampDisplay] - show the usage information in room stamps
564
+ * @property {boolean} [showUsage = true] - Deprecated: show the usage information in room stamps
565
+ * @property {boolean} [showArea = true] - Deprecated: show the area information in room stamps
566
+ * @property {RGBArray} [text] - text color for room stamps
567
+ * @property {boolean} [textOutline = true] - whether the room stamp text should have an outline to assist with contrast issues
568
+ */
569
+ /**
570
+ * @typedef {'care' | 'circulate' | 'drive' | 'live' | 'meet' | 'operate' | 'socialize' | 'support' | 'wash' | 'work'} SpaceProgram
571
+ */
572
+ /**
573
+ * @typedef {Object} SpaceTheme
574
+ * @property {RGBArray} [fill] - set fill for all spaces
575
+ * @property {number} [fillOpacity] - set fillOpacity for all spaces
576
+ * @property {RGBArray} [outline] - set outline for all spaces
577
+ * @property {number} [outlineWidth] - set outlineWidth for all spaces
578
+ * @property {{ [key in SpaceProgram]?: NodeTheme }} [program] - set style by space program
579
+ * @property {Object.<string, NodeTheme>} [usage] - set style by space usage
580
+ */
581
+ /**
582
+ * Map space labels by space usage or space id to a custom name
583
+ * @typedef {Object.<string, string>} SpaceLabelMapping
584
+ * @example { kitchen: 'cuisine' }
585
+ */
586
+ /**
587
+ * @typedef {number[]} RGBArray - R,G,B color array 0 - 255
588
+ */
589
+ /**
590
+ * Background of the floor plan canvas
591
+ * @typedef {Object} BackgroundOptions
592
+ * @property {string} [color = #f3f5f8] - background-color: hex code for color, set to 'transparent' for transparent background
593
+ * @property {boolean} [showGrid = true] - show a dynamic grid
594
+ */
595
+ /**
596
+ * Which unit system and how to display the units
597
+ * @typedef {Object} Units
598
+ * @property {('metric'|'imperial')} [system = metric] - meters or feet?
599
+ * @property {number} [digits = 0] - how many digits should be shown?
600
+ * @property {('area'|'boundingBox')} [roomDimensions = area] - 12m2 or 4 x 3m ?
601
+ */
602
+ /**
603
+ * @typedef {Object} Resources
604
+ * @property {Space[]} resources.spaces
605
+ * @property {Asset[]} resources.assets
606
+ */
607
+ /**
608
+ * The main Floor plan engine SDK class
609
+ */
610
+ declare class FloorPlanEngine {
611
+ /**
612
+ * @param {string | HTMLElement} node - Id of a DOM element
613
+ * @param {StartupOptions} [options] - startupOptions
614
+ * @param {Object} [scene] - optionally initialize floor plan engine with an existing scene class
615
+ */
616
+ constructor(node: string | HTMLElement, options?: StartupOptions, scene?: any);
617
+ /**
618
+ * @type {StartupOptions}
619
+ */
620
+ options: StartupOptions;
621
+ /**
622
+ * @type {Resources}
623
+ */
624
+ resources: Resources;
625
+ /**
626
+ * @private
627
+ */
628
+ private scene;
629
+ version: any;
630
+ utils: {
631
+ polygonOffset: typeof polygonOffset;
632
+ polygonIntersection: typeof polygonIntersection;
633
+ pointInPolygon: typeof pointInPolygon;
634
+ polygonUnion: typeof polygonUnion;
635
+ };
636
+ /**
637
+ * @private
638
+ */
639
+ private initState;
640
+ /**
641
+ * @private
642
+ */
643
+ private state;
644
+ /**
645
+ * @private
646
+ */
647
+ private resetState;
648
+ prevent(e: any): void;
649
+ handleDrop(evt: any): void;
650
+ /**
651
+ * Load a scene with it's unique identifier the sceneId
652
+ * @param {string} sceneId id of the scene to load
653
+ * @param {AccessToken} accessToken Space API v2 [publishable](../space-api/v2/introduction.md#publishable-access-token) or [temporary](../space-api/v2/introduction.md#temporary-access-token) access token
654
+ * @returns {Promise.<Boolean>} returns promise which resolves when loading is done
655
+ */
656
+ loadScene(sceneId: string, accessToken: AccessToken): Promise<boolean>;
657
+ /**
658
+ * Change options after the floor plan engine instance has been created
659
+ * @param {StartupOptions} options - Startup options
660
+ */
661
+ set(options: StartupOptions): void;
662
+ /**
663
+ * @private
664
+ */
665
+ private changeOptions;
666
+ /**
667
+ * dom elements are mounted
668
+ * @private
669
+ */
670
+ private mountFloorPlan;
671
+ fpeNode: HTMLDivElement;
672
+ /**
673
+ * @private
674
+ */
675
+ private generateUi;
676
+ /**
677
+ * Zoom to the extent of the scene in the viewport ( wait for loadScene promise )
678
+ * @param {number} [margin = 1] - margin around scene in meters
679
+ * @param {number|boolean} [animate] - duration of the animation for the viewport transform, if not provided there will be no animation
680
+ * @returns {Promise.<Boolean>} returns promise which resolves when animation is done
681
+ */
682
+ zoomExtents(margin?: number, animate?: number | boolean): Promise<boolean>;
683
+ /**
684
+ * Zoom to the bounding box of an element ( wait for loadScene promise )
685
+ * @param {string | SceneNode} node - id of an asset or a space or the node itself
686
+ * @param {number} [margin = 1] - margin around scene in meters
687
+ * @param {number|boolean} [animate] - duration of the animation for the viewport transform, if not provided there will be no animation
688
+ * @returns {Promise.<Boolean>} returns promise which resolves when animation is done
689
+ */
690
+ zoomToElement(node: string | SceneNode, margin?: number, animate?: number | boolean): Promise<boolean>;
691
+ /**
692
+ * set zoom to a specific bounding box
693
+ * @param {BoundingBox} bb - bounding box
694
+ * @param {number|boolean} [animate] - duration of the animation for the viewport transform, if not provided there will be no animation
695
+ * @returns {Promise.<Boolean>} returns promise which resolves when animation is done
696
+ */
697
+ setZoom(bb: BoundingBox, animate?: number | boolean): Promise<boolean>;
698
+ /**
699
+ * zoom the current view by a factor
700
+ * @param {number} factor - zoom factor, larger than 1 zooms in, smaller than 1 zooms out
701
+ * @param {number|boolean} [animate = true] - duration of the animation for the viewport transform, if not provided there will be no animation
702
+ * @returns {Promise.<Boolean>} returns promise which resolves when animation is done
703
+ */
704
+ zoomByFactor(factor: number, animate?: number | boolean): Promise<boolean>;
705
+ /**
706
+ * Add HTML info window
707
+ * @param {Object} [args] - arguments for the info window
708
+ * @param {Point} [args.pos = [0, 0]] - coordinates of the window in meters
709
+ * @param {number} [args.width = 120] - pixel width of the window
710
+ * @param {number} [args.height = 80] - pixel height of the window
711
+ * @param {string} [args.html] - html string as content of the info window
712
+ * @param {boolean} [args.closeButton = true] - If true , a close button will appear in the top right corner of the info window.
713
+ * @returns {InfoWindow} returns info window instance
714
+ */
715
+ addInfoWindow(args?: {
716
+ pos?: Point;
717
+ width?: number;
718
+ height?: number;
719
+ html?: string;
720
+ closeButton?: boolean;
721
+ }): InfoWindow;
722
+ /**
723
+ * Add custom HTML marker
724
+ * @param {Object} args - arguments for the html marker
725
+ * @param {Element} args.el - DOM element that displays the usage
726
+ * @param {Point} [args.pos = [0, 0]] - plan coordinates of the marker in meters
727
+ * @param {Point} [args.offset = [0, 0]] - screen offset of the marker in pixels
728
+ * @returns {HtmlMarker} returns info html marker instance
729
+ */
730
+ addHtmlMarker(args?: {
731
+ el: Element;
732
+ pos?: Point;
733
+ offset?: Point;
734
+ }): HtmlMarker;
735
+ /**
736
+ * Add plan marker
737
+ * @param {Object} [args] - arguments for the marker
738
+ * @param {Point} [args.pos = [0, 0]] - coordinates of the marker in meters
739
+ * @param {string} [args.color = #669cff] - color of the marker
740
+ * @param {string} [args.size = 40] - size in pixels
741
+ * @returns {Marker} returns marker instance
742
+ */
743
+ addMarker({ pos, color, size }?: {
744
+ pos?: Point;
745
+ color?: string;
746
+ size?: string;
747
+ }): Marker;
748
+ /**
749
+ * Export the current view as an image
750
+ * @param {Object} [args]
751
+ * @param {string} [args.format = png] - output format: png, jpg
752
+ * @param {string} [args.fileName] - fle name relevant if download is true
753
+ * @param {number} [args.quality = 90] - only relevant if format is jpg
754
+ * @param {string} [args.output = base64] - desired output format
755
+ * @param {number} [args.maxWidth] - target width of the image
756
+ * @param {boolean} [args.download = false] - If true, methods triggers a file download directly
757
+ * @returns {Promise.<String>} returns promise which resolves when the file is created
758
+ */
759
+ exportImage(args?: {
760
+ format?: string;
761
+ fileName?: string;
762
+ quality?: number;
763
+ output?: string;
764
+ maxWidth?: number;
765
+ download?: boolean;
766
+ }): Promise<string>;
767
+ /**
768
+ * Convert screen coordinates to plan coordinates
769
+ * @param {Point} pos - Screen coordinates [ x, y ]
770
+ * @returns {Point} returns plan coordinates
771
+ */
772
+ getPlanPosition(point: any): Point;
773
+ /**
774
+ * Convert plan coordinates to screen coordinates
775
+ * @param {Point} pos - Plan coordinates [ x, y ]
776
+ * @returns {Point} returns screen coordinates
777
+ */
778
+ getScreenPosition(point: any): Point;
779
+ /**
780
+ * Get a list of spaces and assets for a specific plan position
781
+ * @param {Point} pos - plan position
782
+ * @returns {{ spaces: Space[], assets: Asset[] }} - list of spaces and assets
783
+ */
784
+ getResourcesFromPosition(pos: Point): {
785
+ spaces: Space[];
786
+ assets: Asset[];
787
+ };
788
+ /**
789
+ * Subscribe to an event
790
+ * @param {FloorPlanEvents} event
791
+ * @param {Function} callback
792
+ * @param {*} [context]
793
+ */
794
+ on(event: FloorPlanEvents, callback: Function, context?: any): void;
795
+ /**
796
+ * Subscribe to an event once
797
+ * @param {FloorPlanEvents} event
798
+ * @param {Function} callback
799
+ * @param {*} [context]
800
+ */
801
+ once(event: FloorPlanEvents, callback: Function, context?: any): void;
802
+ /**
803
+ * Unsubscribe from an event or all events. If no callback is provided, it unsubscribes you from all events
804
+ * @param {FloorPlanEvents} event
805
+ * @param {Function} callback
806
+ * @param {*} [context]
807
+ */
808
+ off(event: FloorPlanEvents, callback: Function, context?: any): void;
809
+ emit(event: any, arg1: any, arg2: any, arg3: any, arg4: any): void;
810
+ /**
811
+ * @private
812
+ */
813
+ private addPlanGraphic;
814
+ /**
815
+ * @private
816
+ */
817
+ private setDrawingPolygon;
818
+ /**
819
+ * @private
820
+ */
821
+ private setDrawingRectangle;
822
+ /**
823
+ * @private
824
+ */
825
+ private setMessage;
826
+ /**
827
+ * Destroy the floor plan instance
828
+ */
829
+ destroy(): void;
830
+ }
831
+
832
+ export { FloorPlanEngine as default };