vis-core 0.33.5 → 0.33.6

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
@@ -8,6 +8,8 @@ import { baseObjectBounce } from 'gl-draw';
8
8
  import { baseObjectBounceIn } from 'gl-draw';
9
9
  import { baseObjectFadeIn } from 'gl-draw';
10
10
  import { baseObjectFadeOut } from 'gl-draw';
11
+ import { BufferGeometry } from 'three';
12
+ import { ColorRepresentation } from 'three';
11
13
  import { default as default_2 } from 'gl-draw';
12
14
  import { DirectionalLightObject } from 'gl-draw';
13
15
  import { EventEmitter } from 'events';
@@ -18,10 +20,12 @@ import { GeometryDefinition } from 'gl-draw';
18
20
  import { GeoProjection } from 'd3-geo';
19
21
  import { GroupObject } from 'gl-draw';
20
22
  import { HemisphereLightObject } from 'gl-draw';
23
+ import { IUniform } from 'three';
21
24
  import { Lead } from 'gl-draw';
22
25
  import { LineObject } from 'gl-draw';
23
26
  import { Listener } from 'events';
24
27
  import { Matrix4 } from 'three';
28
+ import { Mesh } from 'three';
25
29
  import { MeshLineMaterial } from 'gl-draw';
26
30
  import { MeshObject } from 'gl-draw';
27
31
  import { ModelObject } from 'gl-draw';
@@ -35,21 +39,42 @@ import { Position } from 'geojson';
35
39
  import { ProjectionOptions } from 'gl-draw';
36
40
  import { RectAreaLightObject } from 'gl-draw';
37
41
  import { remapSnapshotAnimationTracks } from 'gl-draw';
42
+ import { ResourceRegistry } from 'gl-draw';
38
43
  import { RestoreBaseObjectOptions } from 'gl-draw';
44
+ import { ReusableObjectResources } from 'gl-draw';
39
45
  import { SceneSnapshot } from 'gl-draw';
46
+ import { ShaderMaterial } from 'three';
40
47
  import { sinusoidalInOut } from 'gl-draw';
41
48
  import { SpotLightObject } from 'gl-draw';
42
49
  import { SpriteObject } from 'gl-draw';
43
50
  import { StructureResources } from 'gl-draw';
51
+ import { Texture } from 'three';
44
52
  import * as THREE from 'three';
45
53
  import { timeOut } from 'gl-draw';
46
54
  import { TubeObject } from 'gl-draw';
47
55
  import { default as TWEEN } from 'three/examples/jsm/libs/tween.module.js';
48
- import { Tween } from 'three/examples/jsm/libs/tween.module.js';
56
+ import { Tween as Tween_2 } from 'three/examples/jsm/libs/tween.module.js';
49
57
  import { TweenOptions } from 'gl-draw';
58
+ import { Vector2 } from 'three';
50
59
  import { Vector3 } from 'three';
51
60
  import { Vector3Tuple } from 'three';
52
- import { Water } from './Water2';
61
+
62
+ export declare const adcodeAll: AdcodeRecords;
63
+
64
+ /** Stable administrative-region data shared by generated records and extensions. */
65
+ export declare interface AdcodeInfo {
66
+ adcode: number;
67
+ lng: number;
68
+ lat: number;
69
+ name: string;
70
+ level: string;
71
+ parent: number;
72
+ c: number[];
73
+ b: number[];
74
+ en_name?: string;
75
+ }
76
+
77
+ export declare type AdcodeRecords = Record<string, AdcodeInfo>;
53
78
 
54
79
  declare class AmbientLight extends AmbientLightObject {
55
80
  constructor(...options: ConstructorParameters<typeof AmbientLightObject>);
@@ -99,7 +124,9 @@ export declare function assertSupportedSceneDocument(value: unknown): void;
99
124
 
100
125
  export declare type Base = Base_2;
101
126
 
102
- declare class Base_2 extends Camera {
127
+ declare type Base_2 = Base_3;
128
+
129
+ declare class Base_3 extends Camera {
103
130
  static VisName: string;
104
131
  runtimePolicy: {
105
132
  observeParentScale: boolean;
@@ -119,7 +146,8 @@ declare class Base_2 extends Camera {
119
146
  private detectRes?;
120
147
  private ownsPencil;
121
148
  private renderingSuspensions;
122
- /* Excluded from this release type: suspendRendering */
149
+ /** Internal: 在运行时创建前也可暂停,保证整个初始化过程不提交中间帧。 */
150
+ suspendRendering(): () => void;
123
151
  private acquireRenderingSuspensions;
124
152
  publicDir: Record<string, string>;
125
153
  private prefabAssets;
@@ -127,7 +155,8 @@ declare class Base_2 extends Camera {
127
155
  private prefabOperations;
128
156
  /** Inspect SDK-enabled definitions without creating scene objects or resources. */
129
157
  getPrefabLibrary(): PrefabAsset[];
130
- /* Excluded from this release type: setPrefabLibrary */
158
+ /** Internal: Update definitions for future instances without rebuilding live content. */
159
+ setPrefabLibrary(assets?: readonly PrefabAsset[], materials?: MaterialAsset[]): void;
131
160
  instantiatePrefab(keyOrAssetId: string, options?: InstantiatePrefabOptions): Promise<BaseObject>;
132
161
  private cancelPrefabOperations;
133
162
  constructor(options: BaseOptions);
@@ -142,12 +171,14 @@ declare class Base_2 extends Camera {
142
171
  private resolveRendererDepthBufferOptions;
143
172
  private showDetectRes;
144
173
  setOptions(options: Record<string, any>): void;
145
- /* Excluded from this release type: fromJSON */
174
+ /** Internal: Scene documents are loaded through SceneManager. */
175
+ fromJSON(jsonOrUrl: Record<string, any> | string, hooksE?: Record<string, any>, restoreOptions?: RestoreBaseObjectOptions): Promise<void>;
146
176
  private runtimeInitialization?;
147
177
  private disposed;
148
178
  private readonly handleObjectIdentityChanged;
149
179
  private readonly handleMaterialIdentityChanged;
150
- /* Excluded from this release type: initializeRuntime */
180
+ /** Internal: 平台旧模板生成也复用这一步;不创建场景内容、不显示。 */
181
+ initializeRuntime(): Promise<void>;
151
182
  /** 子类扩展点:运行环境只初始化一次,适合建立投影和绑定控制器事件。 */
152
183
  protected onRuntimeReady(): Promise<void>;
153
184
  /** 子类扩展点:恢复场景引用和运行时派生状态,不生成地图几何或移动相机。 */
@@ -260,7 +291,7 @@ export declare interface BindMaterialAssetOptions {
260
291
  }
261
292
 
262
293
  /** Bind explicit slots; no render graph is exported to discover the changed rows. */
263
- declare function bindMaterialSlots(document: VisSceneDocument, sceneId: string, assignments: readonly MaterialSlotAssignment[], optionReplacements?: ReadonlyMap<string, ReadonlyMap<string, string>>, optionAssetId?: string): VisSceneDocument;
294
+ export declare function bindMaterialSlots(document: VisSceneDocument, sceneId: string, assignments: readonly MaterialSlotAssignment[], optionReplacements?: ReadonlyMap<string, ReadonlyMap<string, string>>, optionAssetId?: string): VisSceneDocument;
264
295
 
265
296
  declare class Box extends MeshObject {
266
297
  objectType: string;
@@ -406,13 +437,16 @@ export declare function cloneSceneMaterials(document: VisSceneDocument, sourceId
406
437
  /** Rebind internal targets while preserving links to scenes outside the copied set. */
407
438
  export declare function cloneSceneWithIds(scene: SceneViewportDocument, ids: Map<string, string>): SceneViewportDocument;
408
439
 
440
+ /** Reuse only definitions with equal dependency payloads, never a UUID-only cache hit. */
441
+ export declare function collectSceneResourceReuse(target: any, candidates: readonly SceneResourceCandidate[]): Required<ReusableObjectResources>;
442
+
409
443
  /** Configuration and alias values are additional conservative resource roots. */
410
444
  export declare function collectStructureResources(graph: Record<string, any>, roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]): StructureResources;
411
445
 
412
446
  declare class ContinentsBg extends GroupObject {
413
447
  objectType: string;
414
448
  options: Options_5;
415
- mapArr: PlaneMap[];
449
+ mapArr: PlaneMap_2[];
416
450
  constructor(options: Options_5);
417
451
  create(): Promise<void>;
418
452
  getLocationPosition(location: [number, number], name?: string, height?: number): [number, number, number] | undefined;
@@ -436,7 +470,7 @@ export declare function copySnapshotGeometries(snapshot: any, source: BaseObject
436
470
  /** Explicit creation persists even with no aliases or object users. */
437
471
  export declare function createMaterialAsset<T extends VisSceneDocument>(document: T, options: CreateMaterialAssetOptions): T;
438
472
 
439
- declare function createMaterialAssetDocument(document: VisSceneDocument, options: CreateMaterialAssetOptions): VisSceneDocument;
473
+ export declare function createMaterialAssetDocument(document: VisSceneDocument, options: CreateMaterialAssetOptions): VisSceneDocument;
440
474
 
441
475
  export declare interface CreateMaterialAssetOptions {
442
476
  id: string;
@@ -459,9 +493,18 @@ export declare function createRuntimeSceneDocument(document: VisSceneDocument):
459
493
  /** Convert authored asset aliases to the native catalog expected by graph restoration. */
460
494
  export declare function createRuntimeSceneGraph(scene: SceneViewportDocument, options?: {
461
495
  omitPrefabPreviews?: boolean;
462
- /* Excluded from this release type: consumeInput */
496
+ /** Internal: Transfer an exclusively owned scene graph instead of copying it. */
497
+ consumeInput?: boolean;
463
498
  }): Record<string, any>;
464
499
 
500
+ /** Scan each Vis candidate once, including constructor-only material bindings. */
501
+ export declare function createSceneResourceReuseSession(candidates?: readonly SceneResourceCandidate[]): {
502
+ add: (candidate: SceneResourceCandidate) => void;
503
+ collect: (target: any, options?: {
504
+ environment?: () => any;
505
+ }) => Required<ReusableObjectResources>;
506
+ };
507
+
465
508
  /** Reuse renderer indexes while retaining material asset aliases and prefab dependencies. */
466
509
  export declare function createStructureResourceCollector(graph: Record<string, any>): (roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]) => StructureResources;
467
510
 
@@ -471,7 +514,7 @@ declare class DirectionalLight extends DirectionalLightObject {
471
514
  render(): void;
472
515
  }
473
516
 
474
- declare function duplicateMaterialAssetDocument(document: VisSceneDocument, id: string, newId: string, mode: 'asset' | 'object' | 'scene', sceneId: string, objectId?: string, slot?: number): VisSceneDocument;
517
+ export declare function duplicateMaterialAssetDocument(document: VisSceneDocument, id: string, newId: string, mode: 'asset' | 'object' | 'scene', sceneId: string, objectId?: string, slot?: number): VisSceneDocument;
475
518
 
476
519
  /** One-click copy and apply; preserve the source's user-visible scope. */
477
520
  export declare function duplicateMaterialForObject<T extends VisSceneDocument>(document: T, options: Omit<BindMaterialAssetOptions, 'alias'> & {
@@ -499,21 +542,23 @@ export declare function duplicateSceneDocument(before: VisSceneDocument, sceneId
499
542
 
500
543
  export declare type Earth = Earth_2;
501
544
 
502
- declare class Earth_2 extends Base_2 {
545
+ declare type Earth_2 = Earth_3;
546
+
547
+ declare class Earth_3 extends Base_3 {
503
548
  static VisName: string;
504
549
  leftTruck: boolean;
505
550
  options: Required<EarthOptions>;
506
- map: PlaneMap;
551
+ map: PlaneMap_2;
507
552
  sphere?: BaseObject;
508
- secondaryMap?: PlaneMap;
553
+ secondaryMap?: PlaneMap_2;
509
554
  get mapArea(): ExtrudePolygonObject[];
510
555
  setOptions(options: EarthOptions): void;
511
556
  protected applyControlOptions(controls: SceneControlsOptions): void;
512
557
  protected get objectTypes(): {
513
- Earth: Earth_3;
558
+ Earth: Earth_4;
514
559
  SphereShadow: SphereShadow;
515
- Countries: typeof PlaneMap;
516
- PlaneMap: typeof PlaneMap;
560
+ Countries: typeof PlaneMap_2;
561
+ PlaneMap: typeof PlaneMap_2;
517
562
  Point: Point;
518
563
  Arc: ArcObject;
519
564
  Model: ModelObject;
@@ -566,7 +611,7 @@ declare class Earth_2 extends Base_2 {
566
611
  protected onSceneRestored(): Promise<void>;
567
612
  }
568
613
 
569
- declare class Earth_3 extends Sphere {
614
+ declare class Earth_4 extends Sphere {
570
615
  objectType: string;
571
616
  options: Required<Options_2>;
572
617
  constructor(options: Options_2);
@@ -589,6 +634,58 @@ declare interface EarthSceneBindings {
589
634
  secondaryMap?: string;
590
635
  }
591
636
 
637
+ export declare const editorEarthObjects: {
638
+ Earth: typeof Earth_4;
639
+ SphereShadow: typeof SphereShadow;
640
+ Countries: typeof PlaneMap_2;
641
+ PlaneMap: typeof PlaneMap_2;
642
+ Point: Point;
643
+ Arc: ArcObject;
644
+ Model: ModelObject;
645
+ Plane: Plane;
646
+ PlaneShadow: PlaneShadow;
647
+ Sphere: Sphere;
648
+ Sprite: Sprite;
649
+ Box: Box;
650
+ Circle: Circle;
651
+ Tube: TubeObject;
652
+ Ring: Ring;
653
+ AmbientLight: AmbientLight;
654
+ DirectionalLight: DirectionalLight;
655
+ PointLight: PointLight;
656
+ SpotLight: SpotLight;
657
+ HemisphereLight: HemisphereLight;
658
+ RectAreaLight: RectAreaLight;
659
+ Node: NodeObject;
660
+ ExtrudePolygon: ExtrudePolygonObject;
661
+ Line: LineObject;
662
+ Group: GroupObject;
663
+ };
664
+
665
+ export declare const editorObjects: {
666
+ Point: typeof Point;
667
+ Arc: typeof ArcObject;
668
+ Model: typeof ModelObject;
669
+ Plane: typeof Plane;
670
+ PlaneShadow: typeof PlaneShadow;
671
+ Sphere: typeof Sphere;
672
+ Sprite: typeof Sprite;
673
+ Box: typeof Box;
674
+ Circle: typeof Circle;
675
+ Tube: typeof TubeObject;
676
+ Ring: typeof Ring;
677
+ AmbientLight: typeof Lights.AmbientLight;
678
+ DirectionalLight: typeof Lights.DirectionalLight;
679
+ PointLight: typeof Lights.PointLight;
680
+ SpotLight: typeof Lights.SpotLight;
681
+ HemisphereLight: typeof Lights.HemisphereLight;
682
+ RectAreaLight: typeof Lights.RectAreaLight;
683
+ Node: typeof NodeObject;
684
+ ExtrudePolygon: typeof ExtrudePolygonObject;
685
+ Line: typeof LineObject;
686
+ Group: typeof GroupObject;
687
+ };
688
+
592
689
  export declare type EmptySceneDefinition = Omit<SceneViewportDocument, 'scene'>;
593
690
 
594
691
  declare class Event_2 {
@@ -602,7 +699,8 @@ declare class Event_2 {
602
699
  dispose(): void;
603
700
  }
604
701
 
605
- /* Excluded from this release type: expandOwnedSceneDocumentResources */
702
+ /** Internal: Consume an exclusively owned import copy; pooled slots still get independent payloads. */
703
+ export declare function expandOwnedSceneDocumentResources<T extends VisSceneDocument>(expanded: T): T;
606
704
 
607
705
  /** Expand at the editor import boundary so independently edited scenes own their data. */
608
706
  export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
@@ -617,18 +715,10 @@ export declare function extractMaterialDefinition(scene: SceneViewportDocument,
617
715
  * dependencies of the live object. Baselines remain in the copied metadata. */
618
716
  export declare function extractObjectResourceGraph(graph: any, object: any): any;
619
717
 
620
- declare const findAdcodeInfo: (adcode: number) => {
621
- adcode: number;
622
- lng: number;
623
- lat: number;
624
- name: string;
625
- level: string;
626
- parent: number;
627
- c: number[];
628
- b: number[];
629
- } | undefined;
718
+ export declare const findAdcodeInfo: (adcode: number) => AdcodeInfo | undefined;
630
719
 
631
720
  declare type GeoJSON_2 = FeatureCollection<Polygon | MultiPolygon>;
721
+ export { GeoJSON_2 as GeoJSON }
632
722
 
633
723
  declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
634
724
 
@@ -663,6 +753,16 @@ export declare interface GroupObjectsDocumentOptions {
663
753
  declare class HemisphereLight extends HemisphereLightObject {
664
754
  }
665
755
 
756
+ declare type IdentityPath = (string | number)[];
757
+
758
+ export declare function indexedSceneObject(root: any, uuid: string): {
759
+ node: any;
760
+ path: readonly number[];
761
+ } | undefined;
762
+
763
+ /** Property-only immutable copies retain exactly the same UUID paths. */
764
+ export declare function inheritSceneObjectIndex(previous: any, next: any): void;
765
+
666
766
  export declare interface InstantiatePrefabOptions {
667
767
  /** Parent in the destination scene. Defaults to the scene root. */
668
768
  target?: BaseObject;
@@ -670,6 +770,15 @@ export declare interface InstantiatePrefabOptions {
670
770
  cloneMaterial?: boolean;
671
771
  }
672
772
 
773
+ export declare function invalidateSceneObjectIndex(root: object | undefined): void;
774
+
775
+ export declare const isLocalSceneObjectField: (field: string) => boolean;
776
+
777
+ /** Editor integration: avoid applying an explicit host update twice. */
778
+ export declare function isObjectStateUpdateInProgress(object: BaseObject): boolean;
779
+
780
+ export declare const isSceneCameraField: (key: string) => boolean;
781
+
673
782
  /**
674
783
  * 新场景文档以完整场景快照作为恢复基线。
675
784
  * 未带标记的 JSON 属于旧格式,仍由编辑器的兼容流程处理。
@@ -678,44 +787,50 @@ export declare function isSceneDocument(value: unknown): value is SceneDocumentM
678
787
 
679
788
  export declare function isSceneManifest(value: unknown): value is VisSceneManifest;
680
789
 
790
+ export declare const isSceneObjectPropertyField: (field: string) => boolean;
791
+
792
+ declare namespace Lights {
793
+ export {
794
+ AmbientLight,
795
+ DirectionalLight,
796
+ PointLight,
797
+ SpotLight,
798
+ HemisphereLight,
799
+ RectAreaLight
800
+ }
801
+ }
802
+
681
803
  /** Copy once and redirect every user in this scene, including its SceneResources aliases. */
682
804
  export declare function makeMaterialSceneLocal<T extends VisSceneDocument>(document: T, assetId: string, sceneId: string, newAssetId: string): T;
683
805
 
684
806
  declare type Map_2 = Map_3;
685
807
  export { Map_2 as Map }
686
808
 
687
- declare class Map_3 extends Base_2 {
809
+ declare type Map_3 = Map_4;
810
+
811
+ declare class Map_4 extends Base_3 {
688
812
  static VisName: string;
689
813
  options: Required<MapCityOptions>;
690
814
  /** 当前唯一主地图的运行时状态。 */
691
815
  mapObj: {
692
- map: PlaneMap;
816
+ map: PlaneMap_2;
693
817
  mapInfo: NonNullable<ReturnType<typeof findAdcodeInfo>>;
694
818
  z: number;
695
819
  cX: number;
696
820
  cY: number;
697
821
  depth: number;
698
822
  } | undefined;
699
- get map(): PlaneMap | undefined;
700
- get mapInfo(): {
701
- adcode: number;
702
- lng: number;
703
- lat: number;
704
- name: string;
705
- level: string;
706
- parent: number;
707
- c: number[];
708
- b: number[];
709
- } | undefined;
823
+ get map(): PlaneMap_2 | undefined;
824
+ get mapInfo(): AdcodeInfo | undefined;
710
825
  get mapArea(): ExtrudePolygonObject[] | undefined;
711
826
  get mapLine(): LineObject[] | undefined;
712
827
  /** 当前已恢复或生成的主地图区域;空场景为 undefined。 */
713
828
  get adcode(): number | undefined;
714
- activePlaneMap: PlaneMap | null;
829
+ activePlaneMap: PlaneMap_2 | null;
715
830
  /** 宿主大屏图表等遮挡形成的运行时安全区;不写入场景 options。 */
716
831
  private safeAreaInsets?;
717
832
  private safeAreaRefitPending;
718
- parentBg: PlaneMap[];
833
+ parentBg: PlaneMap_2[];
719
834
  continentsBg?: ContinentsBg;
720
835
  group: GroupObject;
721
836
  projection: GeoProjection;
@@ -736,7 +851,7 @@ declare class Map_3 extends Base_2 {
736
851
  private _getProjectionRotate;
737
852
  private _getSplitPolygons;
738
853
  protected get objectTypes(): {
739
- PlaneMap: typeof PlaneMap;
854
+ PlaneMap: typeof PlaneMap_2;
740
855
  ContinentsBg: typeof ContinentsBg;
741
856
  Mountain: Mountain;
742
857
  CityPlane: CityPlane;
@@ -772,7 +887,8 @@ declare class Map_3 extends Base_2 {
772
887
  private mapBoundaryEnabled?;
773
888
  private refreshMapBoundary;
774
889
  private updateMapBoundary;
775
- /* Excluded from this release type: finalizeRegionGeometry */
890
+ /** Internal: 新生成区域的收尾;完整快照还原由 onSceneRestored 派生标签。 */
891
+ finalizeRegionGeometry(): Promise<void>;
776
892
  private prepareCityVis;
777
893
  private preloadCityVis;
778
894
  /** Keep at most two cities ahead in the loader; all Lead writes stay ordered. */
@@ -821,7 +937,12 @@ declare class Map_3 extends Base_2 {
821
937
  private _loadGeojsonFromConfig;
822
938
  private _loadBaseGeojson;
823
939
  private getGeojson;
824
- /* Excluded from this release type: buildRegion */
940
+ /** Internal: 生成地图层;导航必须通过 SceneManager。 */
941
+ buildRegion({ adcode, depth, extrudelineBloom, }: {
942
+ adcode: number;
943
+ depth?: number;
944
+ extrudelineBloom?: boolean;
945
+ }): Promise<void>;
825
946
  /** 流式读取实际世界坐标,不复制或持有地图几何。 */
826
947
  private cameraFitPoints;
827
948
  private cameraForPose;
@@ -848,22 +969,13 @@ declare class Map_3 extends Base_2 {
848
969
  depth: number;
849
970
  adcode: number;
850
971
  extrudelineBloom?: boolean;
851
- }): Promise<PlaneMap>;
972
+ }): Promise<PlaneMap_2>;
852
973
  private getEffectiveSafeAreaPadding;
853
974
  /** undefined 表示沿用设计师构图;对象(包括全 0)表示宿主覆盖。 */
854
975
  getSafeAreaInsets(): MapSafeAreaInsets | undefined;
855
976
  setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
856
977
  refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<boolean>;
857
- findAdcodeInfo(adcode: number): {
858
- adcode: number;
859
- lng: number;
860
- lat: number;
861
- name: string;
862
- level: string;
863
- parent: number;
864
- c: number[];
865
- b: number[];
866
- } | undefined;
978
+ findAdcodeInfo(adcode: number): AdcodeInfo | undefined;
867
979
  /**
868
980
  * 根据目标 adcode 更新 options 中依赖 adcode 的字段
869
981
  */
@@ -887,7 +999,8 @@ declare class Map_3 extends Base_2 {
887
999
  * Apply the region behavior authored on each object.
888
1000
  */
889
1001
  private applyRegionObjectState;
890
- /* Excluded from this release type: rebuildRegion */
1002
+ /** Internal: 仅由 SceneManager 在隔离页面调用,成功后才对外提交。 */
1003
+ rebuildRegion(targetAdcode: number, switchKey?: string): Promise<void>;
891
1004
  private rebuildRegionGeometry;
892
1005
  /** 候选区域提交后的相机过渡,不参与场景序列化。 */
893
1006
  playRegionEnterTransition({ duration, sourceCamera, preparedCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
@@ -896,6 +1009,12 @@ declare class Map_3 extends Base_2 {
896
1009
  private setRegionTexture;
897
1010
  applyRegionTextureRules(adcode: number): Promise<void>;
898
1011
  protected onDispose(): void;
1012
+ private static mapCameraContext;
1013
+ private static labelsContext;
1014
+ private static cityLayersContext;
1015
+ private static backgroundsContext;
1016
+ private static regionOverlaysContext;
1017
+ private static regionTexturesContext;
899
1018
  }
900
1019
 
901
1020
  export declare interface MapAnchor {
@@ -1018,7 +1137,8 @@ export declare interface MapRegionBackInteraction {
1018
1137
 
1019
1138
  declare interface MapRegionEnterTransitionOptions extends SceneEnterTransitionOptions {
1020
1139
  sourceCamera?: [number, number, number, number, number, number];
1021
- /* Excluded from this release type: preparedCamera */
1140
+ /** 场景管理器已完成地图和宿主准备后的最终姿态。 */
1141
+ preparedCamera?: [number, number, number, number, number, number];
1022
1142
  }
1023
1143
 
1024
1144
  export declare type MapRegionSceneResolver = (document: VisSceneDocument, adcode: number) => string | SceneViewportDocument | null | undefined | Promise<string | SceneViewportDocument | null | undefined>;
@@ -1110,9 +1230,10 @@ export declare const materialDocumentOperations: Readonly<{
1110
1230
  export declare function materializeAssetDefinition(asset: MaterialAsset, materialUuid?: string): Record<string, any>;
1111
1231
 
1112
1232
  /** Project only changed assets. Object trees and unrelated resource payloads stay borrowed. */
1113
- declare function materializeChangedAssets(document: VisSceneDocument, assets: readonly MaterialAsset[], sceneIds?: ReadonlySet<string>): VisSceneDocument;
1233
+ export declare function materializeChangedAssets(document: VisSceneDocument, assets: readonly MaterialAsset[], sceneIds?: ReadonlySet<string>): VisSceneDocument;
1114
1234
 
1115
- /* Excluded from this release type: materializeOwnedProjectMaterials */
1235
+ /** Internal: Materialize an exclusively owned document while preserving owned geometry tables. */
1236
+ export declare function materializeOwnedProjectMaterials<T extends VisSceneDocument>(document: T): T;
1116
1237
 
1117
1238
  /** Mutate a detached working snapshot owned exclusively by the caller. */
1118
1239
  export declare function materializeOwnedSceneMaterials<T extends SceneViewportDocument>(scene: T, library?: MaterialAsset[]): T;
@@ -1192,11 +1313,18 @@ export declare function moveObjectsDocument(before: VisSceneDocument, sceneId: s
1192
1313
  /** Keep saved texture/image identities stable across runtime namespace and revision changes. */
1193
1314
  export declare function normalizeMaterialDefinition<T extends Record<string, any>>(input: T): T;
1194
1315
 
1195
- /* Excluded from this release type: normalizeOwnedProjectMaterials */
1316
+ /** Internal: Normalize an exclusively owned import copy without copying its geometry payloads. */
1317
+ export declare function normalizeOwnedProjectMaterials<T extends VisSceneDocument>(document: T): T;
1196
1318
 
1197
1319
  /** Bind serialized runtime materials and alias catalogs to authored assets. */
1198
1320
  export declare function normalizeProjectMaterials<T extends VisSceneDocument>(document: T): T;
1199
1321
 
1322
+ /** Paths belong to an immutable serialized object tree, never to live Three.js objects. */
1323
+ declare type ObjectIndex = Map<string, {
1324
+ path: readonly number[];
1325
+ lengths: readonly number[];
1326
+ }>;
1327
+
1200
1328
  declare interface Options {
1201
1329
  /** @deprecated Legacy generation scope, read only when importing old snapshots. */
1202
1330
  uuid?: string;
@@ -1325,11 +1453,23 @@ declare interface Options_9 {
1325
1453
  /** Pack an export copy only; preserve the editor's independent scene snapshots. */
1326
1454
  export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
1327
1455
 
1456
+ /** Clone each affected ancestor/children array once, without visiting other subtrees. */
1457
+ export declare function patchIndexedSceneObjects(root: any, updates: ReadonlyMap<string, {
1458
+ state: Record<string, any>;
1459
+ unset?: string[];
1460
+ }>): any;
1461
+
1462
+ /** Validate only authored scalar fields; the committed baseline already owns the unchanged graph/resources. */
1463
+ export declare function patchSceneObjectPropertiesDocument(document: VisSceneDocument, sceneId: string, patches: readonly SceneObjectPropertyPatch[]): VisSceneDocument;
1464
+
1328
1465
  export declare function patchSceneStructureDocument(document: VisSceneDocument, sceneId: string, patch: SceneStructurePatch): VisSceneDocument;
1329
1466
 
1330
1467
  /** Validate every affected scene and both catalogs before exposing any saved state. */
1331
1468
  export declare function patchSceneStructureTransactionDocument(document: VisSceneDocument, transaction: SceneStructureTransaction): VisSceneDocument;
1332
1469
 
1470
+ /** Own only the small viewport payload and copy the camera's ancestor path. */
1471
+ export declare function patchSceneViewportDocument(document: VisSceneDocument, sceneId: string, patch: SceneViewportPatch): VisSceneDocument;
1472
+
1333
1473
  export declare interface PlanarMap {
1334
1474
  object3d: Object3D;
1335
1475
  options: {
@@ -1343,7 +1483,9 @@ declare class Plane extends MeshObject {
1343
1483
  create(): void;
1344
1484
  }
1345
1485
 
1346
- declare class PlaneMap extends GroupObject {
1486
+ export declare type PlaneMap = PlaneMap_2;
1487
+
1488
+ declare class PlaneMap_2 extends GroupObject {
1347
1489
  objectType: string;
1348
1490
  options: Required<Omit<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>> & Pick<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>;
1349
1491
  isActive: boolean;
@@ -1475,14 +1617,14 @@ export declare function projectLocation(map: PlanarMap, anchor: MapAnchor, mapCR
1475
1617
  scaleBasis: "local spherical approximation";
1476
1618
  };
1477
1619
 
1478
- declare function promoteMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
1620
+ export declare function promoteMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
1479
1621
 
1480
1622
  export declare function promoteMaterialToProject<T extends VisSceneDocument>(document: T, assetId: string): T;
1481
1623
 
1482
1624
  declare class RectAreaLight extends RectAreaLightObject {
1483
1625
  }
1484
1626
 
1485
- declare interface RegionTextureRule {
1627
+ export declare interface RegionTextureRule {
1486
1628
  /** 材质 UUID,或显式材质角色,例如 plane#topMat。 */
1487
1629
  material: string;
1488
1630
  /** THREE.Material 上的纹理属性,例如 map、emissiveMap。 */
@@ -1498,7 +1640,7 @@ declare interface RegionTextureRule {
1498
1640
  }
1499
1641
 
1500
1642
  /** Register imported definitions without normalizing or copying the existing project. */
1501
- declare function registerSceneMaterials(document: VisSceneDocument, sceneId: string, onlyIds?: ReadonlySet<string>): VisSceneDocument;
1643
+ export declare function registerSceneMaterials(document: VisSceneDocument, sceneId: string, onlyIds?: ReadonlySet<string>): VisSceneDocument;
1502
1644
 
1503
1645
  /** Imported data is owned separately; scanning occupied IDs never copies current graphs. */
1504
1646
  export declare function remapImportedMaterials(before: VisSceneDocument, incoming: VisSceneDocument): VisSceneDocument;
@@ -1527,12 +1669,16 @@ export declare function remapProjectMaterialIds<T extends VisSceneDocument>(docu
1527
1669
  */
1528
1670
  export declare function remapSceneDocumentIds(document: VisSceneDocument, createSceneId: (scene: SceneViewportDocument, index: number) => string): RemappedSceneDocument;
1529
1671
 
1672
+ export declare const remapSceneMaterialReferencesCopy: <T>(scene: T, previous: string, next: string) => T;
1673
+
1674
+ export declare const remapSceneObjectReferencesCopy: <T>(scene: T, previous: string, next: string) => T;
1675
+
1530
1676
  export { remapSnapshotAnimationTracks }
1531
1677
 
1532
1678
  /** Copy an authored snapshot with fresh native and authored reference identities. */
1533
1679
  export declare function remapSnapshotIdentity(input: any, rootUuid?: string, sharedResourceIds?: ReadonlyMap<string, string>): any;
1534
1680
 
1535
- declare function removeMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
1681
+ export declare function removeMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
1536
1682
 
1537
1683
  /** Remove selected roots and prune only the authored rules that referred to them. */
1538
1684
  export declare function removeObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[]): VisSceneDocument;
@@ -1541,7 +1687,12 @@ export declare function removeProjectMaterial<T extends VisSceneDocument>(docume
1541
1687
 
1542
1688
  export declare function removeSceneDocument(before: VisSceneDocument, sceneId: string): VisSceneDocument;
1543
1689
 
1544
- declare function replaceMaterialAssetDocument(document: VisSceneDocument, asset: MaterialAsset): VisSceneDocument;
1690
+ export declare function replaceMaterialAssetDocument(document: VisSceneDocument, asset: MaterialAsset): VisSceneDocument;
1691
+
1692
+ export declare const RESOURCE_SOURCE = "_resourceSource";
1693
+
1694
+ /** Stable UUID for an asset's resource instance; content revisions do not change identity. */
1695
+ export declare function resourceInstanceUuid(assetId: string, kind: string, sourceUuid: string): string;
1545
1696
 
1546
1697
  declare class Ring extends MeshObject {
1547
1698
  objectType: string;
@@ -1727,9 +1878,9 @@ export declare class SceneManager extends Event_2 {
1727
1878
  /** A newly hydrated empty Base seed acquires its own camera/default options once. */
1728
1879
  prepareSceneInitialization(sceneId: string, definition: SceneViewportDocument): PreparedSceneStructure;
1729
1880
  /** Collection edits keep cached pages until their enclosing history transaction accepts. */
1730
- activateSceneForTransaction(sceneId: string, hooks?: Record<string, any>, signal?: AbortSignal): Promise<Base_2>;
1881
+ activateSceneForTransaction(sceneId: string, hooks?: Record<string, any>, signal?: AbortSignal): Promise<Base_3>;
1731
1882
  /** Retire exactly the detached page; never invalidate other loaded pages or pending resources. */
1732
- retireSceneForTransaction(sceneId: string, expected: Base_2): void;
1883
+ retireSceneForTransaction(sceneId: string, expected: Base_3): void;
1733
1884
  private ownPreparedStructure;
1734
1885
  private requirePreparedStructure;
1735
1886
  /**
@@ -1741,33 +1892,34 @@ export declare class SceneManager extends Event_2 {
1741
1892
  commitSceneStructure(prepared: PreparedSceneStructure): void;
1742
1893
  /** Commit scalar material history without accepting or copying caller object graphs. */
1743
1894
  patchMaterialDefinitions(assets: MaterialAsset[], scenes: Pick<SceneViewportDocument, 'id'>[], scope?: MaterialDefinitionScope): void;
1744
- load(documentOrUrl: VisSceneDocument | VisSceneManifest | string, hooks?: Record<string, any>): Promise<Base_2>;
1895
+ load(documentOrUrl: VisSceneDocument | VisSceneManifest | string, hooks?: Record<string, any>): Promise<Base_3>;
1745
1896
  /**
1746
1897
  * 创建一个没有快照输入的运行时页面,并在可选构建步骤完成后将其导出为
1747
1898
  * 标准单场景文档。主要供编辑器新建和旧模板迁移使用。
1748
1899
  */
1749
- createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_2) => void | Promise<void>, materialLibrary?: MaterialAsset[]): Promise<Base_2>;
1900
+ createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_3) => void | Promise<void>, materialLibrary?: MaterialAsset[]): Promise<Base_3>;
1750
1901
  /**
1751
1902
  * 以指定地图模板和行政区直接启动,不先加载文档配置的入口场景。
1752
1903
  * 适用于宿主按路由或业务参数决定初始省、市、区的场景。
1753
1904
  */
1754
- loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_3>;
1755
- loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_3>;
1905
+ loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_4>;
1906
+ loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_4>;
1756
1907
  private loadDocument;
1757
1908
  private getSceneMetadata;
1758
1909
  private resolveManifestSource;
1759
1910
  private resolveBundleImages;
1760
1911
  private loadSceneDefinition;
1761
1912
  private createRuntimeSceneDocument;
1762
- switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
1913
+ private definitionLoadingContext;
1914
+ switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_3 | null>;
1763
1915
  /**
1764
1916
  * 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
1765
1917
  * 缓存至少保留当前页和本次预加载页;后续导航恢复配置的缓存上限。
1766
1918
  */
1767
- preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_2>;
1919
+ preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_3>;
1768
1920
  /** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
1769
- editScene(sceneId: string, edit: (scene: Base_2, definition: SceneViewportDocument) => Promise<SceneViewportDocument>, hooks?: Record<string, any>): Promise<Base_2>;
1770
- back(hooks?: Record<string, any>): Promise<Base_2 | null>;
1921
+ editScene(sceneId: string, edit: (scene: Base_3, definition: SceneViewportDocument) => Promise<SceneViewportDocument>, hooks?: Record<string, any>): Promise<Base_3>;
1922
+ back(hooks?: Record<string, any>): Promise<Base_3 | null>;
1771
1923
  /**
1772
1924
  * 切到目标地图场景,并按 adcode 重建其中的地图。sceneId 不同时,语义等价于
1773
1925
  * switchScene(sceneId) 后 switchMapRegion(adcode),但候选场景只在两步都成功后提交,
@@ -1775,17 +1927,17 @@ export declare class SceneManager extends Event_2 {
1775
1927
  * 始终从文档基线构建隔离页面,避免对缓存实例反复施加缩放/删除修正。
1776
1928
  * 旧页面在构建期间保持完整;只有所有资源、几何和交互就绪才提交导航。
1777
1929
  */
1778
- switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Map_3 | null>;
1930
+ switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Map_4 | null>;
1779
1931
  /** 场景切换与区域切换共享一条返回历史。 */
1780
- backMapRegion(hooks?: Record<string, any>): Promise<Base_2 | null>;
1932
+ backMapRegion(hooks?: Record<string, any>): Promise<Base_3 | null>;
1781
1933
  getCurrentSceneId(): string;
1782
1934
  getCurrentScene<T extends SceneType>(type: T): SceneTypeMap[T] | null;
1783
- getCurrentScene(): Base_2 | null;
1935
+ getCurrentScene(): Base_3 | null;
1784
1936
  private getCurrentSceneByType;
1785
1937
  getScene<T extends SceneType>(sceneId: string, type: T): SceneTypeMap[T] | undefined;
1786
- getScene(sceneId: string): Base_2 | undefined;
1938
+ getScene(sceneId: string): Base_3 | undefined;
1787
1939
  getSceneByName<T extends SceneType>(name: string, type: T): SceneTypeMap[T] | undefined;
1788
- getSceneByName(name: string): Base_2 | undefined;
1940
+ getSceneByName(name: string): Base_3 | undefined;
1789
1941
  private getSceneByType;
1790
1942
  /** Inspect saved definitions without creating or pinning runtime materials. */
1791
1943
  getMaterialLibrary(): MaterialAsset[];
@@ -1797,7 +1949,7 @@ export declare class SceneManager extends Event_2 {
1797
1949
  * Reacquire Base/Object handles after this call: replaced pages are disposed.
1798
1950
  * Current runtime geometry, options, active page and camera are preserved.
1799
1951
  */
1800
- updateMaterial(assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): Promise<Base_2 | null>;
1952
+ updateMaterial(assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): Promise<Base_3 | null>;
1801
1953
  /** Immutable borrowed snapshot for coordinated COW editing; write through patch APIs. */
1802
1954
  getDocumentSnapshot(): Readonly<VisSceneDocument> | undefined;
1803
1955
  getDocument(): VisSceneDocument | undefined;
@@ -1816,9 +1968,9 @@ export declare interface SceneManagerBehaviorOptions {
1816
1968
  /** 输出射线命中和场景交互诊断,仅用于开发排查。 */
1817
1969
  debugInteractions?: boolean;
1818
1970
  /** 创建场景后、恢复 JSON 前调用。 */
1819
- prepareScene?: (scene: Base_2) => void;
1971
+ prepareScene?: (scene: Base_3) => void;
1820
1972
  /** 场景与最终相机就绪后、提交和首帧绘制前等待宿主准备。失败时保留原场景。 */
1821
- beforeSceneDisplay?: (scene: Base_2, context: SceneDisplayContext) => void | Promise<void>;
1973
+ beforeSceneDisplay?: (scene: Base_3, context: SceneDisplayContext) => void | Promise<void>;
1822
1974
  /** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
1823
1975
  cacheScenes?: boolean;
1824
1976
  /** Pages retained after navigation (default 8), including the active page; oldest inactive pages retire first. */
@@ -1846,6 +1998,8 @@ export declare interface SceneManifestEntry extends Omit<SceneViewportDocument,
1846
1998
  /** Dependency closure for a selected scene; preserve unused aliases as document uses. */
1847
1999
  export declare function sceneMaterialLibrary(scene: SceneViewportDocument, library?: MaterialAsset[], prefabs?: VisSceneDocument['prefabLibrary']): MaterialAsset[];
1848
2000
 
2001
+ export declare function sceneObjectIndex(root: any): ObjectIndex;
2002
+
1849
2003
  export declare interface SceneObjectPatch {
1850
2004
  uuid: string;
1851
2005
  state: {
@@ -1859,7 +2013,9 @@ export declare interface SceneObjectPatch {
1859
2013
  unset?: ('matrix' | 'matrixAutoUpdate' | 'pivot' | 'name' | 'visible' | 'layers')[];
1860
2014
  }
1861
2015
 
1862
- declare interface SceneObjectPropertyPatch {
2016
+ export declare const sceneObjectPropertyDefaults: Readonly<Record<string, any>>;
2017
+
2018
+ export declare interface SceneObjectPropertyPatch {
1863
2019
  uuid: string;
1864
2020
  state: Record<string, any>;
1865
2021
  unset?: readonly string[];
@@ -1869,6 +2025,12 @@ declare type ScenePropertyField = typeof scenePropertyFields[number];
1869
2025
 
1870
2026
  export declare const scenePropertyFields: readonly ["color", "groundColor", "intensity", "distance", "decay", "angle", "penumbra", "width", "height", "castShadow", "receiveShadow", "frustumCulled", "renderOrder", "up", "center", "shadow", "near", "far", "fov", "aspect", "zoom", "left", "right", "top", "bottom", "focus", "filmGauge", "filmOffset", "view", "backgroundBlurriness", "backgroundIntensity", "environmentIntensity", "backgroundRotation", "environmentRotation"];
1871
2027
 
2028
+ export declare interface SceneResourceCandidate {
2029
+ vis: any;
2030
+ graph: any;
2031
+ root?: any;
2032
+ }
2033
+
1872
2034
  export declare type SceneStructureGraphKey = 'materialAliases' | 'shapes' | '_sharedOptionsPool' | '_texDataPool';
1873
2035
 
1874
2036
  /** Metadata is part of an owned structure transaction, never a scalar runtime patch. */
@@ -1960,9 +2122,9 @@ export declare interface SceneTransitionOptions {
1960
2122
  export declare type SceneType = keyof SceneTypeMap;
1961
2123
 
1962
2124
  export declare interface SceneTypeMap {
1963
- base: Base_2;
1964
- earth: Earth_2;
1965
- map: Map_3;
2125
+ base: Base_3;
2126
+ earth: Earth_3;
2127
+ map: Map_4;
1966
2128
  }
1967
2129
 
1968
2130
  export declare interface SceneViewportDocument {
@@ -2057,11 +2219,14 @@ export { THREE }
2057
2219
 
2058
2220
  export { TWEEN }
2059
2221
 
2060
- export { Tween }
2222
+ export declare type Tween<T extends Record<string, any>> = Tween_2<T>;
2061
2223
 
2062
2224
  export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
2063
2225
 
2064
- export declare const VERSION = "0.33.5";
2226
+ export declare const VERSION = "0.33.6";
2227
+
2228
+ /** Enumerate authored reference fields only; never inspect arbitrary userdata or resource payloads. */
2229
+ export declare function visitSceneIdentityReferences(scene: any, objectIdentity: boolean, visit: (path: IdentityPath, value: any, track?: boolean, key?: boolean) => void): void;
2065
2230
 
2066
2231
  export declare interface VisSceneDocument extends SceneDocumentMarker {
2067
2232
  entrySceneId: string;
@@ -2096,4 +2261,34 @@ export declare interface VisSceneManifest {
2096
2261
  s?: string;
2097
2262
  }
2098
2263
 
2264
+ declare class Water extends Mesh<BufferGeometry, ShaderMaterial> {
2265
+ static WaterShader: WaterShader;
2266
+ isWater: true;
2267
+ constructor(geometry: BufferGeometry, options: WaterOptions);
2268
+ dispose(): void;
2269
+ }
2270
+
2271
+ declare interface WaterOptions {
2272
+ resources?: ResourceRegistry;
2273
+ color?: ColorRepresentation;
2274
+ textureWidth?: number;
2275
+ textureHeight?: number;
2276
+ clipBias?: number;
2277
+ flowDirection?: Vector2;
2278
+ flowSpeed?: number;
2279
+ reflectivity?: number;
2280
+ scale?: number;
2281
+ shader?: WaterShader;
2282
+ flowMap?: Texture;
2283
+ normalMap0: Texture;
2284
+ normalMap1: Texture;
2285
+ }
2286
+
2287
+ declare interface WaterShader {
2288
+ name: string;
2289
+ uniforms: Record<string, IUniform>;
2290
+ vertexShader: string;
2291
+ fragmentShader: string;
2292
+ }
2293
+
2099
2294
  export { }