@smplrspace/smplr-loader 2.19.1-beta.2 → 2.19.1-beta.21

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.
@@ -2,10 +2,16 @@ import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
2
2
  import { CSSProperties } from 'react';
3
3
  import { Dispatch } from 'react';
4
4
  import { FC } from 'react';
5
+ import { IMaybe } from 'mobx-state-tree';
6
+ import { IModelType } from 'mobx-state-tree';
7
+ import { IOptionalIType } from 'mobx-state-tree';
8
+ import { ISimpleType } from 'mobx-state-tree';
9
+ import { _NotCustomized } from 'mobx-state-tree';
5
10
  import { Reducer } from 'react';
6
11
  import { ReducerAction } from 'react';
7
12
  import { RefObject } from 'react';
8
13
  import { Scene } from '@babylonjs/core/scene';
14
+ import { SnapshotOut } from 'mobx-state-tree';
9
15
  import { UniversalCamera } from '@babylonjs/core/Cameras/universalCamera';
10
16
  import { VRDeviceOrientationFreeCamera } from '@babylonjs/core/Cameras/VR/vrDeviceOrientationFreeCamera';
11
17
 
@@ -405,15 +411,19 @@ declare type OnPickFn = (args: { coordinates: SmplrCoord3d; furnitureId?: string
405
411
  declare interface Opening {
406
412
  id: string;
407
413
  name: string;
414
+ type: OpeningType;
408
415
  dimensions: {
409
416
  width: number;
410
417
  height: number;
411
418
  baseHeight: number;
412
419
  };
413
- options: object;
420
+ options: SOWallOpeningOptions;
414
421
  coordinates: SmplrCoord3d[];
422
+ wallId: string;
415
423
  }
416
424
 
425
+ declare type OpeningType = 'door' | 'window';
426
+
417
427
  declare interface OrbitCamera extends ArcRotateCamera {
418
428
  smplrData: {
419
429
  persisted: boolean;
@@ -469,7 +479,7 @@ declare type PointDataLayer<D extends UnknownData = NoData> = BaseDataLayer<Poin
469
479
  declare type PointShapeOptions<D> = SphereOptions<D> | CubeOptions<D>;
470
480
 
471
481
  declare type PolygonData = BaseData & {
472
- coordinates: SmplrCoord2d[];
482
+ coordinates: SmplrCoord2d[] | SmplrCoord2d[][];
473
483
  };
474
484
 
475
485
  declare interface PolygonDataLayer<D extends UnknownData = NoData> extends BaseDataLayer<PolygonData, D> {
@@ -536,10 +546,10 @@ export declare class QueryClient {
536
546
  status: string;
537
547
  name: string;
538
548
  id: string;
549
+ definition?: {} | null | undefined;
539
550
  assetmap?: {} | null | undefined;
540
551
  created_at: string;
541
552
  modified_at: string;
542
- definition?: {} | null | undefined;
543
553
  embed_image?: string | null | undefined;
544
554
  short_code?: string | null | undefined;
545
555
  public_link_enabled: boolean;
@@ -548,10 +558,10 @@ export declare class QueryClient {
548
558
  status: string;
549
559
  name: string;
550
560
  id: string;
561
+ definition?: {} | null | undefined;
551
562
  assetmap?: {} | null | undefined;
552
563
  created_at: string;
553
564
  modified_at: string;
554
- definition?: {} | null | undefined;
555
565
  embed_image?: string | null | undefined;
556
566
  short_code?: string | null | undefined;
557
567
  public_link_enabled: boolean;
@@ -588,12 +598,12 @@ export declare class QueryClient {
588
598
  line: SmplrCoord3d[];
589
599
  unit?: 'ft' | 'm' | 'cm' | 'mm';
590
600
  }): number;
591
- getPolygonArea({ polygon, unit }: {
592
- polygon: SmplrCoord2d[];
601
+ getPolygonArea({ polygon, unit, }: {
602
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
593
603
  unit?: 'sqft' | 'sqm';
594
604
  }): number;
595
605
  getPolygonCenter({ polygon }: {
596
- polygon: SmplrCoord2d[];
606
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
597
607
  }): SmplrCoord2d;
598
608
  getPointsBoundingBox({ points, padding }: {
599
609
  points: SmplrCoord2d[];
@@ -611,25 +621,25 @@ export declare class QueryClient {
611
621
  }): SmplrCoord2d[] | null;
612
622
  isPointInPolygon({ point, polygon }: {
613
623
  point: SmplrCoord2d;
614
- polygon: SmplrCoord2d[];
624
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
615
625
  }): boolean;
616
626
  isFurnitureInPolygon({ spaceId, furnitureId, polygon, }: {
617
627
  spaceId: string;
618
628
  furnitureId: string;
619
- polygon: SmplrCoord2d[];
629
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
620
630
  }): Promise<boolean | null>;
621
631
  isFurnitureInPolygonFromCache({ spaceId, furnitureId, polygon, }: {
622
632
  spaceId: string;
623
633
  furnitureId: string;
624
- polygon: SmplrCoord2d[];
634
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
625
635
  }): boolean | null;
626
636
  getFurnitureInPolygon({ spaceId, polygon, }: {
627
637
  spaceId: string;
628
- polygon: SmplrCoord2d[];
638
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
629
639
  }): Promise<Furniture[]>;
630
- getFurnitureInPolygonFromCache({ spaceId, polygon }: {
640
+ getFurnitureInPolygonFromCache({ spaceId, polygon, }: {
631
641
  spaceId: string;
632
- polygon: SmplrCoord2d[];
642
+ polygon: SmplrCoord2d[] | SmplrCoord2d[][];
633
643
  }): Furniture[];
634
644
  getPointsConcaveHull({ points, simplify, simplifyTolerance, }: {
635
645
  points: SmplrCoord2d[];
@@ -747,6 +757,9 @@ declare interface SmplrScene extends Scene {
747
757
 
748
758
  declare const smplrToCssColor: (c: string) => string;
749
759
 
760
+ declare interface SOWallOpeningOptions extends SnapshotOut<typeof WallOpeningOptions> {
761
+ }
762
+
750
763
  export declare class Space {
751
764
  private options;
752
765
  private viewerStarted;
@@ -835,7 +848,7 @@ declare interface Vector3Coord extends Vector2Coord {
835
848
  z: number;
836
849
  }
837
850
 
838
- export declare const version = "2.19.1-beta.2";
851
+ export declare const version = "2.19.1-beta.21";
839
852
 
840
853
  declare interface ViewerOptions {
841
854
  mode?: CameraMode;
@@ -883,4 +896,36 @@ declare interface ViewerRendererHandle {
883
896
  clearAllEventListeners: EventEmitter['clearAllUserDefinedListeners']
884
897
  }
885
898
 
899
+ declare const WallOpeningOptions: IModelType< {
900
+ style: IOptionalIType<ISimpleType<string>, [undefined]>;
901
+ nbOfPanels: IOptionalIType<ISimpleType<number>, [undefined]>;
902
+ nbOfPanelsVertically: IOptionalIType<ISimpleType<number>, [undefined]>;
903
+ twoPanels: IOptionalIType<ISimpleType<boolean>, [undefined]>;
904
+ centerSplit: IOptionalIType<ISimpleType<boolean>, [undefined]>;
905
+ swapKnob: IOptionalIType<ISimpleType<boolean>, [undefined]>;
906
+ swapInOut: IOptionalIType<ISimpleType<boolean>, [undefined]>;
907
+ swapPanels: IOptionalIType<ISimpleType<boolean>, [undefined]>;
908
+ glass: IOptionalIType<ISimpleType<boolean>, [undefined]>;
909
+ openFrom: IOptionalIType<ISimpleType<string>, [undefined]>;
910
+ panelsOpened: IOptionalIType<ISimpleType<number>, [undefined]>;
911
+ openAngle: IOptionalIType<ISimpleType<number>, [undefined]>;
912
+ railingHeight: IMaybe<ISimpleType<number>>;
913
+ railingStyle: IOptionalIType<ISimpleType<string>, [undefined]>;
914
+ }, {
915
+ setStyle(style: string): void;
916
+ setNbOfPanels(nbOfPanels: number): void;
917
+ setNbOfPanelsVertically(nbOfPanelsVertically: number): void;
918
+ setCenterSplit(centerSplit: boolean): void;
919
+ setSwapKnob(swapKnob: boolean): void;
920
+ setSwapInOut(swapInOut: boolean): void;
921
+ setSwapPanels(swapPanels: boolean): void;
922
+ setTwoPanels(twoPanels: boolean): void;
923
+ setGlass(glass: boolean): void;
924
+ setOpenFrom(openFrom: string): void;
925
+ setPanelsOpened(panelsOpened: number): void;
926
+ setOpenAngle(openAngle: number): void;
927
+ setRailingHeight(railingHeight: number): void;
928
+ setRailingStyle(railingStyle: string): void;
929
+ }, _NotCustomized, _NotCustomized>;
930
+
886
931
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smplrspace/smplr-loader",
3
- "version": "2.19.1-beta.2",
3
+ "version": "2.19.1-beta.21",
4
4
  "description": "NPM package to load a typed Smplr.js from CDN easily",
5
5
  "type": "module",
6
6
  "files": [