vis-core 0.32.8 → 0.33.1
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 +603 -141
- 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,6 +86,9 @@ 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' | '_resourcePool'>): void;
|
|
91
|
+
|
|
86
92
|
/** vis-core 的运行时入口只接受编辑平台导出的完整场景文档。 */
|
|
87
93
|
export declare function assertRuntimeSceneDocument(value: unknown): asserts value is VisSceneDocument & Record<string, any>;
|
|
88
94
|
|
|
@@ -98,23 +104,35 @@ declare class Base_2 extends Camera {
|
|
|
98
104
|
observeParentScale: boolean;
|
|
99
105
|
applyDisabledMouseButtons: boolean;
|
|
100
106
|
cacheCityGeometry: boolean;
|
|
107
|
+
includePrefabPreviews: boolean;
|
|
101
108
|
};
|
|
102
109
|
leftTruck: boolean;
|
|
103
110
|
options: BaseOptions;
|
|
104
111
|
showState: boolean;
|
|
105
|
-
settings: Record<string, any>;
|
|
106
112
|
lead: Lead;
|
|
107
|
-
|
|
113
|
+
sceneResources: default_2['sceneResources'];
|
|
108
114
|
tier0: boolean;
|
|
109
115
|
pmremGenerator: THREE.PMREMGenerator | null;
|
|
110
116
|
re: RoomEnvironment | null;
|
|
111
117
|
roomEnvMap?: THREE.Texture;
|
|
112
118
|
private roomEnvTarget?;
|
|
119
|
+
private roomEnvLease?;
|
|
113
120
|
visName: string;
|
|
114
121
|
private detectRes?;
|
|
115
122
|
private ownsPencil;
|
|
116
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;
|
|
117
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>>;
|
|
118
136
|
private getDetectRes;
|
|
119
137
|
private getQueryOverrides;
|
|
120
138
|
private getEffectiveLogarithmicDepthBuffer;
|
|
@@ -126,6 +144,8 @@ declare class Base_2 extends Camera {
|
|
|
126
144
|
/* Excluded from this release type: fromJSON */
|
|
127
145
|
private runtimeInitialization?;
|
|
128
146
|
private disposed;
|
|
147
|
+
private readonly handleObjectIdentityChanged;
|
|
148
|
+
private readonly handleMaterialIdentityChanged;
|
|
129
149
|
/* Excluded from this release type: initializeRuntime */
|
|
130
150
|
/** 子类扩展点:运行环境只初始化一次,适合建立投影和绑定控制器事件。 */
|
|
131
151
|
protected onRuntimeReady(): Promise<void>;
|
|
@@ -135,8 +155,8 @@ declare class Base_2 extends Camera {
|
|
|
135
155
|
protected onDispose(): void;
|
|
136
156
|
protected get objectTypes(): Record<string, any>;
|
|
137
157
|
protected get defaultCameraUp(): THREE.Vector3;
|
|
138
|
-
private observeScale;
|
|
139
158
|
private createRuntime;
|
|
159
|
+
private reportScriptError;
|
|
140
160
|
private sceneActive;
|
|
141
161
|
setSceneActive(): void;
|
|
142
162
|
/**
|
|
@@ -154,18 +174,30 @@ declare class Base_2 extends Camera {
|
|
|
154
174
|
/** 场景页提交后的默认入场动画;地图可覆盖为更有空间感的过渡。 */
|
|
155
175
|
playEnterTransition({ duration, onPrepared, }: SceneEnterTransitionOptions): Promise<void>;
|
|
156
176
|
addCSS3DRenderer(container?: HTMLElement): void;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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;
|
|
161
188
|
protected prepareInitialCamera(): Promise<void>;
|
|
189
|
+
private restoreCameraControlTarget;
|
|
162
190
|
private showing?;
|
|
191
|
+
private sceneTemporarilyHidden;
|
|
192
|
+
private authoredSceneVisible;
|
|
193
|
+
private hideSceneContent;
|
|
194
|
+
private showSceneContent;
|
|
163
195
|
show(): Promise<void>;
|
|
164
196
|
hide(): void;
|
|
165
|
-
exportScene():
|
|
166
|
-
exportBaseObject(baseObject: BaseObject):
|
|
167
|
-
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any>, signal?: AbortSignal): Promise<BaseObject<THREE.Object3D<THREE.Object3DEventMap>>>;
|
|
168
|
-
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>;
|
|
169
201
|
getClassRefByType(type: string): typeof BaseObject;
|
|
170
202
|
addGroup(): Promise< GroupObject>;
|
|
171
203
|
addCSS2D(dom: HTMLElement, options?: {
|
|
@@ -188,10 +220,9 @@ declare class Base_2 extends Camera {
|
|
|
188
220
|
uuidByObject(object: THREE.Object3D): string | undefined;
|
|
189
221
|
objectByUuid(key: string): THREE.Object3D<THREE.Object3DEventMap>;
|
|
190
222
|
uuidByBaseObject(object: BaseObject): string;
|
|
191
|
-
baseObjectByUuid(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
private normalizeBaseObjectKey;
|
|
223
|
+
baseObjectByUuid(uuid: string): BaseObject;
|
|
224
|
+
/** Compatibility method name; key is the persisted UUID. */
|
|
225
|
+
baseObjectByKey(key: string): BaseObject;
|
|
195
226
|
baseObjectByName(name: string): BaseObject<THREE.Object3D<THREE.Object3DEventMap>> | undefined;
|
|
196
227
|
dispose(): void;
|
|
197
228
|
}
|
|
@@ -202,7 +233,7 @@ declare const baseObjectBounce: (obj: BaseObject, up: string | undefined, to: nu
|
|
|
202
233
|
repeat?: number | undefined;
|
|
203
234
|
repeatResolve?: number | undefined;
|
|
204
235
|
repeatDelay?: number | undefined;
|
|
205
|
-
}) => Promise<
|
|
236
|
+
}) => Promise<void>;
|
|
206
237
|
stop: () => void;
|
|
207
238
|
};
|
|
208
239
|
|
|
@@ -212,7 +243,7 @@ declare const baseObjectBounceIn: (obj: BaseObject, up?: string) => {
|
|
|
212
243
|
repeat?: number | undefined;
|
|
213
244
|
repeatResolve?: number | undefined;
|
|
214
245
|
repeatDelay?: number | undefined;
|
|
215
|
-
}) => Promise<
|
|
246
|
+
}) => Promise<void>;
|
|
216
247
|
stop: () => void;
|
|
217
248
|
};
|
|
218
249
|
|
|
@@ -222,7 +253,7 @@ declare const baseObjectFadeIn: (obj: BaseObject) => {
|
|
|
222
253
|
repeat?: number | undefined;
|
|
223
254
|
repeatResolve?: number | undefined;
|
|
224
255
|
repeatDelay?: number | undefined;
|
|
225
|
-
}) => Promise<
|
|
256
|
+
}) => Promise<void>;
|
|
226
257
|
stop: () => void;
|
|
227
258
|
};
|
|
228
259
|
|
|
@@ -232,7 +263,7 @@ declare const baseObjectFadeOut: (obj: BaseObject) => {
|
|
|
232
263
|
repeat?: number | undefined;
|
|
233
264
|
repeatResolve?: number | undefined;
|
|
234
265
|
repeatDelay?: number | undefined;
|
|
235
|
-
}) => Promise<
|
|
266
|
+
}) => Promise<void>;
|
|
236
267
|
stop: () => void;
|
|
237
268
|
};
|
|
238
269
|
|
|
@@ -248,11 +279,25 @@ declare interface BaseOptions {
|
|
|
248
279
|
tier?: number;
|
|
249
280
|
observeParentScale?: boolean;
|
|
250
281
|
createIfNeeded?: boolean;
|
|
282
|
+
materialBindings?: MaterialBindings;
|
|
251
283
|
/** 相机输入与场景运行控制,由平台随场景参数导出。 */
|
|
252
284
|
controls?: SceneControlsOptions;
|
|
253
285
|
[key: string]: any;
|
|
254
286
|
}
|
|
255
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
|
+
|
|
256
301
|
declare class Box extends MeshObject {
|
|
257
302
|
objectType: string;
|
|
258
303
|
create(): void;
|
|
@@ -264,6 +309,7 @@ declare class Building extends GroupObject {
|
|
|
264
309
|
constructor(options: Options_9);
|
|
265
310
|
create(): Promise<void>;
|
|
266
311
|
rebuildFromScene(): void;
|
|
312
|
+
private gradientMaterials;
|
|
267
313
|
worldPositionZ: {
|
|
268
314
|
value: number;
|
|
269
315
|
};
|
|
@@ -311,12 +357,22 @@ declare class City {
|
|
|
311
357
|
road: Road;
|
|
312
358
|
pencil: Pencil;
|
|
313
359
|
lead: Pencil['lead'];
|
|
314
|
-
|
|
360
|
+
sceneResources: Pencil['sceneResources'];
|
|
315
361
|
constructor(pencil: Pencil);
|
|
316
362
|
setOptions(options: CityOptions): void;
|
|
317
363
|
multiplyScalar: number;
|
|
318
364
|
private getProjectionOptions;
|
|
319
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
|
+
}>;
|
|
320
376
|
init(existingGroup?: GroupObject): Promise<void>;
|
|
321
377
|
drawCityPlane(adcode: number, target?: BaseObject): Promise<void>;
|
|
322
378
|
drawBuilding(options?: {
|
|
@@ -341,6 +397,7 @@ declare class City {
|
|
|
341
397
|
}
|
|
342
398
|
|
|
343
399
|
declare interface CityOptions {
|
|
400
|
+
materialBindings?: MaterialBindings;
|
|
344
401
|
adcode: number;
|
|
345
402
|
jsonName: string;
|
|
346
403
|
cacheKey?: string;
|
|
@@ -375,6 +432,13 @@ declare class CityPlane extends MeshObject {
|
|
|
375
432
|
dispose(): void;
|
|
376
433
|
}
|
|
377
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
|
+
|
|
378
442
|
/** Rebind internal targets while preserving links to scenes outside the copied set. */
|
|
379
443
|
export declare function cloneSceneWithIds(scene: SceneViewportDocument, ids: Map<string, string>): SceneViewportDocument;
|
|
380
444
|
|
|
@@ -391,12 +455,45 @@ declare class ContinentsBg extends GroupObject {
|
|
|
391
455
|
dispose(): void;
|
|
392
456
|
}
|
|
393
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
|
+
|
|
394
484
|
declare class DirectionalLight extends DirectionalLightObject {
|
|
395
485
|
constructor(...options: ConstructorParameters<typeof DirectionalLightObject>);
|
|
396
486
|
update(delta: number, elapsed: number): void;
|
|
397
487
|
render(): void;
|
|
398
488
|
}
|
|
399
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
|
+
|
|
400
497
|
export declare type Earth = Earth_2;
|
|
401
498
|
|
|
402
499
|
declare class Earth_2 extends Base_2 {
|
|
@@ -408,7 +505,7 @@ declare class Earth_2 extends Base_2 {
|
|
|
408
505
|
secondaryMap?: PlaneMap;
|
|
409
506
|
get mapArea(): ExtrudePolygonObject[];
|
|
410
507
|
setOptions(options: EarthOptions): void;
|
|
411
|
-
|
|
508
|
+
protected applyControlOptions(controls: SceneControlsOptions): void;
|
|
412
509
|
protected get objectTypes(): {
|
|
413
510
|
Earth: Earth_3;
|
|
414
511
|
SphereShadow: SphereShadow;
|
|
@@ -437,6 +534,7 @@ declare class Earth_2 extends Base_2 {
|
|
|
437
534
|
Group: GroupObject;
|
|
438
535
|
};
|
|
439
536
|
private rotationControls?;
|
|
537
|
+
private releaseRotationLock?;
|
|
440
538
|
private readonly stopAutoRotate;
|
|
441
539
|
private readonly resumeAutoRotate;
|
|
442
540
|
protected onRuntimeReady(): Promise<void>;
|
|
@@ -458,8 +556,8 @@ declare class Earth_2 extends Base_2 {
|
|
|
458
556
|
|
|
459
557
|
declare class Earth_3 extends Sphere {
|
|
460
558
|
objectType: string;
|
|
461
|
-
options: Required<
|
|
462
|
-
constructor(options:
|
|
559
|
+
options: Required<Options_2>;
|
|
560
|
+
constructor(options: Options_2);
|
|
463
561
|
create(): void;
|
|
464
562
|
rebuildFromScene(): void;
|
|
465
563
|
}
|
|
@@ -495,6 +593,9 @@ declare class Event_2 {
|
|
|
495
593
|
/** Expand at the editor import boundary so independently edited scenes own their data. */
|
|
496
594
|
export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
497
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
|
+
|
|
498
599
|
declare const findAdcodeInfo: (adcode: number) => {
|
|
499
600
|
adcode: number;
|
|
500
601
|
lng: number;
|
|
@@ -512,6 +613,15 @@ declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
|
|
|
512
613
|
|
|
513
614
|
declare type GeoJSON_4 = FeatureCollection<Polygon | MultiPolygon>;
|
|
514
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
|
+
|
|
515
625
|
export declare function getSceneDocument(document: VisSceneDocument, sceneId?: string, options?: {
|
|
516
626
|
resolveResources?: boolean;
|
|
517
627
|
}): SceneViewportDocument;
|
|
@@ -519,6 +629,13 @@ export declare function getSceneDocument(document: VisSceneDocument, sceneId?: s
|
|
|
519
629
|
declare class HemisphereLight extends HemisphereLightObject {
|
|
520
630
|
}
|
|
521
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
|
+
|
|
522
639
|
/**
|
|
523
640
|
* 新场景文档以完整场景快照作为恢复基线。
|
|
524
641
|
* 未带标记的 JSON 属于旧格式,仍由编辑器的兼容流程处理。
|
|
@@ -527,6 +644,9 @@ export declare function isSceneDocument(value: unknown): value is SceneDocumentM
|
|
|
527
644
|
|
|
528
645
|
export declare function isSceneManifest(value: unknown): value is VisSceneManifest;
|
|
529
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
|
+
|
|
530
650
|
declare type Map_2 = Map_3;
|
|
531
651
|
export { Map_2 as Map }
|
|
532
652
|
|
|
@@ -614,6 +734,10 @@ declare class Map_3 extends Base_2 {
|
|
|
614
734
|
protected prepareInitialCamera(): Promise<void>;
|
|
615
735
|
private updateMapBoundary;
|
|
616
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;
|
|
617
741
|
initCityVis(adcode: number, grey?: boolean): Promise<City>;
|
|
618
742
|
initCityOnMap(adcode: number): Promise<void>;
|
|
619
743
|
private _getParentBgMetrics;
|
|
@@ -715,12 +839,15 @@ declare class Map_3 extends Base_2 {
|
|
|
715
839
|
*/
|
|
716
840
|
private applyOverlayLayers;
|
|
717
841
|
/**
|
|
718
|
-
*
|
|
842
|
+
* Apply the region behavior authored on each object.
|
|
719
843
|
*/
|
|
720
|
-
private
|
|
844
|
+
private applyRegionObjectState;
|
|
721
845
|
/* Excluded from this release type: rebuildRegion */
|
|
846
|
+
private rebuildRegionGeometry;
|
|
722
847
|
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
723
848
|
playRegionEnterTransition({ duration, sourceCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
849
|
+
/** Region rules are page-local runtime overrides of a saved material asset. */
|
|
850
|
+
private regionRuleMaterial;
|
|
724
851
|
private setRegionTexture;
|
|
725
852
|
applyRegionTextureRules(adcode: number): Promise<void>;
|
|
726
853
|
protected onDispose(): void;
|
|
@@ -782,8 +909,6 @@ declare interface MapOptions extends BaseOptions {
|
|
|
782
909
|
lineOffset?: number;
|
|
783
910
|
extrudeLineWidth?: number;
|
|
784
911
|
extrudeLine?: boolean;
|
|
785
|
-
equirectangular?: boolean;
|
|
786
|
-
winkel3?: boolean;
|
|
787
912
|
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
788
913
|
polarAngle?: number;
|
|
789
914
|
azimuthAngle?: number;
|
|
@@ -799,7 +924,6 @@ declare interface MapOptions extends BaseOptions {
|
|
|
799
924
|
geojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
800
925
|
extrudeLineGeojsonMapReplace?: Record<string, GeoJSON_3 | string | number>;
|
|
801
926
|
shadowMap?: boolean;
|
|
802
|
-
switchFixConfig?: SwitchFixConfig;
|
|
803
927
|
/** switchMapRegion 后按场景声明替换区域相关纹理。 */
|
|
804
928
|
regionTextureRules?: RegionTextureRule[];
|
|
805
929
|
/** 动态地图、城市数据和水面纹理的资源地址模板。 */
|
|
@@ -848,7 +972,7 @@ export declare interface MapSafeAreaOptions {
|
|
|
848
972
|
smoothTime?: number;
|
|
849
973
|
}
|
|
850
974
|
|
|
851
|
-
/**
|
|
975
|
+
/** 平台导出的运行时对象绑定,直接引用 Object3D.uuid。 */
|
|
852
976
|
declare interface MapSceneBindings {
|
|
853
977
|
container: string;
|
|
854
978
|
region: {
|
|
@@ -860,6 +984,86 @@ declare interface MapSceneBindings {
|
|
|
860
984
|
cities: string[];
|
|
861
985
|
}
|
|
862
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
|
+
/** Complete Material.toJSON(); schema 6 exports may pool image/texture payloads. */
|
|
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
|
+
|
|
863
1067
|
declare class Model extends GroupObject {
|
|
864
1068
|
options: Options_7;
|
|
865
1069
|
mixer: THREE.AnimationMixer | null;
|
|
@@ -940,16 +1144,45 @@ declare class Mountain extends GroupObject {
|
|
|
940
1144
|
rebuildFromScene(): void;
|
|
941
1145
|
}
|
|
942
1146
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
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;
|
|
953
1186
|
}
|
|
954
1187
|
|
|
955
1188
|
declare interface Options_10 {
|
|
@@ -962,6 +1195,7 @@ declare interface Options_10 {
|
|
|
962
1195
|
cacheKey?: string;
|
|
963
1196
|
meters?: number;
|
|
964
1197
|
grey?: boolean;
|
|
1198
|
+
material?: MeshLineMaterial;
|
|
965
1199
|
}
|
|
966
1200
|
|
|
967
1201
|
declare interface Options_11 {
|
|
@@ -998,59 +1232,36 @@ declare interface Options_13 {
|
|
|
998
1232
|
}
|
|
999
1233
|
|
|
1000
1234
|
declare interface Options_2 {
|
|
1001
|
-
path?: THREE.Curve<THREE.Vector3>;
|
|
1002
1235
|
radius?: number;
|
|
1003
|
-
|
|
1236
|
+
rotationY?: number;
|
|
1004
1237
|
}
|
|
1005
1238
|
|
|
1006
1239
|
declare interface Options_3 {
|
|
1007
|
-
|
|
1008
|
-
areaGroup?: boolean;
|
|
1009
|
-
geojson: GeoJSON_2;
|
|
1010
|
-
projection?: {
|
|
1011
|
-
center: [number, number];
|
|
1012
|
-
scale: number;
|
|
1013
|
-
rotate?: [number, number];
|
|
1014
|
-
projectionType?: 'mercator' | 'equirectangular' | 'winkel3';
|
|
1015
|
-
};
|
|
1016
|
-
extrudeLineGeojson?: GeoJSON_2;
|
|
1017
|
-
hasSide?: boolean;
|
|
1018
|
-
hasTop?: boolean;
|
|
1019
|
-
hasLine?: boolean;
|
|
1020
|
-
start?: number;
|
|
1021
|
-
depth?: number;
|
|
1022
|
-
lineOffset?: number;
|
|
1023
|
-
bbox?: number[];
|
|
1024
|
-
topSegments?: number;
|
|
1025
|
-
conic?: boolean;
|
|
1026
|
-
castShadow?: boolean;
|
|
1027
|
-
mergeSide?: boolean;
|
|
1028
|
-
hasExtrudeLine?: boolean;
|
|
1029
|
-
materialOptions: {
|
|
1030
|
-
topMat: THREE.Material;
|
|
1031
|
-
sideMat?: THREE.Material;
|
|
1032
|
-
lineMat?: MeshLineMaterial;
|
|
1033
|
-
extrudeLineMat?: MeshLineMaterial;
|
|
1034
|
-
bgTopMat?: THREE.Material;
|
|
1035
|
-
bgSideMat?: THREE.Material;
|
|
1036
|
-
bgLineMat?: MeshLineMaterial;
|
|
1037
|
-
bgExtrudeLineMat?: MeshLineMaterial;
|
|
1038
|
-
};
|
|
1039
|
-
onTop?: number;
|
|
1040
|
-
bloom?: boolean;
|
|
1240
|
+
radius?: number;
|
|
1041
1241
|
}
|
|
1042
1242
|
|
|
1043
1243
|
declare interface Options_4 {
|
|
1044
|
-
|
|
1045
|
-
rotationY?: number;
|
|
1244
|
+
sprite?: boolean;
|
|
1046
1245
|
}
|
|
1047
1246
|
|
|
1048
|
-
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[];
|
|
1049
1252
|
radius?: number;
|
|
1253
|
+
globe?: boolean;
|
|
1254
|
+
color?: string;
|
|
1255
|
+
lineWidth?: number;
|
|
1256
|
+
offsetLoop?: boolean;
|
|
1050
1257
|
}
|
|
1051
1258
|
|
|
1052
1259
|
declare interface Options_6 {
|
|
1053
|
-
|
|
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[][];
|
|
1054
1265
|
}
|
|
1055
1266
|
|
|
1056
1267
|
declare interface Options_7 {
|
|
@@ -1062,6 +1273,11 @@ declare interface Options_7 {
|
|
|
1062
1273
|
}
|
|
1063
1274
|
|
|
1064
1275
|
declare interface Options_8 {
|
|
1276
|
+
materialOptions: {
|
|
1277
|
+
topMat: THREE.Material;
|
|
1278
|
+
sideMat: THREE.Material;
|
|
1279
|
+
lineMat: MeshLineMaterial;
|
|
1280
|
+
};
|
|
1065
1281
|
scale: number;
|
|
1066
1282
|
depth: number;
|
|
1067
1283
|
assetsPrefix?: string;
|
|
@@ -1081,11 +1297,17 @@ declare interface Options_9 {
|
|
|
1081
1297
|
hasSide?: boolean;
|
|
1082
1298
|
sideGradient?: boolean;
|
|
1083
1299
|
grey?: boolean;
|
|
1300
|
+
materialOptions?: Record<string, THREE.Material>;
|
|
1084
1301
|
}
|
|
1085
1302
|
|
|
1086
1303
|
/** Pack an export copy only; preserve the editor's independent scene snapshots. */
|
|
1087
1304
|
export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
1088
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
|
+
|
|
1089
1311
|
declare class Plane extends MeshObject {
|
|
1090
1312
|
objectType: string;
|
|
1091
1313
|
create(): void;
|
|
@@ -1093,7 +1315,7 @@ declare class Plane extends MeshObject {
|
|
|
1093
1315
|
|
|
1094
1316
|
declare class PlaneMap extends GroupObject {
|
|
1095
1317
|
objectType: string;
|
|
1096
|
-
options: Required<Omit<
|
|
1318
|
+
options: Required<Omit<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>> & Pick<Options, 'bbox' | 'extrudeLineGeojson' | 'uuid'>;
|
|
1097
1319
|
isActive: boolean;
|
|
1098
1320
|
groupArr: GroupObject[];
|
|
1099
1321
|
areaArr: ExtrudePolygonObject[];
|
|
@@ -1101,7 +1323,7 @@ declare class PlaneMap extends GroupObject {
|
|
|
1101
1323
|
mergeSideArea: ExtrudePolygonObject | null;
|
|
1102
1324
|
extrudelineArr?: LineObject[];
|
|
1103
1325
|
splitPolygons: number;
|
|
1104
|
-
constructor(options:
|
|
1326
|
+
constructor(options: Options);
|
|
1105
1327
|
create(): Promise<void>;
|
|
1106
1328
|
private markGeneratedObjects;
|
|
1107
1329
|
private ensureExtrudeLineMaterials;
|
|
@@ -1124,13 +1346,15 @@ declare class PlaneMap extends GroupObject {
|
|
|
1124
1346
|
onTop?: number;
|
|
1125
1347
|
areaGroup?: boolean;
|
|
1126
1348
|
}): Promise<LineObject[]>;
|
|
1349
|
+
private shouldUseGeometryWorker;
|
|
1127
1350
|
getPropertiesKey(properties: Record<string, any>): string;
|
|
1128
1351
|
geojson2Meta(geojson: GeoJSON_2): {
|
|
1129
1352
|
coords: Position[][];
|
|
1130
1353
|
properties: GeoJsonProperties;
|
|
1131
1354
|
}[];
|
|
1132
1355
|
update(_delta: number, elapsed: number): void;
|
|
1133
|
-
findGroup(adcode: string | number,
|
|
1356
|
+
findGroup(adcode: string | number, _fix?: boolean): GroupObject | undefined;
|
|
1357
|
+
private batchMaterialChanges;
|
|
1134
1358
|
useAreaMaterial(key: string): void;
|
|
1135
1359
|
useLineMaterial(key: string): void;
|
|
1136
1360
|
useExtrudeLineMaterial(key: string): void;
|
|
@@ -1141,7 +1365,6 @@ declare class PlaneMap extends GroupObject {
|
|
|
1141
1365
|
deactive(): void;
|
|
1142
1366
|
render(): void;
|
|
1143
1367
|
rebuildFromScene(): void;
|
|
1144
|
-
private clearGeneratedRegionProperties;
|
|
1145
1368
|
/**
|
|
1146
1369
|
* 场景快照保存的是网格实际材质,options 中的 Material 会被导出器过滤。
|
|
1147
1370
|
* 恢复完成后从生成对象反推下一次区域重建所需的运行时材质。
|
|
@@ -1159,8 +1382,8 @@ declare class PlaneShadow extends MeshObject {
|
|
|
1159
1382
|
|
|
1160
1383
|
declare class Point extends BaseObject {
|
|
1161
1384
|
objectType: string;
|
|
1162
|
-
options:
|
|
1163
|
-
constructor(options:
|
|
1385
|
+
options: Options_4;
|
|
1386
|
+
constructor(options: Options_4);
|
|
1164
1387
|
get material(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1165
1388
|
getMaterial(): THREE.MeshBasicMaterial | THREE.SpriteMaterial;
|
|
1166
1389
|
create(): Promise<void>;
|
|
@@ -1174,11 +1397,29 @@ declare class PointLight extends PointLightObject {
|
|
|
1174
1397
|
render(): void;
|
|
1175
1398
|
}
|
|
1176
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
|
+
|
|
1177
1418
|
declare class RectAreaLight extends RectAreaLightObject {
|
|
1178
1419
|
}
|
|
1179
1420
|
|
|
1180
1421
|
declare interface RegionTextureRule {
|
|
1181
|
-
/**
|
|
1422
|
+
/** 材质 UUID,或显式材质角色,例如 plane#topMat。 */
|
|
1182
1423
|
material: string;
|
|
1183
1424
|
/** THREE.Material 上的纹理属性,例如 map、emissiveMap。 */
|
|
1184
1425
|
property: string;
|
|
@@ -1196,14 +1437,25 @@ export declare interface RemappedSceneDocument {
|
|
|
1196
1437
|
entrySceneId: string;
|
|
1197
1438
|
scenes: SceneViewportDocument[];
|
|
1198
1439
|
idMap: Map<string, string>;
|
|
1440
|
+
materialLibrary?: MaterialAsset[];
|
|
1441
|
+
/** Reusable definitions, independent of scene instances. */
|
|
1442
|
+
prefabLibrary?: PrefabAsset[];
|
|
1199
1443
|
}
|
|
1200
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
|
+
|
|
1201
1451
|
/**
|
|
1202
1452
|
* 复制一组场景并为它们分配新 ID,同时保持文档内部的场景跳转关系。
|
|
1203
1453
|
* 用于把完整模板追加到另一个场景文档中。
|
|
1204
1454
|
*/
|
|
1205
1455
|
export declare function remapSceneDocumentIds(document: VisSceneDocument, createSceneId: (scene: SceneViewportDocument, index: number) => string): RemappedSceneDocument;
|
|
1206
1456
|
|
|
1457
|
+
export declare function removeProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string): T;
|
|
1458
|
+
|
|
1207
1459
|
declare class Ring extends MeshObject {
|
|
1208
1460
|
objectType: string;
|
|
1209
1461
|
create(): void;
|
|
@@ -1220,13 +1472,23 @@ declare class Road extends GroupObject {
|
|
|
1220
1472
|
dispose(): void;
|
|
1221
1473
|
}
|
|
1222
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
|
+
|
|
1223
1482
|
export declare const SCENE_DOCUMENT_FORMAT: "vis-scene";
|
|
1224
1483
|
|
|
1225
|
-
|
|
1484
|
+
/** Schema 6 extends the document pool to authored material dependencies. */
|
|
1485
|
+
export declare const SCENE_DOCUMENT_RESOURCE_POOL_SCHEMA_VERSION: 6;
|
|
1486
|
+
|
|
1487
|
+
export declare const SCENE_DOCUMENT_SCHEMA_VERSION: 6;
|
|
1226
1488
|
|
|
1227
1489
|
export declare const SCENE_MANIFEST_FORMAT: "vis-scene-manifest";
|
|
1228
1490
|
|
|
1229
|
-
export declare const SCENE_MANIFEST_SCHEMA_VERSION:
|
|
1491
|
+
export declare const SCENE_MANIFEST_SCHEMA_VERSION: 3;
|
|
1230
1492
|
|
|
1231
1493
|
export declare interface SceneBackInteraction {
|
|
1232
1494
|
trigger: 'click' | 'clickOutside';
|
|
@@ -1237,10 +1499,18 @@ export declare interface SceneBackInteraction {
|
|
|
1237
1499
|
};
|
|
1238
1500
|
}
|
|
1239
1501
|
|
|
1502
|
+
/** Scene membership/options delta. Existing authored graphs must use structure patches. */
|
|
1503
|
+
export declare interface SceneCollectionTransaction {
|
|
1504
|
+
scenes: readonly SceneViewportDocument[];
|
|
1505
|
+
entrySceneId: string;
|
|
1506
|
+
materialLibrary?: readonly MaterialAsset[];
|
|
1507
|
+
prefabLibrary?: readonly PrefabAsset[];
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1240
1510
|
declare interface SceneControlsOptions {
|
|
1241
|
-
mouseLeft?: number
|
|
1242
|
-
mouseRight?: number
|
|
1243
|
-
mouseWheel?: number
|
|
1511
|
+
mouseLeft?: number;
|
|
1512
|
+
mouseRight?: number;
|
|
1513
|
+
mouseWheel?: number;
|
|
1244
1514
|
mouseNone?: boolean;
|
|
1245
1515
|
viewportPadding?: [number, number, number, number];
|
|
1246
1516
|
autoRotateSpeed?: number;
|
|
@@ -1257,6 +1527,11 @@ declare interface SceneEnterTransitionOptions {
|
|
|
1257
1527
|
onPrepared?: () => void;
|
|
1258
1528
|
}
|
|
1259
1529
|
|
|
1530
|
+
export declare interface SceneInstantiatePrefabOptions extends InstantiatePrefabOptions {
|
|
1531
|
+
/** A scene already loaded by this manager. Defaults to the current scene. */
|
|
1532
|
+
sceneId?: string;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1260
1535
|
export declare type SceneInteraction = SceneSwitchInteraction | SceneBackInteraction | MapRegionSwitchInteraction | MapRegionBackInteraction;
|
|
1261
1536
|
|
|
1262
1537
|
export declare interface SceneInteractionFilter {
|
|
@@ -1283,11 +1558,23 @@ export declare class SceneManager extends Event_2 {
|
|
|
1283
1558
|
private isRegionSwitching;
|
|
1284
1559
|
private pencil?;
|
|
1285
1560
|
private safeAreaInsets;
|
|
1561
|
+
private generation;
|
|
1562
|
+
private documentIdentityRevision;
|
|
1563
|
+
private preparedStructures;
|
|
1564
|
+
private pendingInstances;
|
|
1565
|
+
private identityTrackedScenes;
|
|
1566
|
+
private prefabOperations;
|
|
1567
|
+
private transactionCacheDepth;
|
|
1568
|
+
private materialLibraryResources?;
|
|
1569
|
+
private invalidatePendingOperations;
|
|
1570
|
+
private assertGeneration;
|
|
1286
1571
|
private debugInteraction;
|
|
1287
1572
|
private enablePickDebug;
|
|
1288
1573
|
private disposeInactiveScenes;
|
|
1289
1574
|
constructor(options: SceneManagerInitOptions);
|
|
1290
1575
|
private prepareScene;
|
|
1576
|
+
/** Publish one identity remap without exporting runtimes or copying other pages/resources. */
|
|
1577
|
+
remapCommittedIdentity(sceneId: string, previous: string, next: string, objectIdentity: boolean): boolean;
|
|
1291
1578
|
/**
|
|
1292
1579
|
* 设置宿主界面的运行时地图安全区。该状态不进入场景文档,并会自动传给
|
|
1293
1580
|
* 当前地图、缓存地图和后续创建的地图区域。
|
|
@@ -1298,12 +1585,61 @@ export declare class SceneManager extends Event_2 {
|
|
|
1298
1585
|
private playTransition;
|
|
1299
1586
|
/** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
|
|
1300
1587
|
setDocument(document: VisSceneDocument): void;
|
|
1588
|
+
/** Standalone material consumers cannot retain document-level pool references. */
|
|
1589
|
+
private resolvedMaterialLibrary;
|
|
1590
|
+
/** Keep scene payloads lazy, while independent material APIs own a resolved catalog. */
|
|
1591
|
+
private ownDocument;
|
|
1592
|
+
private syncPrefabLibraries;
|
|
1593
|
+
/**
|
|
1594
|
+
* Replace the complete metadata projection for existing scenes without
|
|
1595
|
+
* recopying assets. Omitted interactions remove the field; own undefined is
|
|
1596
|
+
* preserved, so callers editing only names must include the other metadata.
|
|
1597
|
+
*/
|
|
1598
|
+
patchDocumentMetadata(patch: {
|
|
1599
|
+
entrySceneId: string;
|
|
1600
|
+
scenes: Pick<SceneViewportDocument, 'id' | 'name' | 'interactions'>[];
|
|
1601
|
+
s?: string;
|
|
1602
|
+
}): void;
|
|
1603
|
+
/** Commit camera/controls state without validating or cloning authored resources. */
|
|
1604
|
+
patchSceneViewport(sceneId: string, patch: SceneViewportPatch): void;
|
|
1605
|
+
/** Apply validated object properties without copying unrelated nodes or resource tables. */
|
|
1606
|
+
patchSceneObjects(sceneId: string, patches: SceneObjectPatch[]): void;
|
|
1607
|
+
/** Native inspector edits keep the validated topology/resource baseline and its UUID index. */
|
|
1608
|
+
patchSceneObjectProperties(sceneId: string, patches: readonly SceneObjectPropertyPatch[]): void;
|
|
1609
|
+
/** Commit a validated topology delta without cloning unrelated saved scenes or resources. */
|
|
1610
|
+
patchSceneStructure(sceneId: string, patch: SceneStructurePatch): void;
|
|
1611
|
+
/** Commit related topology changes across scenes without exposing intermediate revisions. */
|
|
1612
|
+
patchSceneStructureTransaction(transaction: SceneStructureTransaction): void;
|
|
1613
|
+
private requireStructureDocument;
|
|
1614
|
+
/** Own and validate a topology delta before allocating or moving runtime objects. */
|
|
1615
|
+
prepareSceneStructure(sceneId: string, patch: SceneStructurePatch): PreparedSceneStructure;
|
|
1616
|
+
/** Prepare related edits across scenes and shared catalogs as one atomic transaction. */
|
|
1617
|
+
prepareSceneStructureTransaction(transaction: SceneStructureTransaction): PreparedSceneStructure;
|
|
1618
|
+
/** Own only new pages and changed metadata; retain every existing authored graph. */
|
|
1619
|
+
prepareSceneCollectionTransaction(transaction: SceneCollectionTransaction): PreparedSceneStructure;
|
|
1620
|
+
/** A newly hydrated empty Base seed acquires its own camera/default options once. */
|
|
1621
|
+
prepareSceneInitialization(sceneId: string, definition: SceneViewportDocument): PreparedSceneStructure;
|
|
1622
|
+
/** Collection edits keep cached pages until their enclosing history transaction accepts. */
|
|
1623
|
+
activateSceneForTransaction(sceneId: string, hooks?: Record<string, any>, signal?: AbortSignal): Promise<Base_2>;
|
|
1624
|
+
/** Retire exactly the detached page; never invalidate other loaded pages or pending resources. */
|
|
1625
|
+
retireSceneForTransaction(sceneId: string, expected: Base_2): void;
|
|
1626
|
+
private ownPreparedStructure;
|
|
1627
|
+
private requirePreparedStructure;
|
|
1628
|
+
/**
|
|
1629
|
+
* Check the saved sections affected by topology history without handing out
|
|
1630
|
+
* the private candidate. Editor config/dev metadata is outside this delta.
|
|
1631
|
+
*/
|
|
1632
|
+
preparedSceneStructureMatches(prepared: PreparedSceneStructure, target: Pick<VisSceneDocument, 'scenes' | 'materialLibrary' | 'prefabLibrary'>): boolean;
|
|
1633
|
+
/** Commit the already validated candidate once, provided its source is still current. */
|
|
1634
|
+
commitSceneStructure(prepared: PreparedSceneStructure): void;
|
|
1635
|
+
/** Commit scalar material history without accepting or copying caller object graphs. */
|
|
1636
|
+
patchMaterialDefinitions(assets: MaterialAsset[], scenes: Pick<SceneViewportDocument, 'id'>[], scope?: MaterialDefinitionScope): void;
|
|
1301
1637
|
load(documentOrUrl: VisSceneDocument | VisSceneManifest | string, hooks?: Record<string, any>): Promise<Base_2>;
|
|
1302
1638
|
/**
|
|
1303
1639
|
* 创建一个没有快照输入的运行时页面,并在可选构建步骤完成后将其导出为
|
|
1304
1640
|
* 标准单场景文档。主要供编辑器新建和旧模板迁移使用。
|
|
1305
1641
|
*/
|
|
1306
|
-
createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_2) => void | Promise<void
|
|
1642
|
+
createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_2) => void | Promise<void>, materialLibrary?: MaterialAsset[]): Promise<Base_2>;
|
|
1307
1643
|
/**
|
|
1308
1644
|
* 以指定地图模板和行政区直接启动,不先加载文档配置的入口场景。
|
|
1309
1645
|
* 适用于宿主按路由或业务参数决定初始省、市、区的场景。
|
|
@@ -1313,6 +1649,7 @@ export declare class SceneManager extends Event_2 {
|
|
|
1313
1649
|
private loadDocument;
|
|
1314
1650
|
private getSceneMetadata;
|
|
1315
1651
|
private resolveManifestSource;
|
|
1652
|
+
private resolveBundleImages;
|
|
1316
1653
|
private loadSceneDefinition;
|
|
1317
1654
|
private createRuntimeSceneDocument;
|
|
1318
1655
|
switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
|
|
@@ -1344,10 +1681,25 @@ export declare class SceneManager extends Event_2 {
|
|
|
1344
1681
|
getSceneByName<T extends SceneType>(name: string, type: T): SceneTypeMap[T] | undefined;
|
|
1345
1682
|
getSceneByName(name: string): Base_2 | undefined;
|
|
1346
1683
|
private getSceneByType;
|
|
1684
|
+
/** Inspect saved definitions without creating or pinning runtime materials. */
|
|
1685
|
+
getMaterialLibrary(): MaterialAsset[];
|
|
1686
|
+
/** SDK-enabled definitions stay unloaded until explicitly instantiated. */
|
|
1687
|
+
getPrefabLibrary(): PrefabAsset[];
|
|
1688
|
+
instantiatePrefab(keyOrAssetId: string, options?: SceneInstantiatePrefabOptions): Promise< BaseObject>;
|
|
1689
|
+
/**
|
|
1690
|
+
* Update a saved asset and transactionally rebuild each affected cached page.
|
|
1691
|
+
* Reacquire Base/Object handles after this call: replaced pages are disposed.
|
|
1692
|
+
* Current runtime geometry, options, active page and camera are preserved.
|
|
1693
|
+
*/
|
|
1694
|
+
updateMaterial(assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): Promise<Base_2 | null>;
|
|
1695
|
+
/** Immutable borrowed snapshot for coordinated COW editing; write through patch APIs. */
|
|
1696
|
+
getDocumentSnapshot(): Readonly<VisSceneDocument> | undefined;
|
|
1347
1697
|
getDocument(): VisSceneDocument | undefined;
|
|
1348
1698
|
getManifest(): VisSceneManifest | undefined;
|
|
1349
1699
|
private bindSceneInteractions;
|
|
1350
1700
|
canBack(): boolean;
|
|
1701
|
+
/** Release a cached/active page while retaining its document and saved material definitions. */
|
|
1702
|
+
unloadScene(sceneId: string): boolean;
|
|
1351
1703
|
private disposeInstances;
|
|
1352
1704
|
dispose(): void;
|
|
1353
1705
|
}
|
|
@@ -1381,6 +1733,105 @@ export declare interface SceneManifestEntry extends Omit<SceneViewportDocument,
|
|
|
1381
1733
|
bytes?: number;
|
|
1382
1734
|
}
|
|
1383
1735
|
|
|
1736
|
+
/** Dependency closure for a selected scene; preserve unused aliases as document uses. */
|
|
1737
|
+
export declare function sceneMaterialLibrary(scene: SceneViewportDocument, library?: MaterialAsset[], prefabs?: VisSceneDocument['prefabLibrary']): MaterialAsset[];
|
|
1738
|
+
|
|
1739
|
+
export declare interface SceneObjectPatch {
|
|
1740
|
+
uuid: string;
|
|
1741
|
+
state: {
|
|
1742
|
+
matrix?: number[];
|
|
1743
|
+
matrixAutoUpdate?: boolean;
|
|
1744
|
+
pivot?: number[] | null;
|
|
1745
|
+
name?: string;
|
|
1746
|
+
visible?: boolean;
|
|
1747
|
+
layers?: number;
|
|
1748
|
+
};
|
|
1749
|
+
unset?: ('matrix' | 'matrixAutoUpdate' | 'pivot' | 'name' | 'visible' | 'layers')[];
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
declare interface SceneObjectPropertyPatch {
|
|
1753
|
+
uuid: string;
|
|
1754
|
+
state: Record<string, any>;
|
|
1755
|
+
unset?: readonly string[];
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
declare type ScenePropertyField = typeof scenePropertyFields[number];
|
|
1759
|
+
|
|
1760
|
+
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"];
|
|
1761
|
+
|
|
1762
|
+
export declare type SceneStructureGraphKey = 'materialAliases' | 'shapes' | '_sharedOptionsPool' | '_texDataPool';
|
|
1763
|
+
|
|
1764
|
+
/** Metadata is part of an owned structure transaction, never a scalar runtime patch. */
|
|
1765
|
+
export declare interface SceneStructureObjectPatch {
|
|
1766
|
+
uuid: string;
|
|
1767
|
+
state: SceneObjectPatch['state'] & Partial<Record<ScenePropertyField, any>> & {
|
|
1768
|
+
matrixAutoUpdate?: boolean;
|
|
1769
|
+
userData?: Record<string, any>;
|
|
1770
|
+
geometry?: string | null;
|
|
1771
|
+
material?: string | string[];
|
|
1772
|
+
background?: number | string | null;
|
|
1773
|
+
environment?: string | null;
|
|
1774
|
+
};
|
|
1775
|
+
unset?: (NonNullable<SceneObjectPatch['unset']>[number] | ScenePropertyField | 'matrixAutoUpdate' | 'userData' | 'geometry' | 'material' | 'background' | 'environment')[];
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
export declare interface SceneStructurePatch {
|
|
1779
|
+
/** Final direct-child order. Omitting an old child detaches its subtree. */
|
|
1780
|
+
parents: {
|
|
1781
|
+
uuid: string;
|
|
1782
|
+
children: string[];
|
|
1783
|
+
}[];
|
|
1784
|
+
/** New serialized subtree roots, with UUIDs absent from the current scene. */
|
|
1785
|
+
additions?: Record<string, any>[];
|
|
1786
|
+
/** Replace existing subtree roots, retaining their UUID and owning the supplied descendants. */
|
|
1787
|
+
replacements?: Record<string, any>[];
|
|
1788
|
+
objects?: SceneStructureObjectPatch[];
|
|
1789
|
+
/** Viewport payload participates atomically with object/resource changes. */
|
|
1790
|
+
viewport?: SceneStructureViewportPatch;
|
|
1791
|
+
/** Authored scene aliases; these refer to assets, rather than runtime material UUIDs. */
|
|
1792
|
+
aliases?: {
|
|
1793
|
+
set?: NonNullable<SceneViewportDocument['materialAliases']>;
|
|
1794
|
+
unset?: true;
|
|
1795
|
+
};
|
|
1796
|
+
/** Keep object removals and their authored interaction bindings in one transaction. */
|
|
1797
|
+
interactions?: {
|
|
1798
|
+
set?: SceneViewportDocument['interactions'];
|
|
1799
|
+
unset?: true;
|
|
1800
|
+
};
|
|
1801
|
+
/** Small graph metadata and explicitly changed pools, never an entire scene graph. */
|
|
1802
|
+
graph?: {
|
|
1803
|
+
set?: Partial<Record<SceneStructureGraphKey, any>>;
|
|
1804
|
+
unset?: SceneStructureGraphKey[];
|
|
1805
|
+
};
|
|
1806
|
+
resources?: Partial<Record<SceneStructureResource, {
|
|
1807
|
+
upsert?: Record<string, any>[];
|
|
1808
|
+
remove?: string[];
|
|
1809
|
+
unset?: true;
|
|
1810
|
+
}>>;
|
|
1811
|
+
assets?: {
|
|
1812
|
+
upsert?: MaterialAsset[];
|
|
1813
|
+
remove?: string[];
|
|
1814
|
+
};
|
|
1815
|
+
prefabs?: {
|
|
1816
|
+
upsert?: PrefabAsset[];
|
|
1817
|
+
remove?: string[];
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
export declare type SceneStructureResource = 'geometries' | 'materials' | 'textures' | 'images' | 'skeletons' | 'animations';
|
|
1822
|
+
|
|
1823
|
+
/** Scene edits and shared catalogs form one atomic project-document transaction. */
|
|
1824
|
+
export declare interface SceneStructureTransaction {
|
|
1825
|
+
scenes: {
|
|
1826
|
+
sceneId: string;
|
|
1827
|
+
patch: Omit<SceneStructurePatch, 'assets' | 'prefabs'>;
|
|
1828
|
+
}[];
|
|
1829
|
+
assets?: SceneStructurePatch['assets'];
|
|
1830
|
+
prefabs?: SceneStructurePatch['prefabs'];
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
export declare type SceneStructureViewportPatch = Partial<SceneViewportPatch>;
|
|
1834
|
+
|
|
1384
1835
|
export declare interface SceneSwitchInteraction {
|
|
1385
1836
|
trigger: 'click' | 'clickOutside';
|
|
1386
1837
|
objectId: string;
|
|
@@ -1415,23 +1866,34 @@ export declare interface SceneViewportDocument {
|
|
|
1415
1866
|
options: Record<string, any>;
|
|
1416
1867
|
};
|
|
1417
1868
|
scene: Record<string, any>;
|
|
1869
|
+
/** Scene-local SceneResources aliases. Locked means retained on export, not GPU residency. */
|
|
1870
|
+
materialAliases?: Record<string, MaterialAlias>;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
/** Camera motion and controls do not change authored scene topology/resources. */
|
|
1874
|
+
export declare interface SceneViewportPatch {
|
|
1875
|
+
camera: {
|
|
1876
|
+
uuid: string;
|
|
1877
|
+
type: 'PerspectiveCamera' | 'OrthographicCamera';
|
|
1878
|
+
state: Record<string, any>;
|
|
1879
|
+
unset: string[];
|
|
1880
|
+
};
|
|
1881
|
+
cs?: SceneViewportDocument['cs'];
|
|
1882
|
+
csa?: string;
|
|
1883
|
+
controls: Record<string, any>;
|
|
1418
1884
|
}
|
|
1419
1885
|
|
|
1420
1886
|
export declare function selectSceneDocument(document: VisSceneDocument, sceneId: string): VisSceneDocument;
|
|
1421
1887
|
|
|
1422
1888
|
declare type SerializedClip = ReturnType<(typeof THREE.AnimationClip)['toJSON']>;
|
|
1423
1889
|
|
|
1424
|
-
declare const sinusoidalInOut: ({ onUpdate, onComplete, backwards, }?: {
|
|
1425
|
-
onUpdate?: ((v: number) => void) | undefined;
|
|
1426
|
-
onComplete?: (() => void) | undefined;
|
|
1427
|
-
backwards?: boolean | undefined;
|
|
1428
|
-
}) => {
|
|
1890
|
+
declare const sinusoidalInOut: ({ owner, onUpdate, onComplete, onCancel, backwards, }?: TweenOptions) => {
|
|
1429
1891
|
start: ({ duration, repeat, repeatResolve, repeatDelay, }?: {
|
|
1430
1892
|
duration?: number | undefined;
|
|
1431
1893
|
repeat?: number | undefined;
|
|
1432
1894
|
repeatResolve?: number | undefined;
|
|
1433
1895
|
repeatDelay?: number | undefined;
|
|
1434
|
-
}) => Promise<
|
|
1896
|
+
}) => Promise<void>;
|
|
1435
1897
|
stop: () => void;
|
|
1436
1898
|
};
|
|
1437
1899
|
|
|
@@ -1445,25 +1907,29 @@ declare class Sphere extends MeshObject {
|
|
|
1445
1907
|
|
|
1446
1908
|
declare class SphereShadow extends MeshObject {
|
|
1447
1909
|
objectType: string;
|
|
1448
|
-
options: Required<
|
|
1449
|
-
constructor(options:
|
|
1910
|
+
options: Required<Options_3>;
|
|
1911
|
+
constructor(options: Options_3);
|
|
1450
1912
|
create(): Promise<void>;
|
|
1451
1913
|
rebuildFromScene(): void;
|
|
1452
1914
|
}
|
|
1453
1915
|
|
|
1454
1916
|
/**
|
|
1455
|
-
* Creates
|
|
1456
|
-
*
|
|
1917
|
+
* Creates independently fetchable scene JSON values. Manifest 3 owns shared
|
|
1918
|
+
* payloads so scene and catalog copies do not multiply the deployed bytes.
|
|
1457
1919
|
*/
|
|
1458
1920
|
export declare function splitSceneDocument(document: VisSceneDocument, options?: {
|
|
1459
1921
|
sceneDirectory?: string;
|
|
1460
1922
|
extension?: '.json' | '.json.gz';
|
|
1923
|
+
externalizeImages?: boolean;
|
|
1924
|
+
omitEditorAssets?: boolean;
|
|
1461
1925
|
}): SplitSceneDocumentBundle;
|
|
1462
1926
|
|
|
1463
1927
|
export declare interface SplitSceneDocumentBundle {
|
|
1464
1928
|
manifest: VisSceneManifest;
|
|
1465
1929
|
/** Keys are the relative source paths written into the manifest. */
|
|
1466
1930
|
scenes: Record<string, SceneViewportDocument>;
|
|
1931
|
+
/** Binary files to write alongside the manifest and scene files. */
|
|
1932
|
+
assets?: Record<string, RuntimeImageAsset>;
|
|
1467
1933
|
}
|
|
1468
1934
|
|
|
1469
1935
|
declare class SpotLight extends SpotLightObject {
|
|
@@ -1478,20 +1944,7 @@ declare class Sprite extends SpriteObject {
|
|
|
1478
1944
|
setDesiredPixelSize(size: number): void;
|
|
1479
1945
|
}
|
|
1480
1946
|
|
|
1481
|
-
declare
|
|
1482
|
-
/** 按参考缩放比缩放,并移到地图中心 */
|
|
1483
|
-
s?: string[];
|
|
1484
|
-
/** z 位置按缩放比缩放 */
|
|
1485
|
-
z?: string[];
|
|
1486
|
-
/** 移到地图顶面 */
|
|
1487
|
-
t?: string[];
|
|
1488
|
-
/** 移到地图底面 */
|
|
1489
|
-
b?: string[];
|
|
1490
|
-
/** 灯光按缩放比调整 */
|
|
1491
|
-
l?: string[];
|
|
1492
|
-
/** 删除对象 */
|
|
1493
|
-
r?: string[];
|
|
1494
|
-
}
|
|
1947
|
+
export declare function stripMaterialAssetBinding<T extends Record<string, any>>(material: T): T;
|
|
1495
1948
|
|
|
1496
1949
|
export declare interface SwitchSceneOptions {
|
|
1497
1950
|
/** 返回历史时不再记录当前场景。 */
|
|
@@ -1506,8 +1959,8 @@ declare const timeOut: (ms: number) => Promise<any>;
|
|
|
1506
1959
|
|
|
1507
1960
|
declare class Tube extends MeshObject {
|
|
1508
1961
|
objectType: string;
|
|
1509
|
-
options:
|
|
1510
|
-
constructor(options:
|
|
1962
|
+
options: Options_6;
|
|
1963
|
+
constructor(options: Options_6);
|
|
1511
1964
|
create(): void;
|
|
1512
1965
|
}
|
|
1513
1966
|
|
|
@@ -1515,13 +1968,27 @@ export { TWEEN }
|
|
|
1515
1968
|
|
|
1516
1969
|
export { Tween }
|
|
1517
1970
|
|
|
1518
|
-
|
|
1971
|
+
declare interface TweenOptions {
|
|
1972
|
+
owner?: Pick<Pencil, 'animations'>;
|
|
1973
|
+
onUpdate?: (value: number) => void;
|
|
1974
|
+
onComplete?: () => void;
|
|
1975
|
+
onCancel?: () => void;
|
|
1976
|
+
backwards?: boolean;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
|
|
1980
|
+
|
|
1981
|
+
export declare const VERSION = "0.33.1";
|
|
1519
1982
|
|
|
1520
1983
|
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
1521
1984
|
entrySceneId: string;
|
|
1522
1985
|
scenes: SceneViewportDocument[];
|
|
1523
|
-
/** Schema 3:
|
|
1986
|
+
/** Schema 3: scene payloads; schema 6 also shares material-library payloads. */
|
|
1524
1987
|
_resourcePool?: any[];
|
|
1988
|
+
/** Schema 4: serializable definitions shared by explicit asset identity. */
|
|
1989
|
+
materialLibrary?: MaterialAsset[];
|
|
1990
|
+
/** Reusable definitions. SDK-enabled assets are retained in deployment exports. */
|
|
1991
|
+
prefabLibrary?: PrefabAsset[];
|
|
1525
1992
|
c?: Record<string, any>;
|
|
1526
1993
|
d?: Record<string, any>;
|
|
1527
1994
|
h?: Record<string, any>;
|
|
@@ -1530,9 +1997,16 @@ export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
|
1530
1997
|
|
|
1531
1998
|
export declare interface VisSceneManifest {
|
|
1532
1999
|
format: typeof SCENE_MANIFEST_FORMAT;
|
|
1533
|
-
schemaVersion: typeof SCENE_MANIFEST_SCHEMA_VERSION;
|
|
2000
|
+
schemaVersion: 1 | 2 | typeof SCENE_MANIFEST_SCHEMA_VERSION;
|
|
1534
2001
|
entrySceneId: string;
|
|
1535
2002
|
scenes: SceneManifestEntry[];
|
|
2003
|
+
materialLibrary?: MaterialAsset[];
|
|
2004
|
+
/** Manifest 3: payloads referenced by the material catalog and scene files. */
|
|
2005
|
+
_resourcePool?: any[];
|
|
2006
|
+
/** Externalized image files, relative to the manifest URL. */
|
|
2007
|
+
imageAssets?: string[];
|
|
2008
|
+
/** Reusable definitions. Only assets with sdkKey are available for SDK instantiation. */
|
|
2009
|
+
prefabLibrary?: PrefabAsset[];
|
|
1536
2010
|
c?: Record<string, any>;
|
|
1537
2011
|
d?: Record<string, any>;
|
|
1538
2012
|
h?: Record<string, any>;
|
|
@@ -1540,15 +2014,3 @@ export declare interface VisSceneManifest {
|
|
|
1540
2014
|
}
|
|
1541
2015
|
|
|
1542
2016
|
export { }
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
declare module '@turf/turf' {
|
|
1547
|
-
export function point(...args: any[]): any;
|
|
1548
|
-
export function polygon(...args: any[]): any;
|
|
1549
|
-
export function booleanPointInPolygon(...args: any[]): boolean;
|
|
1550
|
-
export function center(...args: any[]): any;
|
|
1551
|
-
export function centroid(...args: any[]): any;
|
|
1552
|
-
export function bbox(...args: any[]): any;
|
|
1553
|
-
export function union(...args: any[]): any;
|
|
1554
|
-
}
|