vis-core 0.33.4 → 0.33.5

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
@@ -1,35 +1,54 @@
1
1
  import { AmbientLightObject } from 'gl-draw';
2
+ import { ArcObject } from 'gl-draw';
3
+ import { ArcPathOptions } from 'gl-draw';
4
+ import { ArcPoint } from 'gl-draw';
5
+ import { ArcSpherePathOptions } from 'gl-draw';
2
6
  import { BaseObject } from 'gl-draw';
7
+ import { baseObjectBounce } from 'gl-draw';
8
+ import { baseObjectBounceIn } from 'gl-draw';
9
+ import { baseObjectFadeIn } from 'gl-draw';
10
+ import { baseObjectFadeOut } from 'gl-draw';
3
11
  import { default as default_2 } from 'gl-draw';
4
12
  import { DirectionalLightObject } from 'gl-draw';
5
13
  import { EventEmitter } from 'events';
6
14
  import { ExtrudePolygonObject } from 'gl-draw';
7
15
  import { FeatureCollection } from 'geojson';
8
16
  import { GeoJsonProperties } from 'geojson';
17
+ import { GeometryDefinition } from 'gl-draw';
9
18
  import { GeoProjection } from 'd3-geo';
10
19
  import { GroupObject } from 'gl-draw';
11
20
  import { HemisphereLightObject } from 'gl-draw';
12
21
  import { Lead } from 'gl-draw';
13
22
  import { LineObject } from 'gl-draw';
14
23
  import { Listener } from 'events';
24
+ import { Matrix4 } from 'three';
15
25
  import { MeshLineMaterial } from 'gl-draw';
16
26
  import { MeshObject } from 'gl-draw';
27
+ import { ModelObject } from 'gl-draw';
17
28
  import { MultiPolygon } from 'geojson';
18
29
  import { NodeObject } from 'gl-draw';
30
+ import { Object3D } from 'three';
19
31
  import { Pencil } from 'gl-draw';
20
- import { PickFunctionsItem } from 'gl-draw';
21
32
  import { PointLightObject } from 'gl-draw';
22
33
  import { Polygon } from 'geojson';
23
34
  import { Position } from 'geojson';
24
35
  import { ProjectionOptions } from 'gl-draw';
25
36
  import { RectAreaLightObject } from 'gl-draw';
37
+ import { remapSnapshotAnimationTracks } from 'gl-draw';
26
38
  import { RestoreBaseObjectOptions } from 'gl-draw';
27
39
  import { SceneSnapshot } from 'gl-draw';
40
+ import { sinusoidalInOut } from 'gl-draw';
28
41
  import { SpotLightObject } from 'gl-draw';
29
42
  import { SpriteObject } from 'gl-draw';
43
+ import { StructureResources } from 'gl-draw';
30
44
  import * as THREE from 'three';
45
+ import { timeOut } from 'gl-draw';
46
+ import { TubeObject } from 'gl-draw';
31
47
  import { default as TWEEN } from 'three/examples/jsm/libs/tween.module.js';
32
48
  import { Tween } from 'three/examples/jsm/libs/tween.module.js';
49
+ import { TweenOptions } from 'gl-draw';
50
+ import { Vector3 } from 'three';
51
+ import { Vector3Tuple } from 'three';
33
52
  import { Water } from './Water2';
34
53
 
35
54
  declare class AmbientLight extends AmbientLightObject {
@@ -39,88 +58,31 @@ declare class AmbientLight extends AmbientLightObject {
39
58
  export declare namespace animationUtils {
40
59
  export {
41
60
  timeOut,
42
- TweenOptions,
43
61
  sinusoidalInOut,
44
62
  baseObjectFadeIn,
45
63
  baseObjectFadeOut,
46
64
  baseObjectBounceIn,
47
- baseObjectBounce
65
+ baseObjectBounce,
66
+ TweenOptions
48
67
  }
49
68
  }
50
69
 
51
- declare class Arc extends LineObject {
52
- objectType: string;
53
- options: Options_5;
54
- constructor(options: Options_5);
55
- create(): Promise<void>;
56
- /** Internal/local-space curve used for rendering, editor handles and snapshots. */
57
- getCurve(): ArcCurve;
58
- /** Set four world-space Bézier controls; persisted coordinates remain local. */
59
- setControlPoints(points: readonly [ArcPoint, ArcPoint, ArcPoint, ArcPoint]): void;
60
- /** Set a world-space path without changing this object or its parent transforms. */
61
- setPath(from: ArcPoint, to: ArcPoint, options: ArcPathOptions): void;
62
- /** Exact radial lift above the short great circle; preserves every object transform. */
63
- setSpherePath(from: ArcPoint, to: ArcPoint, options: ArcSpherePathOptions): void;
64
- private worldToLocalMatrix;
65
- private validatedNodes;
66
- private setWorldControls;
67
- private getPickPathOptions;
68
- private syncPickPathOptions;
69
- private updatePickTargetGeometry;
70
- pickTube: Tube | null;
71
- private pickTargetVersion;
72
- private pickBindings;
73
- addPickTarget(radius?: number, show?: boolean): Promise<Tube | undefined>;
74
- /** Restored picking children are adopted instead of allocating a duplicate tube. */
75
- rebuildFromScene(): Promise<void>;
76
- dispose(): void;
77
- protected createPointerBinding(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
78
- setColor(color: string): void;
79
- animateIn({ duration, delay, repeat, onComplete, onRepeat, }?: {
80
- duration?: number;
81
- delay?: number;
82
- repeat?: number;
83
- onComplete?: (...args: any[]) => void;
84
- onRepeat?: (count: number) => void;
85
- }): void;
86
- render(): void;
87
- }
70
+ /** Merge a privately prepared clipboard subtree; existing equal rows remain shared. */
71
+ export declare function appendObjectDocument(before: VisSceneDocument, sceneId: string, snapshot: any, parentUuid: string, materialAdditions?: readonly MaterialAsset[]): VisSceneDocument;
88
72
 
89
- declare type ArcCurve = THREE.CubicBezierCurve3 | SphereArcCurve;
73
+ export declare function appendScenesDocument(before: VisSceneDocument, scenes: readonly SceneViewportDocument[], materials?: readonly MaterialAsset[], prefabs?: readonly PrefabAsset[]): VisSceneDocument;
90
74
 
91
- export declare interface ArcPathOptions {
92
- /** Maximum displacement from the endpoint segment along `up`, in world units. */
93
- height: number;
94
- /** World-space lift direction; normalized internally. Defaults to positive Z. */
95
- up?: ArcPoint;
96
- setPointWidth?: (progress: number) => number;
97
- }
75
+ export { ArcPathOptions }
98
76
 
99
- export declare type ArcPoint = THREE.Vector3 | readonly number[];
100
-
101
- /** A sphere frame in Arc-local coordinates. Its basis retains world-unit lengths. */
102
- declare interface ArcSpherePath {
103
- matrix: number[];
104
- angle: number;
105
- radius: number;
106
- height: number;
107
- }
77
+ export { ArcPoint }
108
78
 
109
- export declare interface ArcSpherePathOptions {
110
- /** World-space sphere center. Both endpoints must lie on the same sphere. */
111
- center: ArcPoint;
112
- /** Maximum distance above the sphere surface, in world units. Zero follows its surface. */
113
- height: number;
114
- /** World-space circle-plane normal for coincident or antipodal endpoints. */
115
- normal?: ArcPoint;
116
- setPointWidth?: (progress: number) => number;
117
- }
79
+ export { ArcSpherePathOptions }
118
80
 
119
81
  declare class Area extends GroupObject {
120
82
  objectType: string;
121
- options: Options_11;
83
+ options: Options_8;
122
84
  area: ExtrudePolygonObject[];
123
- constructor(options: Options_11);
85
+ constructor(options: Options_8);
124
86
  create(): Promise<void>;
125
87
  rebuildFromScene(): void;
126
88
  }
@@ -152,7 +114,6 @@ declare class Base_2 extends Camera {
152
114
  sceneResources: default_2['sceneResources'];
153
115
  tier0: boolean;
154
116
  roomEnvMap?: THREE.Texture;
155
- private roomEnvTarget?;
156
117
  private roomEnvLease?;
157
118
  visName: string;
158
119
  private detectRes?;
@@ -267,46 +228,6 @@ declare class Base_2 extends Camera {
267
228
  dispose(): void;
268
229
  }
269
230
 
270
- declare const baseObjectBounce: (obj: BaseObject, up: string | undefined, to: number) => {
271
- start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
272
- duration?: number | undefined;
273
- repeat?: number | undefined;
274
- repeatResolve?: number | undefined;
275
- repeatDelay?: number | undefined;
276
- }) => Promise<void>;
277
- stop: () => void;
278
- };
279
-
280
- declare const baseObjectBounceIn: (obj: BaseObject, up?: string) => {
281
- start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
282
- duration?: number | undefined;
283
- repeat?: number | undefined;
284
- repeatResolve?: number | undefined;
285
- repeatDelay?: number | undefined;
286
- }) => Promise<void>;
287
- stop: () => void;
288
- };
289
-
290
- declare const baseObjectFadeIn: (obj: BaseObject) => {
291
- start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
292
- duration?: number | undefined;
293
- repeat?: number | undefined;
294
- repeatResolve?: number | undefined;
295
- repeatDelay?: number | undefined;
296
- }) => Promise<void>;
297
- stop: () => void;
298
- };
299
-
300
- declare const baseObjectFadeOut: (obj: BaseObject) => {
301
- start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
302
- duration?: number | undefined;
303
- repeat?: number | undefined;
304
- repeatResolve?: number | undefined;
305
- repeatDelay?: number | undefined;
306
- }) => Promise<void>;
307
- stop: () => void;
308
- };
309
-
310
231
  declare interface BaseOptions {
311
232
  container: HTMLElement;
312
233
  assetsPrefix?: string;
@@ -338,6 +259,9 @@ export declare interface BindMaterialAssetOptions {
338
259
  alias?: string;
339
260
  }
340
261
 
262
+ /** 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;
264
+
341
265
  declare class Box extends MeshObject {
342
266
  objectType: string;
343
267
  create(): void;
@@ -345,8 +269,8 @@ declare class Box extends MeshObject {
345
269
 
346
270
  declare class Building extends GroupObject {
347
271
  objectType: string;
348
- options: Options_9;
349
- constructor(options: Options_9);
272
+ options: Options_6;
273
+ constructor(options: Options_6);
350
274
  create(): Promise<void>;
351
275
  rebuildFromScene(): void;
352
276
  private gradientMaterials;
@@ -462,8 +386,8 @@ declare interface CityOptions {
462
386
 
463
387
  declare class CityPlane extends MeshObject {
464
388
  objectType: string;
465
- options: Options_13;
466
- constructor(options: Options_13);
389
+ options: Options_10;
390
+ constructor(options: Options_10);
467
391
  plane: THREE.PlaneGeometry;
468
392
  water?: Water;
469
393
  create(): Promise<void>;
@@ -482,11 +406,14 @@ export declare function cloneSceneMaterials(document: VisSceneDocument, sourceId
482
406
  /** Rebind internal targets while preserving links to scenes outside the copied set. */
483
407
  export declare function cloneSceneWithIds(scene: SceneViewportDocument, ids: Map<string, string>): SceneViewportDocument;
484
408
 
409
+ /** Configuration and alias values are additional conservative resource roots. */
410
+ export declare function collectStructureResources(graph: Record<string, any>, roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]): StructureResources;
411
+
485
412
  declare class ContinentsBg extends GroupObject {
486
413
  objectType: string;
487
- options: Options_8;
414
+ options: Options_5;
488
415
  mapArr: PlaneMap[];
489
- constructor(options: Options_8);
416
+ constructor(options: Options_5);
490
417
  create(): Promise<void>;
491
418
  getLocationPosition(location: [number, number], name?: string, height?: number): [number, number, number] | undefined;
492
419
  private calculatePosition;
@@ -495,9 +422,22 @@ declare class ContinentsBg extends GroupObject {
495
422
  dispose(): void;
496
423
  }
497
424
 
425
+ /** Copy only the copied branches; source nodes and existing resource rows keep
426
+ * their identity, including when several copies share one procedural geometry. */
427
+ export declare function copyNativeGeometries(document: VisSceneDocument, sceneId: string, pairs: readonly {
428
+ sourceUuid: string;
429
+ copyUuid: string;
430
+ }[], lead: BaseObject['lead']): VisSceneDocument;
431
+
432
+ /** The clipboard already owns its subtree. Capture the exact geometry shown in
433
+ * the editor so procedural create() cannot silently replace it after paste. */
434
+ export declare function copySnapshotGeometries(snapshot: any, source: BaseObject): void;
435
+
498
436
  /** Explicit creation persists even with no aliases or object users. */
499
437
  export declare function createMaterialAsset<T extends VisSceneDocument>(document: T, options: CreateMaterialAssetOptions): T;
500
438
 
439
+ declare function createMaterialAssetDocument(document: VisSceneDocument, options: CreateMaterialAssetOptions): VisSceneDocument;
440
+
501
441
  export declare interface CreateMaterialAssetOptions {
502
442
  id: string;
503
443
  name: string;
@@ -522,12 +462,17 @@ export declare function createRuntimeSceneGraph(scene: SceneViewportDocument, op
522
462
  /* Excluded from this release type: consumeInput */
523
463
  }): Record<string, any>;
524
464
 
465
+ /** Reuse renderer indexes while retaining material asset aliases and prefab dependencies. */
466
+ export declare function createStructureResourceCollector(graph: Record<string, any>): (roots: readonly Record<string, any>[], additionalReferences?: readonly unknown[]) => StructureResources;
467
+
525
468
  declare class DirectionalLight extends DirectionalLightObject {
526
469
  constructor(...options: ConstructorParameters<typeof DirectionalLightObject>);
527
470
  update(delta: number, elapsed: number): void;
528
471
  render(): void;
529
472
  }
530
473
 
474
+ declare function duplicateMaterialAssetDocument(document: VisSceneDocument, id: string, newId: string, mode: 'asset' | 'object' | 'scene', sceneId: string, objectId?: string, slot?: number): VisSceneDocument;
475
+
531
476
  /** One-click copy and apply; preserve the source's user-visible scope. */
532
477
  export declare function duplicateMaterialForObject<T extends VisSceneDocument>(document: T, options: Omit<BindMaterialAssetOptions, 'alias'> & {
533
478
  objectId: string;
@@ -535,6 +480,23 @@ export declare function duplicateMaterialForObject<T extends VisSceneDocument>(d
535
480
  name?: string;
536
481
  }): T;
537
482
 
483
+ /** Duplicate object identities and their rig bindings, while borrowing immutable content resources. */
484
+ export declare function duplicateObjectsDocument(before: VisSceneDocument, sceneId: string, targets: readonly {
485
+ uuid: string;
486
+ parentUuid: string;
487
+ matrix?: number[];
488
+ matrixAutoUpdate?: boolean;
489
+ }[]): {
490
+ document: VisSceneDocument;
491
+ uuids: string[];
492
+ };
493
+
494
+ /** Duplicate only the selected page and its own material assets. */
495
+ export declare function duplicateSceneDocument(before: VisSceneDocument, sceneId: string, id: string, name?: string): {
496
+ document: VisSceneDocument;
497
+ id: string;
498
+ };
499
+
538
500
  export declare type Earth = Earth_2;
539
501
 
540
502
  declare class Earth_2 extends Base_2 {
@@ -553,15 +515,15 @@ declare class Earth_2 extends Base_2 {
553
515
  Countries: typeof PlaneMap;
554
516
  PlaneMap: typeof PlaneMap;
555
517
  Point: Point;
556
- Arc: Arc;
557
- Model: Model;
518
+ Arc: ArcObject;
519
+ Model: ModelObject;
558
520
  Plane: Plane;
559
521
  PlaneShadow: PlaneShadow;
560
522
  Sphere: Sphere;
561
523
  Sprite: Sprite;
562
524
  Box: Box;
563
525
  Circle: Circle;
564
- Tube: Tube;
526
+ Tube: TubeObject;
565
527
  Ring: Ring;
566
528
  AmbientLight: AmbientLight;
567
529
  DirectionalLight: DirectionalLight;
@@ -645,9 +607,16 @@ declare class Event_2 {
645
607
  /** Expand at the editor import boundary so independently edited scenes own their data. */
646
608
  export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
647
609
 
610
+ /** Expand renderer pools, including snapshots retained as prefab baselines. */
611
+ export declare function expandStructureSnapshot<T extends Record<string, any>>(input: T): T;
612
+
648
613
  /** Extract only this material's dependencies, without mutating the scene snapshot. */
649
614
  export declare function extractMaterialDefinition(scene: SceneViewportDocument, materialUuid: string): Record<string, any>;
650
615
 
616
+ /** Extract current object resources without treating prefab baseline metadata as
617
+ * dependencies of the live object. Baselines remain in the copied metadata. */
618
+ export declare function extractObjectResourceGraph(graph: any, object: any): any;
619
+
651
620
  declare const findAdcodeInfo: (adcode: number) => {
652
621
  adcode: number;
653
622
  lng: number;
@@ -678,6 +647,19 @@ export declare function getSceneDocument(document: VisSceneDocument, sceneId?: s
678
647
  resolveResources?: boolean;
679
648
  }): SceneViewportDocument;
680
649
 
650
+ /** An identity group shell keeps selected sibling objects and their transforms untouched. */
651
+ export declare function groupObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[], options?: GroupObjectsDocumentOptions): {
652
+ document: VisSceneDocument;
653
+ uuid: string;
654
+ };
655
+
656
+ export declare interface GroupObjectsDocumentOptions {
657
+ /** Display name; hosts may supply their localized default. */
658
+ name?: string;
659
+ /** Authored BaseObject user data, separate from generated constructor metadata. */
660
+ userData?: Record<string, any>;
661
+ }
662
+
681
663
  declare class HemisphereLight extends HemisphereLightObject {
682
664
  }
683
665
 
@@ -762,15 +744,15 @@ declare class Map_3 extends Base_2 {
762
744
  Building: Building;
763
745
  Road: Road;
764
746
  Point: Point;
765
- Arc: Arc;
766
- Model: Model;
747
+ Arc: ArcObject;
748
+ Model: ModelObject;
767
749
  Plane: Plane;
768
750
  PlaneShadow: PlaneShadow;
769
751
  Sphere: Sphere;
770
752
  Sprite: Sprite;
771
753
  Box: Box;
772
754
  Circle: Circle;
773
- Tube: Tube;
755
+ Tube: TubeObject;
774
756
  Ring: Ring;
775
757
  AmbientLight: AmbientLight;
776
758
  DirectionalLight: DirectionalLight;
@@ -786,6 +768,9 @@ declare class Map_3 extends Base_2 {
786
768
  protected get defaultCameraUp(): THREE.Vector3;
787
769
  protected onRuntimeReady(): Promise<void>;
788
770
  protected prepareInitialCamera(): Promise<void>;
771
+ private mapBoundaryMatrix?;
772
+ private mapBoundaryEnabled?;
773
+ private refreshMapBoundary;
789
774
  private updateMapBoundary;
790
775
  /* Excluded from this release type: finalizeRegionGeometry */
791
776
  private prepareCityVis;
@@ -913,6 +898,13 @@ declare class Map_3 extends Base_2 {
913
898
  protected onDispose(): void;
914
899
  }
915
900
 
901
+ export declare interface MapAnchor {
902
+ longitude: number;
903
+ latitude: number;
904
+ /** Must match mapCRS; this API does not convert WGS84/GCJ02/BD09. */
905
+ crs: string;
906
+ }
907
+
916
908
  declare interface MapAssetSources {
917
909
  worldGeojson: string;
918
910
  worldLiteGeojson: string;
@@ -987,6 +979,7 @@ declare interface MapOptions extends BaseOptions {
987
979
  polarAngle?: number;
988
980
  azimuthAngle?: number;
989
981
  worldPacificCentre?: boolean;
982
+ /** 同时限制平移范围、最近缩放距离,以及穿透地图和翻转到背面的视角。默认 true。 */
990
983
  mapBoundary?: boolean;
991
984
  mergeSide?: boolean;
992
985
  /** switchMapRegion 时重建城市建筑、道路、河流等数据层。 */
@@ -1004,6 +997,16 @@ declare interface MapOptions extends BaseOptions {
1004
997
  assetSources?: MapAssetSources;
1005
998
  }
1006
999
 
1000
+ export declare interface MapPlacementOptions {
1001
+ mapCRS: string;
1002
+ /** Explicit ground meshes only. Exclude the model, roofs, helpers and hidden surfaces. */
1003
+ surfaces: Object3D[];
1004
+ /** Model's physical height; optional if already in map units. Z is model/map up. */
1005
+ heightMeters?: number;
1006
+ /** Clearance in map units along map Z. */
1007
+ clearance?: number;
1008
+ }
1009
+
1007
1010
  export declare interface MapRegionBackInteraction {
1008
1011
  trigger: 'click' | 'clickOutside';
1009
1012
  objectId: string;
@@ -1089,9 +1092,26 @@ export declare interface MaterialDefinitionScope {
1089
1092
  readonly properties: readonly string[];
1090
1093
  }
1091
1094
 
1095
+ /** Copy-on-write operations for committed documents; callers own validation and transactions.
1096
+ * The normalization-aware project APIs use the same implementation after preparing their inputs.
1097
+ */
1098
+ export declare const materialDocumentOperations: Readonly<{
1099
+ materialize: typeof materializeChangedAssets;
1100
+ create: typeof createMaterialAssetDocument;
1101
+ replace: typeof replaceMaterialAssetDocument;
1102
+ registerSceneMaterials: typeof registerSceneMaterials;
1103
+ bindSlots: typeof bindMaterialSlots;
1104
+ duplicate: typeof duplicateMaterialAssetDocument;
1105
+ promote: typeof promoteMaterialAssetDocument;
1106
+ remove: typeof removeMaterialAssetDocument;
1107
+ }>;
1108
+
1092
1109
  /** One explicit mapping from an asset's authored resource UUIDs to runtime resource UUIDs. */
1093
1110
  export declare function materializeAssetDefinition(asset: MaterialAsset, materialUuid?: string): Record<string, any>;
1094
1111
 
1112
+ /** 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;
1114
+
1095
1115
  /* Excluded from this release type: materializeOwnedProjectMaterials */
1096
1116
 
1097
1117
  /** Mutate a detached working snapshot owned exclusively by the caller. */
@@ -1120,6 +1140,12 @@ export declare type MaterialScope = {
1120
1140
  sceneId: string;
1121
1141
  };
1122
1142
 
1143
+ export declare type MaterialSlotAssignment = {
1144
+ uuid: string;
1145
+ slot: number;
1146
+ assetId: string;
1147
+ };
1148
+
1123
1149
  export declare interface MaterialUsage {
1124
1150
  assetId: string;
1125
1151
  sceneId: string;
@@ -1130,6 +1156,11 @@ export declare interface MaterialUsage {
1130
1156
  alias?: string;
1131
1157
  }
1132
1158
 
1159
+ declare type MatrixState = {
1160
+ matrix: number[];
1161
+ matrixAutoUpdate?: boolean;
1162
+ };
1163
+
1133
1164
  /** Save author edits without promoting page-local region textures into a shared definition. */
1134
1165
  export declare function mergeAuthoredMaterialDefinition(savedDefinition: Record<string, any>, runtimeDefinition: Record<string, any>, options?: {
1135
1166
  editedProperties?: string[];
@@ -1141,76 +1172,11 @@ export declare function mergeProjectMaterials(target: VisSceneDocument, incoming
1141
1172
  idMap: Map<string, string>;
1142
1173
  };
1143
1174
 
1144
- declare class Model extends GroupObject {
1145
- options: Options_7;
1146
- mixer: THREE.AnimationMixer | null;
1147
- clips: THREE.AnimationClip[];
1148
- actions: THREE.AnimationAction[];
1149
- actionStates: Record<string, boolean>;
1150
- objectType: string;
1151
- constructor(options: Options_7);
1152
- create(): Promise<void>;
1153
- render(): void;
1154
- /**
1155
- * Set animation clips for the model
1156
- * @param clips Array of animation clips from GLTF
1157
- */
1158
- setClips(clips: THREE.AnimationClip[]): void;
1159
- /**
1160
- * Play all animation clips
1161
- */
1162
- playAllClips(): void;
1163
- /**
1164
- * Play a specific animation clip by name
1165
- * @param clipName Name of the animation clip to play
1166
- */
1167
- playClip(clipName: string): void;
1168
- /**
1169
- * Stop a specific animation clip by name
1170
- * @param clipName Name of the animation clip to stop
1171
- */
1172
- stopClip(clipName: string): void;
1173
- /**
1174
- * Stop all animation clips
1175
- */
1176
- stopAllClips(): void;
1177
- /**
1178
- * Set the playback speed for all animations
1179
- * @param speed Playback speed (1.0 = normal speed)
1180
- */
1181
- setPlaybackSpeed(speed: number): void;
1182
- /**
1183
- * Get the current playback speed
1184
- */
1185
- getPlaybackSpeed(): number;
1186
- /**
1187
- * Check if a specific animation is playing
1188
- * @param clipName Name of the animation clip
1189
- */
1190
- isPlaying(clipName: string): boolean;
1191
- /**
1192
- * Get all available animation clip names
1193
- */
1194
- getClipNames(): string[];
1195
- rebuildFromScene(): Promise<void>;
1196
- instantiate(ops?: Parameters<GroupObject['instantiate']>[0]): Promise<this>;
1197
- /**
1198
- * Update animations - should be called in render loop
1199
- * @param deltaTime Time elapsed since last frame
1200
- */
1201
- update(deltaTime: number): void;
1202
- /**
1203
- * Dispose of resources including animation mixer
1204
- */
1205
- dispose(): void;
1206
- private syncPlayingClipNames;
1207
- }
1208
-
1209
1175
  declare class Mountain extends GroupObject {
1210
1176
  objectType: string;
1211
- options: Required<Omit<Options_12, 'bbox'>> & Pick<Options_12, 'bbox'>;
1177
+ options: Required<Omit<Options_9, 'bbox'>> & Pick<Options_9, 'bbox'>;
1212
1178
  extrudePolygon: ExtrudePolygonObject;
1213
- constructor(options: Options_12);
1179
+ constructor(options: Options_9);
1214
1180
  geojson2Meta(geojson: GeoJSON_4): {
1215
1181
  coords: Position[][];
1216
1182
  properties: GeoJsonProperties;
@@ -1220,6 +1186,12 @@ declare class Mountain extends GroupObject {
1220
1186
  rebuildFromScene(): void;
1221
1187
  }
1222
1188
 
1189
+ /** Reparent/reorder roots with caller-computed local matrices, without copying their descendants. */
1190
+ export declare function moveObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[], parentUuid: string, order: readonly string[], matrices: ReadonlyMap<string, MatrixState>): VisSceneDocument;
1191
+
1192
+ /** Keep saved texture/image identities stable across runtime namespace and revision changes. */
1193
+ export declare function normalizeMaterialDefinition<T extends Record<string, any>>(input: T): T;
1194
+
1223
1195
  /* Excluded from this release type: normalizeOwnedProjectMaterials */
1224
1196
 
1225
1197
  /** Bind serialized runtime materials and alias catalogs to authored assets. */
@@ -1264,44 +1236,6 @@ declare interface Options {
1264
1236
  }
1265
1237
 
1266
1238
  declare interface Options_10 {
1267
- uuid?: string;
1268
- jsonUrl: string;
1269
- projection: {
1270
- center: [number, number];
1271
- scale: number;
1272
- };
1273
- cacheKey?: string;
1274
- meters?: number;
1275
- grey?: boolean;
1276
- material?: MeshLineMaterial;
1277
- }
1278
-
1279
- declare interface Options_11 {
1280
- uuid?: string;
1281
- jsonUrl: string;
1282
- projection: {
1283
- center: [number, number];
1284
- scale: number;
1285
- };
1286
- material: THREE.Material;
1287
- type: string;
1288
- cacheKey?: string;
1289
- oArr?: number[];
1290
- }
1291
-
1292
- declare interface Options_12 {
1293
- geojson: GeoJSON_4;
1294
- projection: {
1295
- center: [number, number];
1296
- scale: number;
1297
- rotate?: [number, number];
1298
- projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
1299
- };
1300
- depth?: number;
1301
- bbox?: number[];
1302
- }
1303
-
1304
- declare interface Options_13 {
1305
1239
  width: number;
1306
1240
  height: number;
1307
1241
  material?: THREE.Material;
@@ -1322,37 +1256,7 @@ declare interface Options_4 {
1322
1256
  sprite?: boolean;
1323
1257
  }
1324
1258
 
1325
- declare interface Options_5 extends NonNullable<ConstructorParameters<typeof LineObject>[0]> {
1326
- from: number[];
1327
- to: number[];
1328
- control1?: number[];
1329
- control2?: number[];
1330
- spherePath?: ArcSpherePath;
1331
- radius?: number;
1332
- globe?: boolean;
1333
- color?: string;
1334
- lineWidth?: number;
1335
- offsetLoop?: boolean;
1336
- }
1337
-
1338
- declare interface Options_6 {
1339
- path?: THREE.Curve<THREE.Vector3>;
1340
- radius?: number;
1341
- multiplyScalar?: number;
1342
- /** Compact saved inputs for an Arc's derived picking geometry. */
1343
- arcControlPoints?: number[][];
1344
- arcSpherePath?: ArcSpherePath;
1345
- }
1346
-
1347
- declare interface Options_7 {
1348
- src?: string;
1349
- autoPlay?: boolean;
1350
- playbackSpeed?: number;
1351
- serializedClips?: SerializedClip[];
1352
- playingClipNames?: string[];
1353
- }
1354
-
1355
- declare interface Options_8 {
1259
+ declare interface Options_5 {
1356
1260
  materialOptions: {
1357
1261
  topMat: THREE.Material;
1358
1262
  sideMat: THREE.Material;
@@ -1364,7 +1268,7 @@ declare interface Options_8 {
1364
1268
  geojsonSource: string;
1365
1269
  }
1366
1270
 
1367
- declare interface Options_9 {
1271
+ declare interface Options_6 {
1368
1272
  uuid?: string;
1369
1273
  jsonUrl: string;
1370
1274
  projection: {
@@ -1380,6 +1284,44 @@ declare interface Options_9 {
1380
1284
  materialOptions?: Record<string, THREE.Material>;
1381
1285
  }
1382
1286
 
1287
+ declare interface Options_7 {
1288
+ uuid?: string;
1289
+ jsonUrl: string;
1290
+ projection: {
1291
+ center: [number, number];
1292
+ scale: number;
1293
+ };
1294
+ cacheKey?: string;
1295
+ meters?: number;
1296
+ grey?: boolean;
1297
+ material?: MeshLineMaterial;
1298
+ }
1299
+
1300
+ declare interface Options_8 {
1301
+ uuid?: string;
1302
+ jsonUrl: string;
1303
+ projection: {
1304
+ center: [number, number];
1305
+ scale: number;
1306
+ };
1307
+ material: THREE.Material;
1308
+ type: string;
1309
+ cacheKey?: string;
1310
+ oArr?: number[];
1311
+ }
1312
+
1313
+ declare interface Options_9 {
1314
+ geojson: GeoJSON_4;
1315
+ projection: {
1316
+ center: [number, number];
1317
+ scale: number;
1318
+ rotate?: [number, number];
1319
+ projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
1320
+ };
1321
+ depth?: number;
1322
+ bbox?: number[];
1323
+ }
1324
+
1383
1325
  /** Pack an export copy only; preserve the editor's independent scene snapshots. */
1384
1326
  export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
1385
1327
 
@@ -1388,6 +1330,14 @@ export declare function patchSceneStructureDocument(document: VisSceneDocument,
1388
1330
  /** Validate every affected scene and both catalogs before exposing any saved state. */
1389
1331
  export declare function patchSceneStructureTransactionDocument(document: VisSceneDocument, transaction: SceneStructureTransaction): VisSceneDocument;
1390
1332
 
1333
+ export declare interface PlanarMap {
1334
+ object3d: Object3D;
1335
+ options: {
1336
+ projection?: ProjectionOptions;
1337
+ conic?: boolean;
1338
+ };
1339
+ }
1340
+
1391
1341
  declare class Plane extends MeshObject {
1392
1342
  objectType: string;
1393
1343
  create(): void;
@@ -1462,6 +1412,20 @@ declare class PlaneShadow extends MeshObject {
1462
1412
  create(): Promise<void>;
1463
1413
  }
1464
1414
 
1415
+ /** Read-only plan. Aligns the model bounds center in XY and lowest vertex to actual ground.
1416
+ * Apply the returned local matrix to a detached candidate, serialize, then import/replace once.
1417
+ */
1418
+ export declare function planPlacement(model: Object3D, map: PlanarMap, anchor: MapAnchor, options: MapPlacementOptions): {
1419
+ localMatrix: Matrix4;
1420
+ worldMatrix: Matrix4;
1421
+ groundPoint: Vector3Tuple;
1422
+ groundObjectUuid: string;
1423
+ mapPosition: number[];
1424
+ scaleBasis: "local spherical approximation";
1425
+ xUnitsPerMeter: number;
1426
+ yUnitsPerMeter: number;
1427
+ };
1428
+
1465
1429
  declare class Point extends BaseObject {
1466
1430
  objectType: string;
1467
1431
  options: Options_4;
@@ -1497,6 +1461,22 @@ export declare interface PreparedSceneStructure {
1497
1461
 
1498
1462
  declare const preparedSceneStructure: unique symbol;
1499
1463
 
1464
+ export declare function prepareGeometryBinding(before: VisSceneDocument, sceneId: string, uuid: string, input: GeometryDefinition | null, override: boolean): VisSceneDocument;
1465
+
1466
+ /** Change one binding; a conflicting borrowed UUID must not overwrite its other users. */
1467
+ export declare function prepareGeometryEdit(before: VisSceneDocument, sceneId: string, uuid: string, input: GeometryDefinition | null): VisSceneDocument;
1468
+
1469
+ /** Uses the same projection and Y sign as PlaneMap geometry, then its world matrix. */
1470
+ export declare function projectLocation(map: PlanarMap, anchor: MapAnchor, mapCRS: string): {
1471
+ local: Vector3;
1472
+ world: Vector3;
1473
+ xUnitsPerMeter: number;
1474
+ yUnitsPerMeter: number;
1475
+ scaleBasis: "local spherical approximation";
1476
+ };
1477
+
1478
+ declare function promoteMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
1479
+
1500
1480
  export declare function promoteMaterialToProject<T extends VisSceneDocument>(document: T, assetId: string): T;
1501
1481
 
1502
1482
  declare class RectAreaLight extends RectAreaLightObject {
@@ -1517,6 +1497,15 @@ declare interface RegionTextureRule {
1517
1497
  levels?: string[];
1518
1498
  }
1519
1499
 
1500
+ /** Register imported definitions without normalizing or copying the existing project. */
1501
+ declare function registerSceneMaterials(document: VisSceneDocument, sceneId: string, onlyIds?: ReadonlySet<string>): VisSceneDocument;
1502
+
1503
+ /** Imported data is owned separately; scanning occupied IDs never copies current graphs. */
1504
+ export declare function remapImportedMaterials(before: VisSceneDocument, incoming: VisSceneDocument): VisSceneDocument;
1505
+
1506
+ /** Detached authored snapshots keep their copy links and relinquish source-asset resource identities. */
1507
+ export declare function remapOwnedSnapshotIdentity(snapshot: any, rootUuid?: string, sharedResourceIds?: ReadonlyMap<string, string>): any;
1508
+
1520
1509
  export declare interface RemappedSceneDocument {
1521
1510
  entrySceneId: string;
1522
1511
  scenes: SceneViewportDocument[];
@@ -1538,8 +1527,22 @@ export declare function remapProjectMaterialIds<T extends VisSceneDocument>(docu
1538
1527
  */
1539
1528
  export declare function remapSceneDocumentIds(document: VisSceneDocument, createSceneId: (scene: SceneViewportDocument, index: number) => string): RemappedSceneDocument;
1540
1529
 
1530
+ export { remapSnapshotAnimationTracks }
1531
+
1532
+ /** Copy an authored snapshot with fresh native and authored reference identities. */
1533
+ export declare function remapSnapshotIdentity(input: any, rootUuid?: string, sharedResourceIds?: ReadonlyMap<string, string>): any;
1534
+
1535
+ declare function removeMaterialAssetDocument(document: VisSceneDocument, id: string): VisSceneDocument;
1536
+
1537
+ /** Remove selected roots and prune only the authored rules that referred to them. */
1538
+ export declare function removeObjectsDocument(before: VisSceneDocument, sceneId: string, ids: readonly string[]): VisSceneDocument;
1539
+
1541
1540
  export declare function removeProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string): T;
1542
1541
 
1542
+ export declare function removeSceneDocument(before: VisSceneDocument, sceneId: string): VisSceneDocument;
1543
+
1544
+ declare function replaceMaterialAssetDocument(document: VisSceneDocument, asset: MaterialAsset): VisSceneDocument;
1545
+
1543
1546
  declare class Ring extends MeshObject {
1544
1547
  objectType: string;
1545
1548
  create(): void;
@@ -1547,8 +1550,8 @@ declare class Ring extends MeshObject {
1547
1550
 
1548
1551
  declare class Road extends GroupObject {
1549
1552
  objectType: string;
1550
- options: Options_10;
1551
- constructor(options: Options_10);
1553
+ options: Options_7;
1554
+ constructor(options: Options_7);
1552
1555
  linePrimary: LineObject[];
1553
1556
  lineSecondary: LineObject[];
1554
1557
  create(): Promise<void>;
@@ -1663,6 +1666,11 @@ export declare class SceneManager extends Event_2 {
1663
1666
  private assertGeneration;
1664
1667
  private debugInteraction;
1665
1668
  private enablePickDebug;
1669
+ private retireScenes;
1670
+ private discardSceneCandidates;
1671
+ /** Notifications cannot invalidate a transaction that has already committed. */
1672
+ private notifySceneObservers;
1673
+ private finishNavigation;
1666
1674
  private disposeInactiveScenes;
1667
1675
  /** Retire inactive pages after the host accepts navigation; failures never undo the active page. */
1668
1676
  trimInactiveScenes(): unknown[];
@@ -1754,6 +1762,7 @@ export declare class SceneManager extends Event_2 {
1754
1762
  switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
1755
1763
  /**
1756
1764
  * 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
1765
+ * 缓存至少保留当前页和本次预加载页;后续导航恢复配置的缓存上限。
1757
1766
  */
1758
1767
  preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_2>;
1759
1768
  /** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
@@ -1812,7 +1821,7 @@ export declare interface SceneManagerBehaviorOptions {
1812
1821
  beforeSceneDisplay?: (scene: Base_2, context: SceneDisplayContext) => void | Promise<void>;
1813
1822
  /** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
1814
1823
  cacheScenes?: boolean;
1815
- /** Pages retained after navigation, including the active page; oldest inactive pages retire first. */
1824
+ /** Pages retained after navigation (default 8), including the active page; oldest inactive pages retire first. */
1816
1825
  maxCachedScenes?: number;
1817
1826
  /** 自定义分包场景读取器;可从 IndexedDB 等非 HTTP 存储按需读取。 */
1818
1827
  loadScene?: (entry: SceneManifestEntry) => Promise<SceneViewportDocument>;
@@ -1986,18 +1995,6 @@ export declare interface SceneViewportPatch {
1986
1995
 
1987
1996
  export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
1988
1997
 
1989
- declare type SerializedClip = ReturnType<(typeof THREE.AnimationClip)['toJSON']>;
1990
-
1991
- declare const sinusoidalInOut: ({ owner, onUpdate, onComplete, onCancel, backwards, }?: TweenOptions) => {
1992
- start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
1993
- duration?: number | undefined;
1994
- repeat?: number | undefined;
1995
- repeatResolve?: number | undefined;
1996
- repeatDelay?: number | undefined;
1997
- }) => Promise<void>;
1998
- stop: () => void;
1999
- };
2000
-
2001
1998
  declare class Sphere extends MeshObject {
2002
1999
  radius: number;
2003
2000
  options: any;
@@ -2006,26 +2003,6 @@ declare class Sphere extends MeshObject {
2006
2003
  create(): void;
2007
2004
  }
2008
2005
 
2009
- /** Exact radial lift above the short great circle, expressed in object-local space. */
2010
- declare class SphereArcCurve extends THREE.Curve<THREE.Vector3> {
2011
- readonly type = "SphereArcCurve";
2012
- readonly data: ArcSpherePath;
2013
- readonly matrix: THREE.Matrix4;
2014
- constructor(path: ArcSpherePath);
2015
- get v0(): THREE.Vector3;
2016
- get v3(): THREE.Vector3;
2017
- getPoint(t: number, target?: THREE.Vector3): THREE.Vector3;
2018
- getTangent(t: number, target?: THREE.Vector3): THREE.Vector3;
2019
- clone(): this;
2020
- copy(source: THREE.Curve<THREE.Vector3>): this;
2021
- toJSON(): SphereArcCurveJSON;
2022
- fromJSON(json: THREE.CurveJSON): this;
2023
- }
2024
-
2025
- declare interface SphereArcCurveJSON extends THREE.CurveJSON {
2026
- spherePath: ArcSpherePath;
2027
- }
2028
-
2029
2006
  declare class SphereShadow extends MeshObject {
2030
2007
  objectType: string;
2031
2008
  options: Required<Options_3>;
@@ -2067,6 +2044,8 @@ declare class Sprite extends SpriteObject {
2067
2044
 
2068
2045
  export declare function stripMaterialAssetBinding<T extends Record<string, any>>(material: T): T;
2069
2046
 
2047
+ export { StructureResources }
2048
+
2070
2049
  export declare interface SwitchSceneOptions {
2071
2050
  /** 返回历史时不再记录当前场景。 */
2072
2051
  recordHistory?: boolean;
@@ -2076,30 +2055,13 @@ export declare interface SwitchSceneOptions {
2076
2055
 
2077
2056
  export { THREE }
2078
2057
 
2079
- declare const timeOut: (ms: number) => Promise<any>;
2080
-
2081
- declare class Tube extends MeshObject {
2082
- objectType: string;
2083
- options: Options_6;
2084
- constructor(options: Options_6);
2085
- create(): void;
2086
- }
2087
-
2088
2058
  export { TWEEN }
2089
2059
 
2090
2060
  export { Tween }
2091
2061
 
2092
- declare interface TweenOptions {
2093
- owner?: Pick<Pencil, 'animations'>;
2094
- onUpdate?: (value: number) => void;
2095
- onComplete?: () => void;
2096
- onCancel?: () => void;
2097
- backwards?: boolean;
2098
- }
2099
-
2100
2062
  export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
2101
2063
 
2102
- export declare const VERSION = "0.33.4";
2064
+ export declare const VERSION = "0.33.5";
2103
2065
 
2104
2066
  export declare interface VisSceneDocument extends SceneDocumentMarker {
2105
2067
  entrySceneId: string;