vis-core 0.33.0 → 0.33.2

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
@@ -87,7 +87,7 @@ declare class Area extends GroupObject {
87
87
  }
88
88
 
89
89
  /** Validation is read-only and does not materialize or allocate runtime resources. */
90
- export declare function assertProjectMaterials(document: Pick<VisSceneDocument, 'schemaVersion' | 'scenes' | 'materialLibrary' | 'prefabLibrary'>): void;
90
+ export declare function assertProjectMaterials(document: Pick<VisSceneDocument, 'schemaVersion' | 'scenes' | 'materialLibrary' | 'prefabLibrary' | '_resourcePool'>): void;
91
91
 
92
92
  /** vis-core 的运行时入口只接受编辑平台导出的完整场景文档。 */
93
93
  export declare function assertRuntimeSceneDocument(value: unknown): asserts value is VisSceneDocument & Record<string, any>;
@@ -479,6 +479,7 @@ export declare function createRuntimeSceneDocument(document: VisSceneDocument):
479
479
  /** Convert authored asset aliases to the native catalog expected by graph restoration. */
480
480
  export declare function createRuntimeSceneGraph(scene: SceneViewportDocument, options?: {
481
481
  omitPrefabPreviews?: boolean;
482
+ /* Excluded from this release type: consumeInput */
482
483
  }): Record<string, any>;
483
484
 
484
485
  declare class DirectionalLight extends DirectionalLightObject {
@@ -590,6 +591,8 @@ declare class Event_2 {
590
591
  dispose(): void;
591
592
  }
592
593
 
594
+ /* Excluded from this release type: expandOwnedSceneDocumentResources */
595
+
593
596
  /** Expand at the editor import boundary so independently edited scenes own their data. */
594
597
  export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
595
598
 
@@ -1001,7 +1004,7 @@ export declare interface MaterialAsset {
1001
1004
  revision: number;
1002
1005
  scope: MaterialScope;
1003
1006
  name: string;
1004
- /** A complete Material.toJSON() value, including texture and image dependencies. */
1007
+ /** Complete Material.toJSON(); schema 6 exports may pool image/texture payloads. */
1005
1008
  material: Record<string, any>;
1006
1009
  locked?: boolean;
1007
1010
  }
@@ -1017,6 +1020,8 @@ export declare interface MaterialDefinitionScope {
1017
1020
  /** One explicit mapping from an asset's authored resource UUIDs to runtime resource UUIDs. */
1018
1021
  export declare function materializeAssetDefinition(asset: MaterialAsset, materialUuid?: string): Record<string, any>;
1019
1022
 
1023
+ /* Excluded from this release type: materializeOwnedProjectMaterials */
1024
+
1020
1025
  /** Mutate a detached working snapshot owned exclusively by the caller. */
1021
1026
  export declare function materializeOwnedSceneMaterials<T extends SceneViewportDocument>(scene: T, library?: MaterialAsset[]): T;
1022
1027
 
@@ -1140,10 +1145,11 @@ declare class Mountain extends GroupObject {
1140
1145
  }[];
1141
1146
  create(): Promise<void>;
1142
1147
  setNoise(geometry: THREE.BufferGeometry, image: HTMLImageElement, maxHeight?: number): void;
1143
- render(): void;
1144
1148
  rebuildFromScene(): void;
1145
1149
  }
1146
1150
 
1151
+ /* Excluded from this release type: normalizeOwnedProjectMaterials */
1152
+
1147
1153
  /** Bind serialized runtime materials and alias catalogs to authored assets. */
1148
1154
  export declare function normalizeProjectMaterials<T extends VisSceneDocument>(document: T): T;
1149
1155
 
@@ -1323,6 +1329,8 @@ declare class PlaneMap extends GroupObject {
1323
1329
  mergeSideArea: ExtrudePolygonObject | null;
1324
1330
  extrudelineArr?: LineObject[];
1325
1331
  splitPolygons: number;
1332
+ private standaloneHideMaterial?;
1333
+ private getHideMaterial;
1326
1334
  constructor(options: Options);
1327
1335
  create(): Promise<void>;
1328
1336
  private markGeneratedObjects;
@@ -1403,6 +1411,8 @@ export declare interface PrefabAsset {
1403
1411
  revision: number;
1404
1412
  /** Stable public SDK identifier. Omit for assets used only by the editor. */
1405
1413
  sdkKey?: string;
1414
+ /** Legacy business templates own complete material snapshots, without promoting scene assets. */
1415
+ materialMode?: 'embedded';
1406
1416
  snapshot: Record<string, any>;
1407
1417
  }
1408
1418
 
@@ -1481,11 +1491,14 @@ declare interface RuntimeImageAsset {
1481
1491
 
1482
1492
  export declare const SCENE_DOCUMENT_FORMAT: "vis-scene";
1483
1493
 
1484
- export declare const SCENE_DOCUMENT_SCHEMA_VERSION: 5;
1494
+ /** Schema 6 extends the document pool to authored material dependencies. */
1495
+ export declare const SCENE_DOCUMENT_RESOURCE_POOL_SCHEMA_VERSION: 6;
1496
+
1497
+ export declare const SCENE_DOCUMENT_SCHEMA_VERSION: 6;
1485
1498
 
1486
1499
  export declare const SCENE_MANIFEST_FORMAT: "vis-scene-manifest";
1487
1500
 
1488
- export declare const SCENE_MANIFEST_SCHEMA_VERSION: 2;
1501
+ export declare const SCENE_MANIFEST_SCHEMA_VERSION: 3;
1489
1502
 
1490
1503
  export declare interface SceneBackInteraction {
1491
1504
  trigger: 'click' | 'clickOutside';
@@ -1562,11 +1575,17 @@ export declare class SceneManager extends Event_2 {
1562
1575
  private identityTrackedScenes;
1563
1576
  private prefabOperations;
1564
1577
  private transactionCacheDepth;
1578
+ private materialLibraryResources?;
1565
1579
  private invalidatePendingOperations;
1566
1580
  private assertGeneration;
1567
1581
  private debugInteraction;
1568
1582
  private enablePickDebug;
1569
1583
  private disposeInactiveScenes;
1584
+ /** Retire inactive pages after the host accepts navigation; failures never undo the active page. */
1585
+ trimInactiveScenes(): unknown[];
1586
+ /** Update host navigation policy when lifecycle scripts change between scene activations. */
1587
+ setSceneCachePolicy(cacheScenes: boolean, maxCachedScenes?: number | undefined): void;
1588
+ private reportSceneRetirementErrors;
1570
1589
  constructor(options: SceneManagerInitOptions);
1571
1590
  private prepareScene;
1572
1591
  /** Publish one identity remap without exporting runtimes or copying other pages/resources. */
@@ -1581,6 +1600,10 @@ export declare class SceneManager extends Event_2 {
1581
1600
  private playTransition;
1582
1601
  /** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
1583
1602
  setDocument(document: VisSceneDocument): void;
1603
+ /** Standalone material consumers cannot retain document-level pool references. */
1604
+ private resolvedMaterialLibrary;
1605
+ /** Keep scene payloads lazy, while independent material APIs own a resolved catalog. */
1606
+ private ownDocument;
1584
1607
  private syncPrefabLibraries;
1585
1608
  /**
1586
1609
  * Replace the complete metadata projection for existing scenes without
@@ -1647,8 +1670,6 @@ export declare class SceneManager extends Event_2 {
1647
1670
  switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
1648
1671
  /**
1649
1672
  * 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
1650
- * 适合预制件场景:调用方可从返回实例取对象,再通过 instantiate({ target })
1651
- * 直接实例化到当前场景。
1652
1673
  */
1653
1674
  preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_2>;
1654
1675
  /** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
@@ -1705,6 +1726,8 @@ export declare interface SceneManagerBehaviorOptions {
1705
1726
  prepareScene?: (scene: Base_2) => void;
1706
1727
  /** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
1707
1728
  cacheScenes?: boolean;
1729
+ /** Pages retained after navigation, including the active page; oldest inactive pages retire first. */
1730
+ maxCachedScenes?: number;
1708
1731
  /** 自定义分包场景读取器;可从 IndexedDB 等非 HTTP 存储按需读取。 */
1709
1732
  loadScene?: (entry: SceneManifestEntry) => Promise<SceneViewportDocument>;
1710
1733
  }
@@ -1906,8 +1929,8 @@ declare class SphereShadow extends MeshObject {
1906
1929
  }
1907
1930
 
1908
1931
  /**
1909
- * Creates deployable, independently fetchable scene JSON values. Resources are
1910
- * expanded per scene so loading the entry scene never requires a global pool.
1932
+ * Creates independently fetchable scene JSON values. Manifest 3 owns shared
1933
+ * payloads so scene and catalog copies do not multiply the deployed bytes.
1911
1934
  */
1912
1935
  export declare function splitSceneDocument(document: VisSceneDocument, options?: {
1913
1936
  sceneDirectory?: string;
@@ -1970,12 +1993,12 @@ declare interface TweenOptions {
1970
1993
 
1971
1994
  export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
1972
1995
 
1973
- export declare const VERSION = "0.33.0";
1996
+ export declare const VERSION = "0.33.2";
1974
1997
 
1975
1998
  export declare interface VisSceneDocument extends SceneDocumentMarker {
1976
1999
  entrySceneId: string;
1977
2000
  scenes: SceneViewportDocument[];
1978
- /** Schema 3: image/video/data payloads shared across scenes, never live textures. */
2001
+ /** Schema 3: scene payloads; schema 6 also shares material-library payloads. */
1979
2002
  _resourcePool?: any[];
1980
2003
  /** Schema 4: serializable definitions shared by explicit asset identity. */
1981
2004
  materialLibrary?: MaterialAsset[];
@@ -1989,10 +2012,12 @@ export declare interface VisSceneDocument extends SceneDocumentMarker {
1989
2012
 
1990
2013
  export declare interface VisSceneManifest {
1991
2014
  format: typeof SCENE_MANIFEST_FORMAT;
1992
- schemaVersion: 1 | typeof SCENE_MANIFEST_SCHEMA_VERSION;
2015
+ schemaVersion: 1 | 2 | typeof SCENE_MANIFEST_SCHEMA_VERSION;
1993
2016
  entrySceneId: string;
1994
2017
  scenes: SceneManifestEntry[];
1995
2018
  materialLibrary?: MaterialAsset[];
2019
+ /** Manifest 3: payloads referenced by the material catalog and scene files. */
2020
+ _resourcePool?: any[];
1996
2021
  /** Externalized image files, relative to the manifest URL. */
1997
2022
  imageAssets?: string[];
1998
2023
  /** Reusable definitions. Only assets with sdkKey are available for SDK instantiation. */