vis-core 0.32.7 → 0.33.0
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 +643 -139
- package/dist/index.js +3 -3
- package/package.json +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -17,12 +17,15 @@ import { MeshObject } from 'gl-draw';
|
|
|
17
17
|
import { MultiPolygon } from 'geojson';
|
|
18
18
|
import { NodeObject } from 'gl-draw';
|
|
19
19
|
import { Pencil } from 'gl-draw';
|
|
20
|
+
import { PickFunctionsItem } from 'gl-draw';
|
|
20
21
|
import { PointLightObject } from 'gl-draw';
|
|
21
22
|
import { Polygon } from 'geojson';
|
|
22
23
|
import { Position } from 'geojson';
|
|
23
24
|
import { ProjectionOptions } from 'gl-draw';
|
|
24
25
|
import { RectAreaLightObject } from 'gl-draw';
|
|
26
|
+
import { RestoreBaseObjectOptions } from 'gl-draw';
|
|
25
27
|
import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';
|
|
28
|
+
import { SceneSnapshot } from 'gl-draw';
|
|
26
29
|
import { SpotLightObject } from 'gl-draw';
|
|
27
30
|
import { SpriteObject } from 'gl-draw';
|
|
28
31
|
import * as THREE from 'three';
|
|
@@ -37,6 +40,7 @@ declare class AmbientLight extends AmbientLightObject {
|
|
|
37
40
|
export declare namespace animationUtils {
|
|
38
41
|
export {
|
|
39
42
|
timeOut,
|
|
43
|
+
TweenOptions,
|
|
40
44
|
sinusoidalInOut,
|
|
41
45
|
baseObjectFadeIn,
|
|
42
46
|
baseObjectFadeOut,
|
|
@@ -47,22 +51,21 @@ export declare namespace animationUtils {
|
|
|
47
51
|
|
|
48
52
|
declare class Arc extends LineObject {
|
|
49
53
|
objectType: string;
|
|
50
|
-
options:
|
|
51
|
-
constructor(options:
|
|
54
|
+
options: Options_5;
|
|
55
|
+
constructor(options: Options_5);
|
|
52
56
|
create(): Promise<void>;
|
|
53
|
-
line: {
|
|
54
|
-
options: {
|
|
55
|
-
nodes: THREE.Vector3[];
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
57
|
getCurve(): THREE.CubicBezierCurve3;
|
|
59
58
|
setControlPoints(points: [THREE.Vector3, THREE.Vector3, THREE.Vector3, THREE.Vector3]): void;
|
|
60
59
|
setPath(from: THREE.Vector3 | number[], to: THREE.Vector3 | number[], radius: number, setPointWidth?: (p: number) => number): void;
|
|
60
|
+
private updatePickTargetGeometry;
|
|
61
61
|
pickTube: Tube | null;
|
|
62
62
|
private pickTargetVersion;
|
|
63
|
+
private pickBindings;
|
|
63
64
|
addPickTarget(radius?: number, show?: boolean): Promise<Tube | undefined>;
|
|
65
|
+
/** Restored picking children are adopted instead of allocating a duplicate tube. */
|
|
66
|
+
rebuildFromScene(): Promise<void>;
|
|
64
67
|
dispose(): void;
|
|
65
|
-
|
|
68
|
+
protected createPointerBinding(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): () => void;
|
|
66
69
|
setColor(color: string): void;
|
|
67
70
|
animateIn({ duration, delay, repeat, onComplete, onRepeat, }?: {
|
|
68
71
|
duration?: number;
|
|
@@ -83,9 +86,14 @@ declare class Area extends GroupObject {
|
|
|
83
86
|
rebuildFromScene(): void;
|
|
84
87
|
}
|
|
85
88
|
|
|
89
|
+
/** Validation is read-only and does not materialize or allocate runtime resources. */
|
|
90
|
+
export declare function assertProjectMaterials(document: Pick<VisSceneDocument, 'schemaVersion' | 'scenes' | 'materialLibrary' | 'prefabLibrary'>): void;
|
|
91
|
+
|
|
86
92
|
/** vis-core 的运行时入口只接受编辑平台导出的完整场景文档。 */
|
|
87
93
|
export declare function assertRuntimeSceneDocument(value: unknown): asserts value is VisSceneDocument & Record<string, any>;
|
|
88
94
|
|
|
95
|
+
export declare function assertSceneManifest(value: unknown): asserts value is VisSceneManifest;
|
|
96
|
+
|
|
89
97
|
export declare function assertSupportedSceneDocument(value: unknown): void;
|
|
90
98
|
|
|
91
99
|
export declare type Base = Base_2;
|
|
@@ -96,23 +104,35 @@ declare class Base_2 extends Camera {
|
|
|
96
104
|
observeParentScale: boolean;
|
|
97
105
|
applyDisabledMouseButtons: boolean;
|
|
98
106
|
cacheCityGeometry: boolean;
|
|
107
|
+
includePrefabPreviews: boolean;
|
|
99
108
|
};
|
|
100
109
|
leftTruck: boolean;
|
|
101
110
|
options: BaseOptions;
|
|
102
111
|
showState: boolean;
|
|
103
|
-
settings: Record<string, any>;
|
|
104
112
|
lead: Lead;
|
|
105
|
-
|
|
113
|
+
sceneResources: default_2['sceneResources'];
|
|
106
114
|
tier0: boolean;
|
|
107
115
|
pmremGenerator: THREE.PMREMGenerator | null;
|
|
108
116
|
re: RoomEnvironment | null;
|
|
109
117
|
roomEnvMap?: THREE.Texture;
|
|
110
118
|
private roomEnvTarget?;
|
|
119
|
+
private roomEnvLease?;
|
|
111
120
|
visName: string;
|
|
112
121
|
private detectRes?;
|
|
113
122
|
private ownsPencil;
|
|
114
123
|
publicDir: Record<string, string>;
|
|
124
|
+
private prefabAssets;
|
|
125
|
+
private prefabMaterials;
|
|
126
|
+
private prefabOperations;
|
|
127
|
+
/** Inspect SDK-enabled definitions without creating scene objects or resources. */
|
|
128
|
+
getPrefabLibrary(): PrefabAsset[];
|
|
129
|
+
/* Excluded from this release type: setPrefabLibrary */
|
|
130
|
+
instantiatePrefab(keyOrAssetId: string, options?: InstantiatePrefabOptions): Promise<BaseObject>;
|
|
131
|
+
private cancelPrefabOperations;
|
|
115
132
|
constructor(options: BaseOptions);
|
|
133
|
+
getMaterialGroup(group: string): Record<string, THREE.Material<THREE.MaterialEventMap>> | null;
|
|
134
|
+
registerMaterialGroup(group: string, materials: Record<string, THREE.Material | null>): void;
|
|
135
|
+
copyMaterialGroup(source: string, target: string): Record<string, THREE.Material<THREE.MaterialEventMap>>;
|
|
116
136
|
private getDetectRes;
|
|
117
137
|
private getQueryOverrides;
|
|
118
138
|
private getEffectiveLogarithmicDepthBuffer;
|
|
@@ -124,6 +144,8 @@ declare class Base_2 extends Camera {
|
|
|
124
144
|
/* Excluded from this release type: fromJSON */
|
|
125
145
|
private runtimeInitialization?;
|
|
126
146
|
private disposed;
|
|
147
|
+
private readonly handleObjectIdentityChanged;
|
|
148
|
+
private readonly handleMaterialIdentityChanged;
|
|
127
149
|
/* Excluded from this release type: initializeRuntime */
|
|
128
150
|
/** 子类扩展点:运行环境只初始化一次,适合建立投影和绑定控制器事件。 */
|
|
129
151
|
protected onRuntimeReady(): Promise<void>;
|
|
@@ -133,8 +155,8 @@ declare class Base_2 extends Camera {
|
|
|
133
155
|
protected onDispose(): void;
|
|
134
156
|
protected get objectTypes(): Record<string, any>;
|
|
135
157
|
protected get defaultCameraUp(): THREE.Vector3;
|
|
136
|
-
private observeScale;
|
|
137
158
|
private createRuntime;
|
|
159
|
+
private reportScriptError;
|
|
138
160
|
private sceneActive;
|
|
139
161
|
setSceneActive(): void;
|
|
140
162
|
/**
|
|
@@ -152,18 +174,30 @@ declare class Base_2 extends Camera {
|
|
|
152
174
|
/** 场景页提交后的默认入场动画;地图可覆盖为更有空间感的过渡。 */
|
|
153
175
|
playEnterTransition({ duration, onPrepared, }: SceneEnterTransitionOptions): Promise<void>;
|
|
154
176
|
addCSS3DRenderer(container?: HTMLElement): void;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
177
|
+
private controlsInitialized;
|
|
178
|
+
private temporaryControls;
|
|
179
|
+
/** A copy of the authored configuration; temporary input locks are not persisted. */
|
|
180
|
+
getControls(): Readonly<SceneControlsOptions>;
|
|
181
|
+
setControls(patch: SceneControlsOptions): void;
|
|
182
|
+
/** Overrides compose in acquisition order and can be released in any order. */
|
|
183
|
+
setTemporaryControls(patch: SceneControlsOptions): () => void;
|
|
184
|
+
private validateControls;
|
|
185
|
+
private initializeControls;
|
|
186
|
+
protected applyControls(): void;
|
|
187
|
+
protected applyControlOptions(controls: SceneControlsOptions): void;
|
|
159
188
|
protected prepareInitialCamera(): Promise<void>;
|
|
189
|
+
private restoreCameraControlTarget;
|
|
160
190
|
private showing?;
|
|
191
|
+
private sceneTemporarilyHidden;
|
|
192
|
+
private authoredSceneVisible;
|
|
193
|
+
private hideSceneContent;
|
|
194
|
+
private showSceneContent;
|
|
161
195
|
show(): Promise<void>;
|
|
162
196
|
hide(): void;
|
|
163
|
-
exportScene():
|
|
164
|
-
exportBaseObject(baseObject: BaseObject):
|
|
165
|
-
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any>, signal?: AbortSignal): Promise<BaseObject<THREE.Object3D<THREE.Object3DEventMap>>>;
|
|
166
|
-
restoreScene(str: string | THREE.Object3DJSON, objectsMap?: Record<string, any
|
|
197
|
+
exportScene(): SceneSnapshot;
|
|
198
|
+
exportBaseObject(baseObject: BaseObject): SceneSnapshot;
|
|
199
|
+
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any>, signal?: AbortSignal, options?: RestoreBaseObjectOptions): Promise<BaseObject<THREE.Object3D<THREE.Object3DEventMap>>>;
|
|
200
|
+
restoreScene(str: string | THREE.Object3DJSON, objectsMap?: Record<string, any>, restoreOptions?: RestoreBaseObjectOptions): Promise<void>;
|
|
167
201
|
getClassRefByType(type: string): typeof BaseObject;
|
|
168
202
|
addGroup(): Promise< GroupObject>;
|
|
169
203
|
addCSS2D(dom: HTMLElement, options?: {
|
|
@@ -186,10 +220,9 @@ declare class Base_2 extends Camera {
|
|
|
186
220
|
uuidByObject(object: THREE.Object3D): string | undefined;
|
|
187
221
|
objectByUuid(key: string): THREE.Object3D<THREE.Object3DEventMap>;
|
|
188
222
|
uuidByBaseObject(object: BaseObject): string;
|
|
189
|
-
baseObjectByUuid(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
private normalizeBaseObjectKey;
|
|
223
|
+
baseObjectByUuid(uuid: string): BaseObject;
|
|
224
|
+
/** Compatibility method name; key is the persisted UUID. */
|
|
225
|
+
baseObjectByKey(key: string): BaseObject;
|
|
193
226
|
baseObjectByName(name: string): BaseObject<THREE.Object3D<THREE.Object3DEventMap>> | undefined;
|
|
194
227
|
dispose(): void;
|
|
195
228
|
}
|
|
@@ -200,7 +233,7 @@ declare const baseObjectBounce: (obj: BaseObject, up: string | undefined, to: nu
|
|
|
200
233
|
repeat?: number | undefined;
|
|
201
234
|
repeatResolve?: number | undefined;
|
|
202
235
|
repeatDelay?: number | undefined;
|
|
203
|
-
}) => Promise<
|
|
236
|
+
}) => Promise<void>;
|
|
204
237
|
stop: () => void;
|
|
205
238
|
};
|
|
206
239
|
|
|
@@ -210,7 +243,7 @@ declare const baseObjectBounceIn: (obj: BaseObject, up?: string) => {
|
|
|
210
243
|
repeat?: number | undefined;
|
|
211
244
|
repeatResolve?: number | undefined;
|
|
212
245
|
repeatDelay?: number | undefined;
|
|
213
|
-
}) => Promise<
|
|
246
|
+
}) => Promise<void>;
|
|
214
247
|
stop: () => void;
|
|
215
248
|
};
|
|
216
249
|
|
|
@@ -220,7 +253,7 @@ declare const baseObjectFadeIn: (obj: BaseObject) => {
|
|
|
220
253
|
repeat?: number | undefined;
|
|
221
254
|
repeatResolve?: number | undefined;
|
|
222
255
|
repeatDelay?: number | undefined;
|
|
223
|
-
}) => Promise<
|
|
256
|
+
}) => Promise<void>;
|
|
224
257
|
stop: () => void;
|
|
225
258
|
};
|
|
226
259
|
|
|
@@ -230,7 +263,7 @@ declare const baseObjectFadeOut: (obj: BaseObject) => {
|
|
|
230
263
|
repeat?: number | undefined;
|
|
231
264
|
repeatResolve?: number | undefined;
|
|
232
265
|
repeatDelay?: number | undefined;
|
|
233
|
-
}) => Promise<
|
|
266
|
+
}) => Promise<void>;
|
|
234
267
|
stop: () => void;
|
|
235
268
|
};
|
|
236
269
|
|
|
@@ -246,11 +279,25 @@ declare interface BaseOptions {
|
|
|
246
279
|
tier?: number;
|
|
247
280
|
observeParentScale?: boolean;
|
|
248
281
|
createIfNeeded?: boolean;
|
|
282
|
+
materialBindings?: MaterialBindings;
|
|
249
283
|
/** 相机输入与场景运行控制,由平台随场景参数导出。 */
|
|
250
284
|
controls?: SceneControlsOptions;
|
|
251
285
|
[key: string]: any;
|
|
252
286
|
}
|
|
253
287
|
|
|
288
|
+
export declare function bindMaterialAsset<T extends VisSceneDocument>(document: T, options: BindMaterialAssetOptions): T;
|
|
289
|
+
|
|
290
|
+
export declare interface BindMaterialAssetOptions {
|
|
291
|
+
sceneId: string;
|
|
292
|
+
assetId: string;
|
|
293
|
+
/** Scene graph UUID or the managed object's _baseObjectUuid. */
|
|
294
|
+
objectId?: string;
|
|
295
|
+
/** A multi-material slot, defaulting to 0. */
|
|
296
|
+
slot?: number;
|
|
297
|
+
/** Optional semantic lookup role; the catalog entry uses the material UUID. */
|
|
298
|
+
alias?: string;
|
|
299
|
+
}
|
|
300
|
+
|
|
254
301
|
declare class Box extends MeshObject {
|
|
255
302
|
objectType: string;
|
|
256
303
|
create(): void;
|
|
@@ -262,6 +309,7 @@ declare class Building extends GroupObject {
|
|
|
262
309
|
constructor(options: Options_9);
|
|
263
310
|
create(): Promise<void>;
|
|
264
311
|
rebuildFromScene(): void;
|
|
312
|
+
private gradientMaterials;
|
|
265
313
|
worldPositionZ: {
|
|
266
314
|
value: number;
|
|
267
315
|
};
|
|
@@ -309,12 +357,22 @@ declare class City {
|
|
|
309
357
|
road: Road;
|
|
310
358
|
pencil: Pencil;
|
|
311
359
|
lead: Pencil['lead'];
|
|
312
|
-
|
|
360
|
+
sceneResources: Pencil['sceneResources'];
|
|
313
361
|
constructor(pencil: Pencil);
|
|
314
362
|
setOptions(options: CityOptions): void;
|
|
315
363
|
multiplyScalar: number;
|
|
316
364
|
private getProjectionOptions;
|
|
317
365
|
fixNearFar(n?: number, f?: number): void;
|
|
366
|
+
/** Load and validate only; prefetching must never mutate shared Lead state. */
|
|
367
|
+
preloadResources(): Promise<{
|
|
368
|
+
sources: {
|
|
369
|
+
building: string | undefined;
|
|
370
|
+
road: string | undefined;
|
|
371
|
+
river: string | undefined;
|
|
372
|
+
grassland: string | undefined;
|
|
373
|
+
};
|
|
374
|
+
data: Partial<Record<"building" | "road" | "river" | "grassland", any>>;
|
|
375
|
+
}>;
|
|
318
376
|
init(existingGroup?: GroupObject): Promise<void>;
|
|
319
377
|
drawCityPlane(adcode: number, target?: BaseObject): Promise<void>;
|
|
320
378
|
drawBuilding(options?: {
|
|
@@ -339,6 +397,7 @@ declare class City {
|
|
|
339
397
|
}
|
|
340
398
|
|
|
341
399
|
declare interface CityOptions {
|
|
400
|
+
materialBindings?: MaterialBindings;
|
|
342
401
|
adcode: number;
|
|
343
402
|
jsonName: string;
|
|
344
403
|
cacheKey?: string;
|
|
@@ -373,6 +432,13 @@ declare class CityPlane extends MeshObject {
|
|
|
373
432
|
dispose(): void;
|
|
374
433
|
}
|
|
375
434
|
|
|
435
|
+
/** Duplicate scene-owned definitions, while retaining references to project assets. */
|
|
436
|
+
export declare function cloneSceneMaterials(document: VisSceneDocument, sourceId: string, newSceneId: string): {
|
|
437
|
+
scene: SceneViewportDocument;
|
|
438
|
+
materialLibrary: MaterialAsset[];
|
|
439
|
+
idMap: Map<string, string>;
|
|
440
|
+
};
|
|
441
|
+
|
|
376
442
|
/** Rebind internal targets while preserving links to scenes outside the copied set. */
|
|
377
443
|
export declare function cloneSceneWithIds(scene: SceneViewportDocument, ids: Map<string, string>): SceneViewportDocument;
|
|
378
444
|
|
|
@@ -389,12 +455,45 @@ declare class ContinentsBg extends GroupObject {
|
|
|
389
455
|
dispose(): void;
|
|
390
456
|
}
|
|
391
457
|
|
|
458
|
+
/** Explicit creation persists even with no aliases or object users. */
|
|
459
|
+
export declare function createMaterialAsset<T extends VisSceneDocument>(document: T, options: CreateMaterialAssetOptions): T;
|
|
460
|
+
|
|
461
|
+
export declare interface CreateMaterialAssetOptions {
|
|
462
|
+
id: string;
|
|
463
|
+
name: string;
|
|
464
|
+
material: Record<string, any>;
|
|
465
|
+
scope?: MaterialScope;
|
|
466
|
+
locked?: boolean;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Share resource indices for one synchronous extraction batch. The scene's
|
|
471
|
+
* resource tables must remain unchanged until the batch finishes. Each result
|
|
472
|
+
* owns independent copies of its material and dependencies.
|
|
473
|
+
*/
|
|
474
|
+
export declare function createMaterialDefinitionExtractor(scene: SceneViewportDocument): (materialUuid: string) => Record<string, any>;
|
|
475
|
+
|
|
476
|
+
/** Runtime delivery boundary shared by single-file, split and IndexedDB exports. */
|
|
477
|
+
export declare function createRuntimeSceneDocument(document: VisSceneDocument): VisSceneDocument;
|
|
478
|
+
|
|
479
|
+
/** Convert authored asset aliases to the native catalog expected by graph restoration. */
|
|
480
|
+
export declare function createRuntimeSceneGraph(scene: SceneViewportDocument, options?: {
|
|
481
|
+
omitPrefabPreviews?: boolean;
|
|
482
|
+
}): Record<string, any>;
|
|
483
|
+
|
|
392
484
|
declare class DirectionalLight extends DirectionalLightObject {
|
|
393
485
|
constructor(...options: ConstructorParameters<typeof DirectionalLightObject>);
|
|
394
486
|
update(delta: number, elapsed: number): void;
|
|
395
487
|
render(): void;
|
|
396
488
|
}
|
|
397
489
|
|
|
490
|
+
/** One-click copy and apply; preserve the source's user-visible scope. */
|
|
491
|
+
export declare function duplicateMaterialForObject<T extends VisSceneDocument>(document: T, options: Omit<BindMaterialAssetOptions, 'alias'> & {
|
|
492
|
+
objectId: string;
|
|
493
|
+
newAssetId: string;
|
|
494
|
+
name?: string;
|
|
495
|
+
}): T;
|
|
496
|
+
|
|
398
497
|
export declare type Earth = Earth_2;
|
|
399
498
|
|
|
400
499
|
declare class Earth_2 extends Base_2 {
|
|
@@ -406,7 +505,7 @@ declare class Earth_2 extends Base_2 {
|
|
|
406
505
|
secondaryMap?: PlaneMap;
|
|
407
506
|
get mapArea(): ExtrudePolygonObject[];
|
|
408
507
|
setOptions(options: EarthOptions): void;
|
|
409
|
-
|
|
508
|
+
protected applyControlOptions(controls: SceneControlsOptions): void;
|
|
410
509
|
protected get objectTypes(): {
|
|
411
510
|
Earth: Earth_3;
|
|
412
511
|
SphereShadow: SphereShadow;
|
|
@@ -435,6 +534,7 @@ declare class Earth_2 extends Base_2 {
|
|
|
435
534
|
Group: GroupObject;
|
|
436
535
|
};
|
|
437
536
|
private rotationControls?;
|
|
537
|
+
private releaseRotationLock?;
|
|
438
538
|
private readonly stopAutoRotate;
|
|
439
539
|
private readonly resumeAutoRotate;
|
|
440
540
|
protected onRuntimeReady(): Promise<void>;
|
|
@@ -456,8 +556,8 @@ declare class Earth_2 extends Base_2 {
|
|
|
456
556
|
|
|
457
557
|
declare class Earth_3 extends Sphere {
|
|
458
558
|
objectType: string;
|
|
459
|
-
options: Required<
|
|
460
|
-
constructor(options:
|
|
559
|
+
options: Required<Options_2>;
|
|
560
|
+
constructor(options: Options_2);
|
|
461
561
|
create(): void;
|
|
462
562
|
rebuildFromScene(): void;
|
|
463
563
|
}
|
|
@@ -493,6 +593,9 @@ declare class Event_2 {
|
|
|
493
593
|
/** Expand at the editor import boundary so independently edited scenes own their data. */
|
|
494
594
|
export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
495
595
|
|
|
596
|
+
/** Extract only this material's dependencies, without mutating the scene snapshot. */
|
|
597
|
+
export declare function extractMaterialDefinition(scene: SceneViewportDocument, materialUuid: string): Record<string, any>;
|
|
598
|
+
|
|
496
599
|
declare const findAdcodeInfo: (adcode: number) => {
|
|
497
600
|
adcode: number;
|
|
498
601
|
lng: number;
|
|
@@ -510,6 +613,15 @@ declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
|
|
|
510
613
|
|
|
511
614
|
declare type GeoJSON_4 = FeatureCollection<Polygon | MultiPolygon>;
|
|
512
615
|
|
|
616
|
+
/** Saved configuration dependencies protect definitions, without representing live usage. */
|
|
617
|
+
export declare function getMaterialDependencies(document: Pick<VisSceneDocument, 'scenes'>, assetId?: string): MaterialUsage[];
|
|
618
|
+
|
|
619
|
+
/** Includes unloaded scene snapshots, aliases, and every multi-material slot. */
|
|
620
|
+
export declare function getMaterialUsages(document: Pick<VisSceneDocument, 'scenes'>, assetId?: string): MaterialUsage[];
|
|
621
|
+
|
|
622
|
+
/** Templates remain dependencies even when every scene instance has been removed. */
|
|
623
|
+
export declare function getPrefabMaterialDependencies(document: Pick<VisSceneDocument, 'prefabLibrary'>, assetId: string): PrefabAsset[];
|
|
624
|
+
|
|
513
625
|
export declare function getSceneDocument(document: VisSceneDocument, sceneId?: string, options?: {
|
|
514
626
|
resolveResources?: boolean;
|
|
515
627
|
}): SceneViewportDocument;
|
|
@@ -517,12 +629,24 @@ export declare function getSceneDocument(document: VisSceneDocument, sceneId?: s
|
|
|
517
629
|
declare class HemisphereLight extends HemisphereLightObject {
|
|
518
630
|
}
|
|
519
631
|
|
|
632
|
+
export declare interface InstantiatePrefabOptions {
|
|
633
|
+
/** Parent in the destination scene. Defaults to the scene root. */
|
|
634
|
+
target?: BaseObject;
|
|
635
|
+
/** Defaults to true so business style changes cannot edit another instance. */
|
|
636
|
+
cloneMaterial?: boolean;
|
|
637
|
+
}
|
|
638
|
+
|
|
520
639
|
/**
|
|
521
640
|
* 新场景文档以完整场景快照作为恢复基线。
|
|
522
641
|
* 未带标记的 JSON 属于旧格式,仍由编辑器的兼容流程处理。
|
|
523
642
|
*/
|
|
524
643
|
export declare function isSceneDocument(value: unknown): value is SceneDocumentMarker & Record<string, any>;
|
|
525
644
|
|
|
645
|
+
export declare function isSceneManifest(value: unknown): value is VisSceneManifest;
|
|
646
|
+
|
|
647
|
+
/** Copy once and redirect every user in this scene, including its SceneResources aliases. */
|
|
648
|
+
export declare function makeMaterialSceneLocal<T extends VisSceneDocument>(document: T, assetId: string, sceneId: string, newAssetId: string): T;
|
|
649
|
+
|
|
526
650
|
declare type Map_2 = Map_3;
|
|
527
651
|
export { Map_2 as Map }
|
|
528
652
|
|
|
@@ -610,6 +734,10 @@ declare class Map_3 extends Base_2 {
|
|
|
610
734
|
protected prepareInitialCamera(): Promise<void>;
|
|
611
735
|
private updateMapBoundary;
|
|
612
736
|
/* Excluded from this release type: finalizeRegionGeometry */
|
|
737
|
+
private prepareCityVis;
|
|
738
|
+
private preloadCityVis;
|
|
739
|
+
/** Keep at most two cities ahead in the loader; all Lead writes stay ordered. */
|
|
740
|
+
private initCitySequence;
|
|
613
741
|
initCityVis(adcode: number, grey?: boolean): Promise<City>;
|
|
614
742
|
initCityOnMap(adcode: number): Promise<void>;
|
|
615
743
|
private _getParentBgMetrics;
|
|
@@ -711,12 +839,15 @@ declare class Map_3 extends Base_2 {
|
|
|
711
839
|
*/
|
|
712
840
|
private applyOverlayLayers;
|
|
713
841
|
/**
|
|
714
|
-
*
|
|
842
|
+
* Apply the region behavior authored on each object.
|
|
715
843
|
*/
|
|
716
|
-
private
|
|
844
|
+
private applyRegionObjectState;
|
|
717
845
|
/* Excluded from this release type: rebuildRegion */
|
|
846
|
+
private rebuildRegionGeometry;
|
|
718
847
|
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
719
848
|
playRegionEnterTransition({ duration, sourceCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
849
|
+
/** Region rules are page-local runtime overrides of a saved material asset. */
|
|
850
|
+
private regionRuleMaterial;
|
|
720
851
|
private setRegionTexture;
|
|
721
852
|
applyRegionTextureRules(adcode: number): Promise<void>;
|
|
722
853
|
protected onDispose(): void;
|
|
@@ -778,8 +909,6 @@ declare interface MapOptions extends BaseOptions {
|
|
|
778
909
|
lineOffset?: number;
|
|
779
910
|
extrudeLineWidth?: number;
|
|
780
911
|
extrudeLine?: boolean;
|
|
781
|
-
equirectangular?: boolean;
|
|
782
|
-
winkel3?: boolean;
|
|
783
912
|
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
784
913
|
polarAngle?: number;
|
|
785
914
|
azimuthAngle?: number;
|
|
@@ -795,7 +924,6 @@ declare interface MapOptions extends BaseOptions {
|
|
|
795
924
|
geojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
796
925
|
extrudeLineGeojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
797
926
|
shadowMap?: boolean;
|
|
798
|
-
switchFixConfig?: SwitchFixConfig;
|
|
799
927
|
/** switchMapRegion 后按场景声明替换区域相关纹理。 */
|
|
800
928
|
regionTextureRules?: RegionTextureRule[];
|
|
801
929
|
/** 动态地图、城市数据和水面纹理的资源地址模板。 */
|
|
@@ -844,7 +972,7 @@ export declare interface MapSafeAreaOptions {
|
|
|
844
972
|
smoothTime?: number;
|
|
845
973
|
}
|
|
846
974
|
|
|
847
|
-
/**
|
|
975
|
+
/** 平台导出的运行时对象绑定,直接引用 Object3D.uuid。 */
|
|
848
976
|
declare interface MapSceneBindings {
|
|
849
977
|
container: string;
|
|
850
978
|
region: {
|
|
@@ -856,6 +984,86 @@ declare interface MapSceneBindings {
|
|
|
856
984
|
cities: string[];
|
|
857
985
|
}
|
|
858
986
|
|
|
987
|
+
export declare const MATERIAL_ASSET_ID = "_materialAssetId";
|
|
988
|
+
|
|
989
|
+
export declare const MATERIAL_ASSET_REVISION = "_materialAssetRevision";
|
|
990
|
+
|
|
991
|
+
export declare const MATERIAL_RUNTIME_PROPERTIES = "_materialRuntimeProperties";
|
|
992
|
+
|
|
993
|
+
/** Retained catalog entries are keyed by the native scene material UUID. */
|
|
994
|
+
export declare interface MaterialAlias {
|
|
995
|
+
assetId: string;
|
|
996
|
+
locked?: boolean;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
export declare interface MaterialAsset {
|
|
1000
|
+
id: string;
|
|
1001
|
+
revision: number;
|
|
1002
|
+
scope: MaterialScope;
|
|
1003
|
+
name: string;
|
|
1004
|
+
/** A complete Material.toJSON() value, including texture and image dependencies. */
|
|
1005
|
+
material: Record<string, any>;
|
|
1006
|
+
locked?: boolean;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
declare type MaterialBindings = Record<string, Record<string, string>>;
|
|
1010
|
+
|
|
1011
|
+
/** A declared scalar edit; revisions are commit metadata rather than editable properties. */
|
|
1012
|
+
export declare interface MaterialDefinitionScope {
|
|
1013
|
+
readonly assetIds: readonly string[];
|
|
1014
|
+
readonly properties: readonly string[];
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/** One explicit mapping from an asset's authored resource UUIDs to runtime resource UUIDs. */
|
|
1018
|
+
export declare function materializeAssetDefinition(asset: MaterialAsset, materialUuid?: string): Record<string, any>;
|
|
1019
|
+
|
|
1020
|
+
/** Mutate a detached working snapshot owned exclusively by the caller. */
|
|
1021
|
+
export declare function materializeOwnedSceneMaterials<T extends SceneViewportDocument>(scene: T, library?: MaterialAsset[]): T;
|
|
1022
|
+
|
|
1023
|
+
export declare function materializeProjectMaterials<T extends VisSceneDocument>(document: T): T;
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Scoped scalar history for already normalized snapshots. Unchanged object,
|
|
1027
|
+
* geometry and texture tables are borrowed; callers must keep snapshots immutable.
|
|
1028
|
+
* Structural/texture changes must use the full materialization entrypoint.
|
|
1029
|
+
*/
|
|
1030
|
+
export declare function materializeSceneMaterialDefinitions<T extends SceneViewportDocument>(scenes: readonly T[], previousAssets: MaterialAsset[], nextAssets: MaterialAsset[], scope?: MaterialDefinitionScope): T[];
|
|
1031
|
+
|
|
1032
|
+
/** Inject authoritative definitions while keeping each scene's material UUIDs stable. */
|
|
1033
|
+
export declare function materializeSceneMaterials<T extends SceneViewportDocument>(scene: T, library?: MaterialAsset[]): T;
|
|
1034
|
+
|
|
1035
|
+
/** One validation context per batch; never cached across caller mutations. */
|
|
1036
|
+
export declare function materializeSceneMaterialsBatch<T extends SceneViewportDocument>(scenes: readonly T[], library?: MaterialAsset[]): T[];
|
|
1037
|
+
|
|
1038
|
+
/** Serializable project data. This deliberately contains no THREE instances or GPU ownership. */
|
|
1039
|
+
export declare type MaterialScope = {
|
|
1040
|
+
kind: 'project';
|
|
1041
|
+
} | {
|
|
1042
|
+
kind: 'scene';
|
|
1043
|
+
sceneId: string;
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
export declare interface MaterialUsage {
|
|
1047
|
+
assetId: string;
|
|
1048
|
+
sceneId: string;
|
|
1049
|
+
objectId: string;
|
|
1050
|
+
slot: number;
|
|
1051
|
+
/** Constructor input rather than a native mesh material slot. */
|
|
1052
|
+
optionPath?: string[];
|
|
1053
|
+
alias?: string;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
/** Save author edits without promoting page-local region textures into a shared definition. */
|
|
1057
|
+
export declare function mergeAuthoredMaterialDefinition(savedDefinition: Record<string, any>, runtimeDefinition: Record<string, any>, options?: {
|
|
1058
|
+
editedProperties?: string[];
|
|
1059
|
+
}): Record<string, any>;
|
|
1060
|
+
|
|
1061
|
+
export declare function mergeProjectMaterials(target: VisSceneDocument, incoming: VisSceneDocument): {
|
|
1062
|
+
document: VisSceneDocument;
|
|
1063
|
+
materialLibrary: MaterialAsset[];
|
|
1064
|
+
idMap: Map<string, string>;
|
|
1065
|
+
};
|
|
1066
|
+
|
|
859
1067
|
declare class Model extends GroupObject {
|
|
860
1068
|
options: Options_7;
|
|
861
1069
|
mixer: THREE.AnimationMixer | null;
|
|
@@ -936,16 +1144,45 @@ declare class Mountain extends GroupObject {
|
|
|
936
1144
|
rebuildFromScene(): void;
|
|
937
1145
|
}
|
|
938
1146
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1147
|
+
/** Bind serialized runtime materials and alias catalogs to authored assets. */
|
|
1148
|
+
export declare function normalizeProjectMaterials<T extends VisSceneDocument>(document: T): T;
|
|
1149
|
+
|
|
1150
|
+
declare interface Options {
|
|
1151
|
+
/** @deprecated Legacy generation scope, read only when importing old snapshots. */
|
|
1152
|
+
uuid?: string;
|
|
1153
|
+
areaGroup?: boolean;
|
|
1154
|
+
geojson: GeoJSON_2;
|
|
1155
|
+
projection?: {
|
|
1156
|
+
center: [number, number];
|
|
1157
|
+
scale: number;
|
|
1158
|
+
rotate?: [number, number];
|
|
1159
|
+
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
1160
|
+
};
|
|
1161
|
+
extrudeLineGeojson?: GeoJSON_2;
|
|
1162
|
+
hasSide?: boolean;
|
|
1163
|
+
hasTop?: boolean;
|
|
1164
|
+
hasLine?: boolean;
|
|
1165
|
+
start?: number;
|
|
1166
|
+
depth?: number;
|
|
1167
|
+
lineOffset?: number;
|
|
1168
|
+
bbox?: number[];
|
|
1169
|
+
topSegments?: number;
|
|
1170
|
+
conic?: boolean;
|
|
1171
|
+
castShadow?: boolean;
|
|
1172
|
+
mergeSide?: boolean;
|
|
1173
|
+
hasExtrudeLine?: boolean;
|
|
1174
|
+
materialOptions: {
|
|
1175
|
+
topMat: THREE.Material;
|
|
1176
|
+
sideMat?: THREE.Material;
|
|
1177
|
+
lineMat?: MeshLineMaterial;
|
|
1178
|
+
extrudeLineMat?: MeshLineMaterial;
|
|
1179
|
+
bgTopMat?: THREE.Material;
|
|
1180
|
+
bgSideMat?: THREE.Material;
|
|
1181
|
+
bgLineMat?: MeshLineMaterial;
|
|
1182
|
+
bgExtrudeLineMat?: MeshLineMaterial;
|
|
1183
|
+
};
|
|
1184
|
+
onTop?: number;
|
|
1185
|
+
bloom?: boolean;
|
|
949
1186
|
}
|
|
950
1187
|
|
|
951
1188
|
declare interface Options_10 {
|
|
@@ -958,6 +1195,7 @@ declare interface Options_10 {
|
|
|
958
1195
|
cacheKey?: string;
|
|
959
1196
|
meters?: number;
|
|
960
1197
|
grey?: boolean;
|
|
1198
|
+
material?: MeshLineMaterial;
|
|
961
1199
|
}
|
|
962
1200
|
|
|
963
1201
|
declare interface Options_11 {
|
|
@@ -994,59 +1232,36 @@ declare interface Options_13 {
|
|
|
994
1232
|
}
|
|
995
1233
|
|
|
996
1234
|
declare interface Options_2 {
|
|
997
|
-
path?: THREE.Curve<THREE.Vector3>;
|
|
998
1235
|
radius?: number;
|
|
999
|
-
|
|
1236
|
+
rotationY?: number;
|
|
1000
1237
|
}
|
|
1001
1238
|
|
|
1002
1239
|
declare interface Options_3 {
|
|
1003
|
-
|
|
1004
|
-
areaGroup?: boolean;
|
|
1005
|
-
geojson: GeoJSON_2;
|
|
1006
|
-
projection?: {
|
|
1007
|
-
center: [number, number];
|
|
1008
|
-
scale: number;
|
|
1009
|
-
rotate?: [number, number];
|
|
1010
|
-
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
1011
|
-
};
|
|
1012
|
-
extrudeLineGeojson?: GeoJSON_2;
|
|
1013
|
-
hasSide?: boolean;
|
|
1014
|
-
hasTop?: boolean;
|
|
1015
|
-
hasLine?: boolean;
|
|
1016
|
-
start?: number;
|
|
1017
|
-
depth?: number;
|
|
1018
|
-
lineOffset?: number;
|
|
1019
|
-
bbox?: number[];
|
|
1020
|
-
topSegments?: number;
|
|
1021
|
-
conic?: boolean;
|
|
1022
|
-
castShadow?: boolean;
|
|
1023
|
-
mergeSide?: boolean;
|
|
1024
|
-
hasExtrudeLine?: boolean;
|
|
1025
|
-
materialOptions: {
|
|
1026
|
-
topMat: THREE.Material;
|
|
1027
|
-
sideMat?: THREE.Material;
|
|
1028
|
-
lineMat?: MeshLineMaterial;
|
|
1029
|
-
extrudeLineMat?: MeshLineMaterial;
|
|
1030
|
-
bgTopMat?: THREE.Material;
|
|
1031
|
-
bgSideMat?: THREE.Material;
|
|
1032
|
-
bgLineMat?: MeshLineMaterial;
|
|
1033
|
-
bgExtrudeLineMat?: MeshLineMaterial;
|
|
1034
|
-
};
|
|
1035
|
-
onTop?: number;
|
|
1036
|
-
bloom?: boolean;
|
|
1240
|
+
radius?: number;
|
|
1037
1241
|
}
|
|
1038
1242
|
|
|
1039
1243
|
declare interface Options_4 {
|
|
1040
|
-
|
|
1041
|
-
rotationY?: number;
|
|
1244
|
+
sprite?: boolean;
|
|
1042
1245
|
}
|
|
1043
1246
|
|
|
1044
|
-
declare interface Options_5 {
|
|
1247
|
+
declare interface Options_5 extends NonNullable<ConstructorParameters<typeof LineObject>[0]> {
|
|
1248
|
+
from: number[];
|
|
1249
|
+
to: number[];
|
|
1250
|
+
control1?: number[];
|
|
1251
|
+
control2?: number[];
|
|
1045
1252
|
radius?: number;
|
|
1253
|
+
globe?: boolean;
|
|
1254
|
+
color?: string;
|
|
1255
|
+
lineWidth?: number;
|
|
1256
|
+
offsetLoop?: boolean;
|
|
1046
1257
|
}
|
|
1047
1258
|
|
|
1048
1259
|
declare interface Options_6 {
|
|
1049
|
-
|
|
1260
|
+
path?: THREE.Curve<THREE.Vector3>;
|
|
1261
|
+
radius?: number;
|
|
1262
|
+
multiplyScalar?: number;
|
|
1263
|
+
/** Compact saved inputs for an Arc's derived picking geometry. */
|
|
1264
|
+
arcControlPoints?: number[][];
|
|
1050
1265
|
}
|
|
1051
1266
|
|
|
1052
1267
|
declare interface Options_7 {
|
|
@@ -1058,6 +1273,11 @@ declare interface Options_7 {
|
|
|
1058
1273
|
}
|
|
1059
1274
|
|
|
1060
1275
|
declare interface Options_8 {
|
|
1276
|
+
materialOptions: {
|
|
1277
|
+
topMat: THREE.Material;
|
|
1278
|
+
sideMat: THREE.Material;
|
|
1279
|
+
lineMat: MeshLineMaterial;
|
|
1280
|
+
};
|
|
1061
1281
|
scale: number;
|
|
1062
1282
|
depth: number;
|
|
1063
1283
|
assetsPrefix?: string;
|
|
@@ -1077,11 +1297,17 @@ declare interface Options_9 {
|
|
|
1077
1297
|
hasSide?: boolean;
|
|
1078
1298
|
sideGradient?: boolean;
|
|
1079
1299
|
grey?: boolean;
|
|
1300
|
+
materialOptions?: Record<string, THREE.Material>;
|
|
1080
1301
|
}
|
|
1081
1302
|
|
|
1082
1303
|
/** Pack an export copy only; preserve the editor's independent scene snapshots. */
|
|
1083
1304
|
export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
1084
1305
|
|
|
1306
|
+
export declare function patchSceneStructureDocument(document: VisSceneDocument, sceneId: string, patch: SceneStructurePatch): VisSceneDocument;
|
|
1307
|
+
|
|
1308
|
+
/** Validate every affected scene and both catalogs before exposing any saved state. */
|
|
1309
|
+
export declare function patchSceneStructureTransactionDocument(document: VisSceneDocument, transaction: SceneStructureTransaction): VisSceneDocument;
|
|
1310
|
+
|
|
1085
1311
|
declare class Plane extends MeshObject {
|
|
1086
1312
|
objectType: string;
|
|
1087
1313
|
create(): void;
|
|
@@ -1089,7 +1315,7 @@ declare class Plane extends MeshObject {
|
|
|
1089
1315
|
|
|
1090
1316
|
declare class PlaneMap extends GroupObject {
|
|
1091
1317
|
objectType: string;
|
|
1092
|
-
options: Required<Omit<
|
|
1318
|
+
options: Required<Omit<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>> & Pick<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>;
|
|
1093
1319
|
isActive: boolean;
|
|
1094
1320
|
groupArr: GroupObject[];
|
|
1095
1321
|
areaArr: ExtrudePolygonObject[];
|
|
@@ -1097,7 +1323,7 @@ declare class PlaneMap extends GroupObject {
|
|
|
1097
1323
|
mergeSideArea: ExtrudePolygonObject | null;
|
|
1098
1324
|
extrudelineArr?: LineObject[];
|
|
1099
1325
|
splitPolygons: number;
|
|
1100
|
-
constructor(options:
|
|
1326
|
+
constructor(options: Options);
|
|
1101
1327
|
create(): Promise<void>;
|
|
1102
1328
|
private markGeneratedObjects;
|
|
1103
1329
|
private ensureExtrudeLineMaterials;
|
|
@@ -1120,13 +1346,15 @@ declare class PlaneMap extends GroupObject {
|
|
|
1120
1346
|
onTop?: number;
|
|
1121
1347
|
areaGroup?: boolean;
|
|
1122
1348
|
}): Promise<LineObject[]>;
|
|
1349
|
+
private shouldUseGeometryWorker;
|
|
1123
1350
|
getPropertiesKey(properties: Record<string, any>): string;
|
|
1124
1351
|
geojson2Meta(geojson: GeoJSON_2): {
|
|
1125
1352
|
coords: Position[][];
|
|
1126
1353
|
properties: GeoJsonProperties;
|
|
1127
1354
|
}[];
|
|
1128
1355
|
update(_delta: number, elapsed: number): void;
|
|
1129
|
-
findGroup(adcode: string | number,
|
|
1356
|
+
findGroup(adcode: string | number, _fix?: boolean): GroupObject | undefined;
|
|
1357
|
+
private batchMaterialChanges;
|
|
1130
1358
|
useAreaMaterial(key: string): void;
|
|
1131
1359
|
useLineMaterial(key: string): void;
|
|
1132
1360
|
useExtrudeLineMaterial(key: string): void;
|
|
@@ -1137,7 +1365,6 @@ declare class PlaneMap extends GroupObject {
|
|
|
1137
1365
|
deactive(): void;
|
|
1138
1366
|
render(): void;
|
|
1139
1367
|
rebuildFromScene(): void;
|
|
1140
|
-
private clearGeneratedRegionProperties;
|
|
1141
1368
|
/**
|
|
1142
1369
|
* 场景快照保存的是网格实际材质,options 中的 Material 会被导出器过滤。
|
|
1143
1370
|
* 恢复完成后从生成对象反推下一次区域重建所需的运行时材质。
|
|
@@ -1155,8 +1382,8 @@ declare class PlaneShadow extends MeshObject {
|
|
|
1155
1382
|
|
|
1156
1383
|
declare class Point extends BaseObject {
|
|
1157
1384
|
objectType: string;
|
|
1158
|
-
options:
|
|
1159
|
-
constructor(options:
|
|
1385
|
+
options: Options_4;
|
|
1386
|
+
constructor(options: Options_4);
|
|
1160
1387
|
get material(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1161
1388
|
getMaterial(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1162
1389
|
create(): Promise<void>;
|
|
@@ -1170,11 +1397,29 @@ declare class PointLight extends PointLightObject {
|
|
|
1170
1397
|
render(): void;
|
|
1171
1398
|
}
|
|
1172
1399
|
|
|
1400
|
+
export declare interface PrefabAsset {
|
|
1401
|
+
id: string;
|
|
1402
|
+
name: string;
|
|
1403
|
+
revision: number;
|
|
1404
|
+
/** Stable public SDK identifier. Omit for assets used only by the editor. */
|
|
1405
|
+
sdkKey?: string;
|
|
1406
|
+
snapshot: Record<string, any>;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
/** An opaque, single-use topology transaction owned by the SceneManager that prepared it. */
|
|
1410
|
+
export declare interface PreparedSceneStructure {
|
|
1411
|
+
readonly [preparedSceneStructure]: true;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
declare const preparedSceneStructure: unique symbol;
|
|
1415
|
+
|
|
1416
|
+
export declare function promoteMaterialToProject<T extends VisSceneDocument>(document: T, assetId: string): T;
|
|
1417
|
+
|
|
1173
1418
|
declare class RectAreaLight extends RectAreaLightObject {
|
|
1174
1419
|
}
|
|
1175
1420
|
|
|
1176
1421
|
declare interface RegionTextureRule {
|
|
1177
|
-
/**
|
|
1422
|
+
/** 材质 UUID,或显式材质角色,例如 plane#topMat。 */
|
|
1178
1423
|
material: string;
|
|
1179
1424
|
/** THREE.Material 上的纹理属性,例如 map、emissiveMap。 */
|
|
1180
1425
|
property: string;
|
|
@@ -1192,14 +1437,25 @@ export declare interface RemappedSceneDocument {
|
|
|
1192
1437
|
entrySceneId: string;
|
|
1193
1438
|
scenes: SceneViewportDocument[];
|
|
1194
1439
|
idMap: Map<string, string>;
|
|
1440
|
+
materialLibrary?: MaterialAsset[];
|
|
1441
|
+
/** Reusable definitions, independent of scene instances. */
|
|
1442
|
+
prefabLibrary?: PrefabAsset[];
|
|
1195
1443
|
}
|
|
1196
1444
|
|
|
1445
|
+
/** A cross-project import remaps identities even if equal JSON happens to collide. */
|
|
1446
|
+
export declare function remapProjectMaterialIds<T extends VisSceneDocument>(document: T, createId: (asset: MaterialAsset, index: number) => string): {
|
|
1447
|
+
document: T;
|
|
1448
|
+
idMap: Map<string, string>;
|
|
1449
|
+
};
|
|
1450
|
+
|
|
1197
1451
|
/**
|
|
1198
1452
|
* 复制一组场景并为它们分配新 ID,同时保持文档内部的场景跳转关系。
|
|
1199
1453
|
* 用于把完整模板追加到另一个场景文档中。
|
|
1200
1454
|
*/
|
|
1201
1455
|
export declare function remapSceneDocumentIds(document: VisSceneDocument, createSceneId: (scene: SceneViewportDocument, index: number) => string): RemappedSceneDocument;
|
|
1202
1456
|
|
|
1457
|
+
export declare function removeProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string): T;
|
|
1458
|
+
|
|
1203
1459
|
declare class Ring extends MeshObject {
|
|
1204
1460
|
objectType: string;
|
|
1205
1461
|
create(): void;
|
|
@@ -1216,9 +1472,20 @@ declare class Road extends GroupObject {
|
|
|
1216
1472
|
dispose(): void;
|
|
1217
1473
|
}
|
|
1218
1474
|
|
|
1475
|
+
/** Only ordinary encoded images are externalized. Typed pixel data, videos and
|
|
1476
|
+
* custom payloads keep their original serialization contract. */
|
|
1477
|
+
declare interface RuntimeImageAsset {
|
|
1478
|
+
data: Uint8Array;
|
|
1479
|
+
mimeType: string;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1219
1482
|
export declare const SCENE_DOCUMENT_FORMAT: "vis-scene";
|
|
1220
1483
|
|
|
1221
|
-
export declare const SCENE_DOCUMENT_SCHEMA_VERSION:
|
|
1484
|
+
export declare const SCENE_DOCUMENT_SCHEMA_VERSION: 5;
|
|
1485
|
+
|
|
1486
|
+
export declare const SCENE_MANIFEST_FORMAT: "vis-scene-manifest";
|
|
1487
|
+
|
|
1488
|
+
export declare const SCENE_MANIFEST_SCHEMA_VERSION: 2;
|
|
1222
1489
|
|
|
1223
1490
|
export declare interface SceneBackInteraction {
|
|
1224
1491
|
trigger: 'click' | 'clickOutside';
|
|
@@ -1229,10 +1496,18 @@ export declare interface SceneBackInteraction {
|
|
|
1229
1496
|
};
|
|
1230
1497
|
}
|
|
1231
1498
|
|
|
1499
|
+
/** Scene membership/options delta. Existing authored graphs must use structure patches. */
|
|
1500
|
+
export declare interface SceneCollectionTransaction {
|
|
1501
|
+
scenes: readonly SceneViewportDocument[];
|
|
1502
|
+
entrySceneId: string;
|
|
1503
|
+
materialLibrary?: readonly MaterialAsset[];
|
|
1504
|
+
prefabLibrary?: readonly PrefabAsset[];
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1232
1507
|
declare interface SceneControlsOptions {
|
|
1233
|
-
mouseLeft?: number
|
|
1234
|
-
mouseRight?: number
|
|
1235
|
-
mouseWheel?: number
|
|
1508
|
+
mouseLeft?: number;
|
|
1509
|
+
mouseRight?: number;
|
|
1510
|
+
mouseWheel?: number;
|
|
1236
1511
|
mouseNone?: boolean;
|
|
1237
1512
|
viewportPadding?: [number, number, number, number];
|
|
1238
1513
|
autoRotateSpeed?: number;
|
|
@@ -1249,6 +1524,11 @@ declare interface SceneEnterTransitionOptions {
|
|
|
1249
1524
|
onPrepared?: () => void;
|
|
1250
1525
|
}
|
|
1251
1526
|
|
|
1527
|
+
export declare interface SceneInstantiatePrefabOptions extends InstantiatePrefabOptions {
|
|
1528
|
+
/** A scene already loaded by this manager. Defaults to the current scene. */
|
|
1529
|
+
sceneId?: string;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1252
1532
|
export declare type SceneInteraction = SceneSwitchInteraction | SceneBackInteraction | MapRegionSwitchInteraction | MapRegionBackInteraction;
|
|
1253
1533
|
|
|
1254
1534
|
export declare interface SceneInteractionFilter {
|
|
@@ -1263,6 +1543,10 @@ export declare interface SceneInteractionFilter {
|
|
|
1263
1543
|
export declare class SceneManager extends Event_2 {
|
|
1264
1544
|
private options;
|
|
1265
1545
|
private document?;
|
|
1546
|
+
private manifest?;
|
|
1547
|
+
private manifestUrl?;
|
|
1548
|
+
private loadedDefinitions;
|
|
1549
|
+
private definitionLoads;
|
|
1266
1550
|
private runtimeHooks?;
|
|
1267
1551
|
private instances;
|
|
1268
1552
|
private currentSceneId;
|
|
@@ -1271,11 +1555,22 @@ export declare class SceneManager extends Event_2 {
|
|
|
1271
1555
|
private isRegionSwitching;
|
|
1272
1556
|
private pencil?;
|
|
1273
1557
|
private safeAreaInsets;
|
|
1558
|
+
private generation;
|
|
1559
|
+
private documentIdentityRevision;
|
|
1560
|
+
private preparedStructures;
|
|
1561
|
+
private pendingInstances;
|
|
1562
|
+
private identityTrackedScenes;
|
|
1563
|
+
private prefabOperations;
|
|
1564
|
+
private transactionCacheDepth;
|
|
1565
|
+
private invalidatePendingOperations;
|
|
1566
|
+
private assertGeneration;
|
|
1274
1567
|
private debugInteraction;
|
|
1275
1568
|
private enablePickDebug;
|
|
1276
1569
|
private disposeInactiveScenes;
|
|
1277
1570
|
constructor(options: SceneManagerInitOptions);
|
|
1278
1571
|
private prepareScene;
|
|
1572
|
+
/** Publish one identity remap without exporting runtimes or copying other pages/resources. */
|
|
1573
|
+
remapCommittedIdentity(sceneId: string, previous: string, next: string, objectIdentity: boolean): boolean;
|
|
1279
1574
|
/**
|
|
1280
1575
|
* 设置宿主界面的运行时地图安全区。该状态不进入场景文档,并会自动传给
|
|
1281
1576
|
* 当前地图、缓存地图和后续创建的地图区域。
|
|
@@ -1286,19 +1581,69 @@ export declare class SceneManager extends Event_2 {
|
|
|
1286
1581
|
private playTransition;
|
|
1287
1582
|
/** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
|
|
1288
1583
|
setDocument(document: VisSceneDocument): void;
|
|
1289
|
-
|
|
1584
|
+
private syncPrefabLibraries;
|
|
1585
|
+
/**
|
|
1586
|
+
* Replace the complete metadata projection for existing scenes without
|
|
1587
|
+
* recopying assets. Omitted interactions remove the field; own undefined is
|
|
1588
|
+
* preserved, so callers editing only names must include the other metadata.
|
|
1589
|
+
*/
|
|
1590
|
+
patchDocumentMetadata(patch: {
|
|
1591
|
+
entrySceneId: string;
|
|
1592
|
+
scenes: Pick<SceneViewportDocument, 'id' | 'name' | 'interactions'>[];
|
|
1593
|
+
s?: string;
|
|
1594
|
+
}): void;
|
|
1595
|
+
/** Commit camera/controls state without validating or cloning authored resources. */
|
|
1596
|
+
patchSceneViewport(sceneId: string, patch: SceneViewportPatch): void;
|
|
1597
|
+
/** Apply validated object properties without copying unrelated nodes or resource tables. */
|
|
1598
|
+
patchSceneObjects(sceneId: string, patches: SceneObjectPatch[]): void;
|
|
1599
|
+
/** Native inspector edits keep the validated topology/resource baseline and its UUID index. */
|
|
1600
|
+
patchSceneObjectProperties(sceneId: string, patches: readonly SceneObjectPropertyPatch[]): void;
|
|
1601
|
+
/** Commit a validated topology delta without cloning unrelated saved scenes or resources. */
|
|
1602
|
+
patchSceneStructure(sceneId: string, patch: SceneStructurePatch): void;
|
|
1603
|
+
/** Commit related topology changes across scenes without exposing intermediate revisions. */
|
|
1604
|
+
patchSceneStructureTransaction(transaction: SceneStructureTransaction): void;
|
|
1605
|
+
private requireStructureDocument;
|
|
1606
|
+
/** Own and validate a topology delta before allocating or moving runtime objects. */
|
|
1607
|
+
prepareSceneStructure(sceneId: string, patch: SceneStructurePatch): PreparedSceneStructure;
|
|
1608
|
+
/** Prepare related edits across scenes and shared catalogs as one atomic transaction. */
|
|
1609
|
+
prepareSceneStructureTransaction(transaction: SceneStructureTransaction): PreparedSceneStructure;
|
|
1610
|
+
/** Own only new pages and changed metadata; retain every existing authored graph. */
|
|
1611
|
+
prepareSceneCollectionTransaction(transaction: SceneCollectionTransaction): PreparedSceneStructure;
|
|
1612
|
+
/** A newly hydrated empty Base seed acquires its own camera/default options once. */
|
|
1613
|
+
prepareSceneInitialization(sceneId: string, definition: SceneViewportDocument): PreparedSceneStructure;
|
|
1614
|
+
/** Collection edits keep cached pages until their enclosing history transaction accepts. */
|
|
1615
|
+
activateSceneForTransaction(sceneId: string, hooks?: Record<string, any>, signal?: AbortSignal): Promise<Base_2>;
|
|
1616
|
+
/** Retire exactly the detached page; never invalidate other loaded pages or pending resources. */
|
|
1617
|
+
retireSceneForTransaction(sceneId: string, expected: Base_2): void;
|
|
1618
|
+
private ownPreparedStructure;
|
|
1619
|
+
private requirePreparedStructure;
|
|
1620
|
+
/**
|
|
1621
|
+
* Check the saved sections affected by topology history without handing out
|
|
1622
|
+
* the private candidate. Editor config/dev metadata is outside this delta.
|
|
1623
|
+
*/
|
|
1624
|
+
preparedSceneStructureMatches(prepared: PreparedSceneStructure, target: Pick<VisSceneDocument, 'scenes' | 'materialLibrary' | 'prefabLibrary'>): boolean;
|
|
1625
|
+
/** Commit the already validated candidate once, provided its source is still current. */
|
|
1626
|
+
commitSceneStructure(prepared: PreparedSceneStructure): void;
|
|
1627
|
+
/** Commit scalar material history without accepting or copying caller object graphs. */
|
|
1628
|
+
patchMaterialDefinitions(assets: MaterialAsset[], scenes: Pick<SceneViewportDocument, 'id'>[], scope?: MaterialDefinitionScope): void;
|
|
1629
|
+
load(documentOrUrl: VisSceneDocument | VisSceneManifest | string, hooks?: Record<string, any>): Promise<Base_2>;
|
|
1290
1630
|
/**
|
|
1291
1631
|
* 创建一个没有快照输入的运行时页面,并在可选构建步骤完成后将其导出为
|
|
1292
1632
|
* 标准单场景文档。主要供编辑器新建和旧模板迁移使用。
|
|
1293
1633
|
*/
|
|
1294
|
-
createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_2) => void | Promise<void
|
|
1634
|
+
createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_2) => void | Promise<void>, materialLibrary?: MaterialAsset[]): Promise<Base_2>;
|
|
1295
1635
|
/**
|
|
1296
1636
|
* 以指定地图模板和行政区直接启动,不先加载文档配置的入口场景。
|
|
1297
1637
|
* 适用于宿主按路由或业务参数决定初始省、市、区的场景。
|
|
1298
1638
|
*/
|
|
1299
|
-
loadMapRegion(documentOrUrl: VisSceneDocument | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_3>;
|
|
1300
|
-
loadMapRegion(documentOrUrl: VisSceneDocument | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_3>;
|
|
1639
|
+
loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_3>;
|
|
1640
|
+
loadMapRegion(documentOrUrl: VisSceneDocument | VisSceneManifest | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_3>;
|
|
1301
1641
|
private loadDocument;
|
|
1642
|
+
private getSceneMetadata;
|
|
1643
|
+
private resolveManifestSource;
|
|
1644
|
+
private resolveBundleImages;
|
|
1645
|
+
private loadSceneDefinition;
|
|
1646
|
+
private createRuntimeSceneDocument;
|
|
1302
1647
|
switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
|
|
1303
1648
|
/**
|
|
1304
1649
|
* 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
|
|
@@ -1328,9 +1673,25 @@ export declare class SceneManager extends Event_2 {
|
|
|
1328
1673
|
getSceneByName<T extends SceneType>(name: string, type: T): SceneTypeMap[T] | undefined;
|
|
1329
1674
|
getSceneByName(name: string): Base_2 | undefined;
|
|
1330
1675
|
private getSceneByType;
|
|
1676
|
+
/** Inspect saved definitions without creating or pinning runtime materials. */
|
|
1677
|
+
getMaterialLibrary(): MaterialAsset[];
|
|
1678
|
+
/** SDK-enabled definitions stay unloaded until explicitly instantiated. */
|
|
1679
|
+
getPrefabLibrary(): PrefabAsset[];
|
|
1680
|
+
instantiatePrefab(keyOrAssetId: string, options?: SceneInstantiatePrefabOptions): Promise< BaseObject>;
|
|
1681
|
+
/**
|
|
1682
|
+
* Update a saved asset and transactionally rebuild each affected cached page.
|
|
1683
|
+
* Reacquire Base/Object handles after this call: replaced pages are disposed.
|
|
1684
|
+
* Current runtime geometry, options, active page and camera are preserved.
|
|
1685
|
+
*/
|
|
1686
|
+
updateMaterial(assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): Promise<Base_2 | null>;
|
|
1687
|
+
/** Immutable borrowed snapshot for coordinated COW editing; write through patch APIs. */
|
|
1688
|
+
getDocumentSnapshot(): Readonly<VisSceneDocument> | undefined;
|
|
1331
1689
|
getDocument(): VisSceneDocument | undefined;
|
|
1690
|
+
getManifest(): VisSceneManifest | undefined;
|
|
1332
1691
|
private bindSceneInteractions;
|
|
1333
1692
|
canBack(): boolean;
|
|
1693
|
+
/** Release a cached/active page while retaining its document and saved material definitions. */
|
|
1694
|
+
unloadScene(sceneId: string): boolean;
|
|
1334
1695
|
private disposeInstances;
|
|
1335
1696
|
dispose(): void;
|
|
1336
1697
|
}
|
|
@@ -1344,6 +1705,8 @@ export declare interface SceneManagerBehaviorOptions {
|
|
|
1344
1705
|
prepareScene?: (scene: Base_2) => void;
|
|
1345
1706
|
/** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
|
|
1346
1707
|
cacheScenes?: boolean;
|
|
1708
|
+
/** 自定义分包场景读取器;可从 IndexedDB 等非 HTTP 存储按需读取。 */
|
|
1709
|
+
loadScene?: (entry: SceneManifestEntry) => Promise<SceneViewportDocument>;
|
|
1347
1710
|
}
|
|
1348
1711
|
|
|
1349
1712
|
export declare type SceneManagerInitOptions = SceneManagerOptions & SceneManagerBehaviorOptions;
|
|
@@ -1355,6 +1718,112 @@ export declare interface SceneManagerOptions extends Pick<BaseOptions, 'containe
|
|
|
1355
1718
|
safeAreaInsets?: Partial<MapSafeAreaInsets>;
|
|
1356
1719
|
}
|
|
1357
1720
|
|
|
1721
|
+
export declare interface SceneManifestEntry extends Omit<SceneViewportDocument, 'scene'> {
|
|
1722
|
+
/** Relative to the manifest URL unless an absolute URL is supplied. */
|
|
1723
|
+
source: string;
|
|
1724
|
+
/** Uncompressed JSON bytes, used only for diagnostics and progress UI. */
|
|
1725
|
+
bytes?: number;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
/** Dependency closure for a selected scene; preserve unused aliases as document uses. */
|
|
1729
|
+
export declare function sceneMaterialLibrary(scene: SceneViewportDocument, library?: MaterialAsset[], prefabs?: VisSceneDocument['prefabLibrary']): MaterialAsset[];
|
|
1730
|
+
|
|
1731
|
+
export declare interface SceneObjectPatch {
|
|
1732
|
+
uuid: string;
|
|
1733
|
+
state: {
|
|
1734
|
+
matrix?: number[];
|
|
1735
|
+
matrixAutoUpdate?: boolean;
|
|
1736
|
+
pivot?: number[] | null;
|
|
1737
|
+
name?: string;
|
|
1738
|
+
visible?: boolean;
|
|
1739
|
+
layers?: number;
|
|
1740
|
+
};
|
|
1741
|
+
unset?: ('matrix' | 'matrixAutoUpdate' | 'pivot' | 'name' | 'visible' | 'layers')[];
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
declare interface SceneObjectPropertyPatch {
|
|
1745
|
+
uuid: string;
|
|
1746
|
+
state: Record<string, any>;
|
|
1747
|
+
unset?: readonly string[];
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
declare type ScenePropertyField = typeof scenePropertyFields[number];
|
|
1751
|
+
|
|
1752
|
+
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"];
|
|
1753
|
+
|
|
1754
|
+
export declare type SceneStructureGraphKey = 'materialAliases' | 'shapes' | '_sharedOptionsPool' | '_texDataPool';
|
|
1755
|
+
|
|
1756
|
+
/** Metadata is part of an owned structure transaction, never a scalar runtime patch. */
|
|
1757
|
+
export declare interface SceneStructureObjectPatch {
|
|
1758
|
+
uuid: string;
|
|
1759
|
+
state: SceneObjectPatch['state'] & Partial<Record<ScenePropertyField, any>> & {
|
|
1760
|
+
matrixAutoUpdate?: boolean;
|
|
1761
|
+
userData?: Record<string, any>;
|
|
1762
|
+
geometry?: string | null;
|
|
1763
|
+
material?: string | string[];
|
|
1764
|
+
background?: number | string | null;
|
|
1765
|
+
environment?: string | null;
|
|
1766
|
+
};
|
|
1767
|
+
unset?: (NonNullable<SceneObjectPatch['unset']>[number] | ScenePropertyField | 'matrixAutoUpdate' | 'userData' | 'geometry' | 'material' | 'background' | 'environment')[];
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
export declare interface SceneStructurePatch {
|
|
1771
|
+
/** Final direct-child order. Omitting an old child detaches its subtree. */
|
|
1772
|
+
parents: {
|
|
1773
|
+
uuid: string;
|
|
1774
|
+
children: string[];
|
|
1775
|
+
}[];
|
|
1776
|
+
/** New serialized subtree roots, with UUIDs absent from the current scene. */
|
|
1777
|
+
additions?: Record<string, any>[];
|
|
1778
|
+
/** Replace existing subtree roots, retaining their UUID and owning the supplied descendants. */
|
|
1779
|
+
replacements?: Record<string, any>[];
|
|
1780
|
+
objects?: SceneStructureObjectPatch[];
|
|
1781
|
+
/** Viewport payload participates atomically with object/resource changes. */
|
|
1782
|
+
viewport?: SceneStructureViewportPatch;
|
|
1783
|
+
/** Authored scene aliases; these refer to assets, rather than runtime material UUIDs. */
|
|
1784
|
+
aliases?: {
|
|
1785
|
+
set?: NonNullable<SceneViewportDocument['materialAliases']>;
|
|
1786
|
+
unset?: true;
|
|
1787
|
+
};
|
|
1788
|
+
/** Keep object removals and their authored interaction bindings in one transaction. */
|
|
1789
|
+
interactions?: {
|
|
1790
|
+
set?: SceneViewportDocument['interactions'];
|
|
1791
|
+
unset?: true;
|
|
1792
|
+
};
|
|
1793
|
+
/** Small graph metadata and explicitly changed pools, never an entire scene graph. */
|
|
1794
|
+
graph?: {
|
|
1795
|
+
set?: Partial<Record<SceneStructureGraphKey, any>>;
|
|
1796
|
+
unset?: SceneStructureGraphKey[];
|
|
1797
|
+
};
|
|
1798
|
+
resources?: Partial<Record<SceneStructureResource, {
|
|
1799
|
+
upsert?: Record<string, any>[];
|
|
1800
|
+
remove?: string[];
|
|
1801
|
+
unset?: true;
|
|
1802
|
+
}>>;
|
|
1803
|
+
assets?: {
|
|
1804
|
+
upsert?: MaterialAsset[];
|
|
1805
|
+
remove?: string[];
|
|
1806
|
+
};
|
|
1807
|
+
prefabs?: {
|
|
1808
|
+
upsert?: PrefabAsset[];
|
|
1809
|
+
remove?: string[];
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
export declare type SceneStructureResource = 'geometries' | 'materials' | 'textures' | 'images' | 'skeletons' | 'animations';
|
|
1814
|
+
|
|
1815
|
+
/** Scene edits and shared catalogs form one atomic project-document transaction. */
|
|
1816
|
+
export declare interface SceneStructureTransaction {
|
|
1817
|
+
scenes: {
|
|
1818
|
+
sceneId: string;
|
|
1819
|
+
patch: Omit<SceneStructurePatch, 'assets' | 'prefabs'>;
|
|
1820
|
+
}[];
|
|
1821
|
+
assets?: SceneStructurePatch['assets'];
|
|
1822
|
+
prefabs?: SceneStructurePatch['prefabs'];
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
export declare type SceneStructureViewportPatch = Partial<SceneViewportPatch>;
|
|
1826
|
+
|
|
1358
1827
|
export declare interface SceneSwitchInteraction {
|
|
1359
1828
|
trigger: 'click' | 'clickOutside';
|
|
1360
1829
|
objectId: string;
|
|
@@ -1389,23 +1858,34 @@ export declare interface SceneViewportDocument {
|
|
|
1389
1858
|
options: Record<string, any>;
|
|
1390
1859
|
};
|
|
1391
1860
|
scene: Record<string, any>;
|
|
1861
|
+
/** Scene-local SceneResources aliases. Locked means retained on export, not GPU residency. */
|
|
1862
|
+
materialAliases?: Record<string, MaterialAlias>;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
/** Camera motion and controls do not change authored scene topology/resources. */
|
|
1866
|
+
export declare interface SceneViewportPatch {
|
|
1867
|
+
camera: {
|
|
1868
|
+
uuid: string;
|
|
1869
|
+
type: 'PerspectiveCamera' | 'OrthographicCamera';
|
|
1870
|
+
state: Record<string, any>;
|
|
1871
|
+
unset: string[];
|
|
1872
|
+
};
|
|
1873
|
+
cs?: SceneViewportDocument['cs'];
|
|
1874
|
+
csa?: string;
|
|
1875
|
+
controls: Record<string, any>;
|
|
1392
1876
|
}
|
|
1393
1877
|
|
|
1394
1878
|
export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1395
1879
|
|
|
1396
1880
|
declare type SerializedClip = ReturnType<(typeof THREE.AnimationClip)['toJSON']>;
|
|
1397
1881
|
|
|
1398
|
-
declare const sinusoidalInOut: ({ onUpdate, onComplete, backwards, }?: {
|
|
1399
|
-
onUpdate?: ((v: number) => void) | undefined;
|
|
1400
|
-
onComplete?: (() => void) | undefined;
|
|
1401
|
-
backwards?: boolean | undefined;
|
|
1402
|
-
}) => {
|
|
1882
|
+
declare const sinusoidalInOut: ({ owner, onUpdate, onComplete, onCancel, backwards, }?: TweenOptions) => {
|
|
1403
1883
|
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
1404
1884
|
duration?: number | undefined;
|
|
1405
1885
|
repeat?: number | undefined;
|
|
1406
1886
|
repeatResolve?: number | undefined;
|
|
1407
1887
|
repeatDelay?: number | undefined;
|
|
1408
|
-
}) => Promise<
|
|
1888
|
+
}) => Promise<void>;
|
|
1409
1889
|
stop: () => void;
|
|
1410
1890
|
};
|
|
1411
1891
|
|
|
@@ -1419,12 +1899,31 @@ declare class Sphere extends MeshObject {
|
|
|
1419
1899
|
|
|
1420
1900
|
declare class SphereShadow extends MeshObject {
|
|
1421
1901
|
objectType: string;
|
|
1422
|
-
options: Required<
|
|
1423
|
-
constructor(options:
|
|
1902
|
+
options: Required<Options_3>;
|
|
1903
|
+
constructor(options: Options_3);
|
|
1424
1904
|
create(): Promise<void>;
|
|
1425
1905
|
rebuildFromScene(): void;
|
|
1426
1906
|
}
|
|
1427
1907
|
|
|
1908
|
+
/**
|
|
1909
|
+
* Creates deployable, independently fetchable scene JSON values. Resources are
|
|
1910
|
+
* expanded per scene so loading the entry scene never requires a global pool.
|
|
1911
|
+
*/
|
|
1912
|
+
export declare function splitSceneDocument(document: VisSceneDocument, options?: {
|
|
1913
|
+
sceneDirectory?: string;
|
|
1914
|
+
extension?: '.json' | '.json.gz';
|
|
1915
|
+
externalizeImages?: boolean;
|
|
1916
|
+
omitEditorAssets?: boolean;
|
|
1917
|
+
}): SplitSceneDocumentBundle;
|
|
1918
|
+
|
|
1919
|
+
export declare interface SplitSceneDocumentBundle {
|
|
1920
|
+
manifest: VisSceneManifest;
|
|
1921
|
+
/** Keys are the relative source paths written into the manifest. */
|
|
1922
|
+
scenes: Record<string, SceneViewportDocument>;
|
|
1923
|
+
/** Binary files to write alongside the manifest and scene files. */
|
|
1924
|
+
assets?: Record<string, RuntimeImageAsset>;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1428
1927
|
declare class SpotLight extends SpotLightObject {
|
|
1429
1928
|
constructor(...options: ConstructorParameters<typeof SpotLightObject>);
|
|
1430
1929
|
update(delta: number, elapsed: number): void;
|
|
@@ -1437,20 +1936,7 @@ declare class Sprite extends SpriteObject {
|
|
|
1437
1936
|
setDesiredPixelSize(size: number): void;
|
|
1438
1937
|
}
|
|
1439
1938
|
|
|
1440
|
-
declare
|
|
1441
|
-
/** 按参考缩放比缩放,并移到地图中心 */
|
|
1442
|
-
s?: string[];
|
|
1443
|
-
/** z 位置按缩放比缩放 */
|
|
1444
|
-
z?: string[];
|
|
1445
|
-
/** 移到地图顶面 */
|
|
1446
|
-
t?: string[];
|
|
1447
|
-
/** 移到地图底面 */
|
|
1448
|
-
b?: string[];
|
|
1449
|
-
/** 灯光按缩放比调整 */
|
|
1450
|
-
l?: string[];
|
|
1451
|
-
/** 删除对象 */
|
|
1452
|
-
r?: string[];
|
|
1453
|
-
}
|
|
1939
|
+
export declare function stripMaterialAssetBinding<T extends Record<string, any>>(material: T): T;
|
|
1454
1940
|
|
|
1455
1941
|
export declare interface SwitchSceneOptions {
|
|
1456
1942
|
/** 返回历史时不再记录当前场景。 */
|
|
@@ -1465,8 +1951,8 @@ declare const timeOut: (ms: number) => Promise<any>;
|
|
|
1465
1951
|
|
|
1466
1952
|
declare class Tube extends MeshObject {
|
|
1467
1953
|
objectType: string;
|
|
1468
|
-
options:
|
|
1469
|
-
constructor(options:
|
|
1954
|
+
options: Options_6;
|
|
1955
|
+
constructor(options: Options_6);
|
|
1470
1956
|
create(): void;
|
|
1471
1957
|
}
|
|
1472
1958
|
|
|
@@ -1474,13 +1960,43 @@ export { TWEEN }
|
|
|
1474
1960
|
|
|
1475
1961
|
export { Tween }
|
|
1476
1962
|
|
|
1477
|
-
|
|
1963
|
+
declare interface TweenOptions {
|
|
1964
|
+
owner?: Pick<Pencil, 'animations'>;
|
|
1965
|
+
onUpdate?: (value: number) => void;
|
|
1966
|
+
onComplete?: () => void;
|
|
1967
|
+
onCancel?: () => void;
|
|
1968
|
+
backwards?: boolean;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
|
|
1972
|
+
|
|
1973
|
+
export declare const VERSION = "0.33.0";
|
|
1478
1974
|
|
|
1479
1975
|
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
1480
1976
|
entrySceneId: string;
|
|
1481
1977
|
scenes: SceneViewportDocument[];
|
|
1482
1978
|
/** Schema 3: image/video/data payloads shared across scenes, never live textures. */
|
|
1483
1979
|
_resourcePool?: any[];
|
|
1980
|
+
/** Schema 4: serializable definitions shared by explicit asset identity. */
|
|
1981
|
+
materialLibrary?: MaterialAsset[];
|
|
1982
|
+
/** Reusable definitions. SDK-enabled assets are retained in deployment exports. */
|
|
1983
|
+
prefabLibrary?: PrefabAsset[];
|
|
1984
|
+
c?: Record<string, any>;
|
|
1985
|
+
d?: Record<string, any>;
|
|
1986
|
+
h?: Record<string, any>;
|
|
1987
|
+
s?: string;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
export declare interface VisSceneManifest {
|
|
1991
|
+
format: typeof SCENE_MANIFEST_FORMAT;
|
|
1992
|
+
schemaVersion: 1 | typeof SCENE_MANIFEST_SCHEMA_VERSION;
|
|
1993
|
+
entrySceneId: string;
|
|
1994
|
+
scenes: SceneManifestEntry[];
|
|
1995
|
+
materialLibrary?: MaterialAsset[];
|
|
1996
|
+
/** Externalized image files, relative to the manifest URL. */
|
|
1997
|
+
imageAssets?: string[];
|
|
1998
|
+
/** Reusable definitions. Only assets with sdkKey are available for SDK instantiation. */
|
|
1999
|
+
prefabLibrary?: PrefabAsset[];
|
|
1484
2000
|
c?: Record<string, any>;
|
|
1485
2001
|
d?: Record<string, any>;
|
|
1486
2002
|
h?: Record<string, any>;
|
|
@@ -1488,15 +2004,3 @@ export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
|
1488
2004
|
}
|
|
1489
2005
|
|
|
1490
2006
|
export { }
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
declare module '@turf/turf' {
|
|
1495
|
-
export function point(...args: any[]): any;
|
|
1496
|
-
export function polygon(...args: any[]): any;
|
|
1497
|
-
export function booleanPointInPolygon(...args: any[]): boolean;
|
|
1498
|
-
export function center(...args: any[]): any;
|
|
1499
|
-
export function centroid(...args: any[]): any;
|
|
1500
|
-
export function bbox(...args: any[]): any;
|
|
1501
|
-
export function union(...args: any[]): any;
|
|
1502
|
-
}
|