vis-core 0.33.1 → 0.33.3

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/dist/index.d.ts CHANGED
@@ -24,7 +24,6 @@ import { Position } from 'geojson';
24
24
  import { ProjectionOptions } from 'gl-draw';
25
25
  import { RectAreaLightObject } from 'gl-draw';
26
26
  import { RestoreBaseObjectOptions } from 'gl-draw';
27
- import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';
28
27
  import { SceneSnapshot } from 'gl-draw';
29
28
  import { SpotLightObject } from 'gl-draw';
30
29
  import { SpriteObject } from 'gl-draw';
@@ -112,8 +111,6 @@ declare class Base_2 extends Camera {
112
111
  lead: Lead;
113
112
  sceneResources: default_2['sceneResources'];
114
113
  tier0: boolean;
115
- pmremGenerator: THREE.PMREMGenerator | null;
116
- re: RoomEnvironment | null;
117
114
  roomEnvMap?: THREE.Texture;
118
115
  private roomEnvTarget?;
119
116
  private roomEnvLease?;
@@ -479,6 +476,7 @@ export declare function createRuntimeSceneDocument(document: VisSceneDocument):
479
476
  /** Convert authored asset aliases to the native catalog expected by graph restoration. */
480
477
  export declare function createRuntimeSceneGraph(scene: SceneViewportDocument, options?: {
481
478
  omitPrefabPreviews?: boolean;
479
+ /* Excluded from this release type: consumeInput */
482
480
  }): Record<string, any>;
483
481
 
484
482
  declare class DirectionalLight extends DirectionalLightObject {
@@ -590,6 +588,8 @@ declare class Event_2 {
590
588
  dispose(): void;
591
589
  }
592
590
 
591
+ /* Excluded from this release type: expandOwnedSceneDocumentResources */
592
+
593
593
  /** Expand at the editor import boundary so independently edited scenes own their data. */
594
594
  export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
595
595
 
@@ -679,7 +679,7 @@ declare class Map_3 extends Base_2 {
679
679
  get adcode(): number | undefined;
680
680
  activePlaneMap: PlaneMap | null;
681
681
  /** 宿主大屏图表等遮挡形成的运行时安全区;不写入场景 options。 */
682
- private safeAreaInsets;
682
+ private safeAreaInsets?;
683
683
  private safeAreaRefitPending;
684
684
  parentBg: PlaneMap[];
685
685
  continentsBg?: ContinentsBg;
@@ -695,6 +695,8 @@ declare class Map_3 extends Base_2 {
695
695
  * 和 sceneBindings,因此在场景刚恢复时记录,供后续 fitTo 复用设计师视角。
696
696
  */
697
697
  private regionCameraFitReference?;
698
+ private authoredCameraPose?;
699
+ private cameraAngleOverrides?;
698
700
  setOptions(options: MapOptions): void;
699
701
  private _getProjectionCenter;
700
702
  private _getProjectionRotate;
@@ -780,16 +782,19 @@ declare class Map_3 extends Base_2 {
780
782
  private _loadBaseGeojson;
781
783
  private getGeojson;
782
784
  /* Excluded from this release type: buildRegion */
785
+ /** 流式读取实际世界坐标,不复制或持有地图几何。 */
786
+ private cameraFitPoints;
787
+ private cameraForPose;
788
+ private captureCameraFitReference;
789
+ /** 没有选中命名视角时,使用导出场景中的实际相机朝向和位置。 */
790
+ private readAuthoredCameraPose;
791
+ private getCameraFitReference;
783
792
  private calcPaddingFromReference;
784
793
  fitTo(obj: BaseObject, { polarAngle, azimuthAngle, reference, z, handleStart, adcode, enableTransition, smoothTime, }?: {
785
794
  adcode?: number;
786
795
  polarAngle?: number;
787
796
  azimuthAngle?: number;
788
- reference?: {
789
- lookat: [number, number, number, number, number, number];
790
- adcode?: number;
791
- center?: [number, number];
792
- };
797
+ reference?: MapCameraFitReference;
793
798
  enableTransition?: boolean;
794
799
  smoothTime?: number;
795
800
  z?: number;
@@ -804,10 +809,10 @@ declare class Map_3 extends Base_2 {
804
809
  adcode: number;
805
810
  extrudelineBloom?: boolean;
806
811
  }): Promise<PlaneMap>;
807
- private hasSafeAreaInsets;
808
812
  private getEffectiveSafeAreaPadding;
809
- getSafeAreaInsets(): MapSafeAreaInsets;
810
- setSafeAreaInsets(insets: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
813
+ /** undefined 表示沿用设计师构图;对象(包括全 0)表示宿主覆盖。 */
814
+ getSafeAreaInsets(): MapSafeAreaInsets | undefined;
815
+ setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
811
816
  refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<void>;
812
817
  findAdcodeInfo(adcode: number): {
813
818
  adcode: number;
@@ -868,6 +873,20 @@ declare interface MapAssetSources {
868
873
  };
869
874
  }
870
875
 
876
+ declare interface MapCameraFitReference {
877
+ lookat: MapCameraPose;
878
+ adcode?: number;
879
+ /** 兼容原有 reference 输入;留白计算使用真实地图几何。 */
880
+ center?: [number, number];
881
+ padding?: MapSafeAreaInsets;
882
+ viewport?: {
883
+ width: number;
884
+ height: number;
885
+ };
886
+ }
887
+
888
+ declare type MapCameraPose = [number, number, number, number, number, number];
889
+
871
890
  declare interface MapCityOptions extends MapOptions {
872
891
  cacheCity?: boolean;
873
892
  nearbyCities?: boolean | 'full';
@@ -1017,6 +1036,8 @@ export declare interface MaterialDefinitionScope {
1017
1036
  /** One explicit mapping from an asset's authored resource UUIDs to runtime resource UUIDs. */
1018
1037
  export declare function materializeAssetDefinition(asset: MaterialAsset, materialUuid?: string): Record<string, any>;
1019
1038
 
1039
+ /* Excluded from this release type: materializeOwnedProjectMaterials */
1040
+
1020
1041
  /** Mutate a detached working snapshot owned exclusively by the caller. */
1021
1042
  export declare function materializeOwnedSceneMaterials<T extends SceneViewportDocument>(scene: T, library?: MaterialAsset[]): T;
1022
1043
 
@@ -1140,10 +1161,11 @@ declare class Mountain extends GroupObject {
1140
1161
  }[];
1141
1162
  create(): Promise<void>;
1142
1163
  setNoise(geometry: THREE.BufferGeometry, image: HTMLImageElement, maxHeight?: number): void;
1143
- render(): void;
1144
1164
  rebuildFromScene(): void;
1145
1165
  }
1146
1166
 
1167
+ /* Excluded from this release type: normalizeOwnedProjectMaterials */
1168
+
1147
1169
  /** Bind serialized runtime materials and alias catalogs to authored assets. */
1148
1170
  export declare function normalizeProjectMaterials<T extends VisSceneDocument>(document: T): T;
1149
1171
 
@@ -1323,6 +1345,8 @@ declare class PlaneMap extends GroupObject {
1323
1345
  mergeSideArea: ExtrudePolygonObject | null;
1324
1346
  extrudelineArr?: LineObject[];
1325
1347
  splitPolygons: number;
1348
+ private standaloneHideMaterial?;
1349
+ private getHideMaterial;
1326
1350
  constructor(options: Options);
1327
1351
  create(): Promise<void>;
1328
1352
  private markGeneratedObjects;
@@ -1403,6 +1427,8 @@ export declare interface PrefabAsset {
1403
1427
  revision: number;
1404
1428
  /** Stable public SDK identifier. Omit for assets used only by the editor. */
1405
1429
  sdkKey?: string;
1430
+ /** Legacy business templates own complete material snapshots, without promoting scene assets. */
1431
+ materialMode?: 'embedded';
1406
1432
  snapshot: Record<string, any>;
1407
1433
  }
1408
1434
 
@@ -1557,7 +1583,7 @@ export declare class SceneManager extends Event_2 {
1557
1583
  private isSwitching;
1558
1584
  private isRegionSwitching;
1559
1585
  private pencil?;
1560
- private safeAreaInsets;
1586
+ private safeAreaInsets?;
1561
1587
  private generation;
1562
1588
  private documentIdentityRevision;
1563
1589
  private preparedStructures;
@@ -1571,16 +1597,21 @@ export declare class SceneManager extends Event_2 {
1571
1597
  private debugInteraction;
1572
1598
  private enablePickDebug;
1573
1599
  private disposeInactiveScenes;
1600
+ /** Retire inactive pages after the host accepts navigation; failures never undo the active page. */
1601
+ trimInactiveScenes(): unknown[];
1602
+ /** Update host navigation policy when lifecycle scripts change between scene activations. */
1603
+ setSceneCachePolicy(cacheScenes: boolean, maxCachedScenes?: number | undefined): void;
1604
+ private reportSceneRetirementErrors;
1574
1605
  constructor(options: SceneManagerInitOptions);
1575
1606
  private prepareScene;
1576
1607
  /** Publish one identity remap without exporting runtimes or copying other pages/resources. */
1577
1608
  remapCommittedIdentity(sceneId: string, previous: string, next: string, objectIdentity: boolean): boolean;
1578
1609
  /**
1579
1610
  * 设置宿主界面的运行时地图安全区。该状态不进入场景文档,并会自动传给
1580
- * 当前地图、缓存地图和后续创建的地图区域。
1611
+ * 当前、缓存和加载中的地图。对象(包括全 0)替代设计留白;undefined 清除覆盖。
1581
1612
  */
1582
- setSafeAreaInsets(insets: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
1583
- getSafeAreaInsets(): MapSafeAreaInsets;
1613
+ setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
1614
+ getSafeAreaInsets(): MapSafeAreaInsets | undefined;
1584
1615
  private captureCamera;
1585
1616
  private playTransition;
1586
1617
  /** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
@@ -1655,8 +1686,6 @@ export declare class SceneManager extends Event_2 {
1655
1686
  switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
1656
1687
  /**
1657
1688
  * 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
1658
- * 适合预制件场景:调用方可从返回实例取对象,再通过 instantiate({ target })
1659
- * 直接实例化到当前场景。
1660
1689
  */
1661
1690
  preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_2>;
1662
1691
  /** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
@@ -1713,6 +1742,8 @@ export declare interface SceneManagerBehaviorOptions {
1713
1742
  prepareScene?: (scene: Base_2) => void;
1714
1743
  /** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
1715
1744
  cacheScenes?: boolean;
1745
+ /** Pages retained after navigation, including the active page; oldest inactive pages retire first. */
1746
+ maxCachedScenes?: number;
1716
1747
  /** 自定义分包场景读取器;可从 IndexedDB 等非 HTTP 存储按需读取。 */
1717
1748
  loadScene?: (entry: SceneManifestEntry) => Promise<SceneViewportDocument>;
1718
1749
  }
@@ -1978,7 +2009,7 @@ declare interface TweenOptions {
1978
2009
 
1979
2010
  export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
1980
2011
 
1981
- export declare const VERSION = "0.33.1";
2012
+ export declare const VERSION = "0.33.3";
1982
2013
 
1983
2014
  export declare interface VisSceneDocument extends SceneDocumentMarker {
1984
2015
  entrySceneId: string;