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