vis-core 0.32.3 → 0.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +61 -7
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -59,7 +59,9 @@ declare class Arc extends LineObject {
|
|
|
59
59
|
setControlPoints(points: [THREE.Vector3, THREE.Vector3, THREE.Vector3, THREE.Vector3]): void;
|
|
60
60
|
setPath(from: THREE.Vector3 | number[], to: THREE.Vector3 | number[], radius: number, setPointWidth?: (p: number) => number): void;
|
|
61
61
|
pickTube: Tube | null;
|
|
62
|
-
|
|
62
|
+
private pickTargetVersion;
|
|
63
|
+
addPickTarget(radius?: number, show?: boolean): Promise<Tube | undefined>;
|
|
64
|
+
dispose(): void;
|
|
63
65
|
onPointerEvent(...args: Parameters<BaseObject['onPointerEvent']>): void;
|
|
64
66
|
setColor(color: string): void;
|
|
65
67
|
animateIn({ duration, delay, repeat, onComplete, onRepeat, }?: {
|
|
@@ -103,6 +105,7 @@ export declare class Base extends Camera {
|
|
|
103
105
|
pmremGenerator: THREE.PMREMGenerator | null;
|
|
104
106
|
re: RoomEnvironment | null;
|
|
105
107
|
roomEnvMap?: THREE.Texture;
|
|
108
|
+
private roomEnvTarget?;
|
|
106
109
|
visName: string;
|
|
107
110
|
private detectRes?;
|
|
108
111
|
private ownsPencil;
|
|
@@ -132,6 +135,12 @@ export declare class Base extends Camera {
|
|
|
132
135
|
private createRuntime;
|
|
133
136
|
private sceneActive;
|
|
134
137
|
setSceneActive(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Bloom and shadow-map configuration live on the shared renderer/composer,
|
|
140
|
+
* rather than on an individual Pencil page. Reapply the active page's saved
|
|
141
|
+
* values whenever a cached scene becomes active again.
|
|
142
|
+
*/
|
|
143
|
+
private applySceneRenderState;
|
|
135
144
|
/** 把 Pencil 生命周期交给外部场景管理器,当前实例仅拥有自己的 page。 */
|
|
136
145
|
releasePencilOwnership(): void;
|
|
137
146
|
private initSceneUserData;
|
|
@@ -151,7 +160,7 @@ export declare class Base extends Camera {
|
|
|
151
160
|
hide(): void;
|
|
152
161
|
exportScene(): THREE.Object3DJSON;
|
|
153
162
|
exportBaseObject(baseObject: BaseObject): THREE.Object3DJSON;
|
|
154
|
-
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any
|
|
163
|
+
restoreBaseObject(data: string | THREE.Object3DJSON, target?: BaseObject, objectsMap?: Record<string, any>, signal?: AbortSignal): Promise<BaseObject<THREE.Object3D<THREE.Object3DEventMap>>>;
|
|
155
164
|
restoreScene(str: string | THREE.Object3DJSON, objectsMap?: Record<string, any>): Promise<void>;
|
|
156
165
|
getClassRefByType(type: string): typeof BaseObject;
|
|
157
166
|
addGroup(): Promise< GroupObject>;
|
|
@@ -359,8 +368,12 @@ declare class CityPlane extends MeshObject {
|
|
|
359
368
|
create(): Promise<void>;
|
|
360
369
|
rebuildFromScene(): void;
|
|
361
370
|
addWater(normalMaps: [THREE.Texture, THREE.Texture]): void;
|
|
371
|
+
dispose(): void;
|
|
362
372
|
}
|
|
363
373
|
|
|
374
|
+
/** Rebind internal targets while preserving links to scenes outside the copied set. */
|
|
375
|
+
export declare function cloneSceneWithIds(scene: SceneViewportDocument, ids: Map<string, string>): SceneViewportDocument;
|
|
376
|
+
|
|
364
377
|
declare class ContinentsBg extends GroupObject {
|
|
365
378
|
objectType: string;
|
|
366
379
|
options: Options_8;
|
|
@@ -471,6 +484,9 @@ declare class Event_2 {
|
|
|
471
484
|
dispose(): void;
|
|
472
485
|
}
|
|
473
486
|
|
|
487
|
+
/** Expand at the editor import boundary so independently edited scenes own their data. */
|
|
488
|
+
export declare function expandSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
489
|
+
|
|
474
490
|
declare const findAdcodeInfo: (adcode: number) => {
|
|
475
491
|
adcode: number;
|
|
476
492
|
lng: number;
|
|
@@ -488,7 +504,9 @@ declare type GeoJSON_3 = FeatureCollection<Polygon | MultiPolygon>;
|
|
|
488
504
|
|
|
489
505
|
declare type GeoJSON_4 = FeatureCollection<Polygon | MultiPolygon>;
|
|
490
506
|
|
|
491
|
-
export declare function getSceneDocument(document: VisSceneDocument, sceneId?: string
|
|
507
|
+
export declare function getSceneDocument(document: VisSceneDocument, sceneId?: string, options?: {
|
|
508
|
+
resolveResources?: boolean;
|
|
509
|
+
}): SceneViewportDocument;
|
|
492
510
|
|
|
493
511
|
declare class HemisphereLight extends HemisphereLightObject {
|
|
494
512
|
}
|
|
@@ -527,6 +545,9 @@ declare class Map_2 extends Base {
|
|
|
527
545
|
/** 当前已恢复或生成的主地图区域;空场景为 undefined。 */
|
|
528
546
|
get adcode(): number | undefined;
|
|
529
547
|
activePlaneMap: PlaneMap | null;
|
|
548
|
+
/** 宿主大屏图表等遮挡形成的运行时安全区;不写入场景 options。 */
|
|
549
|
+
private safeAreaInsets;
|
|
550
|
+
private safeAreaRefitPending;
|
|
530
551
|
parentBg: PlaneMap[];
|
|
531
552
|
continentsBg?: ContinentsBg;
|
|
532
553
|
group: GroupObject;
|
|
@@ -646,7 +667,11 @@ declare class Map_2 extends Base {
|
|
|
646
667
|
adcode: number;
|
|
647
668
|
extrudelineBloom?: boolean;
|
|
648
669
|
}): Promise<PlaneMap>;
|
|
649
|
-
|
|
670
|
+
private hasSafeAreaInsets;
|
|
671
|
+
private getEffectiveSafeAreaPadding;
|
|
672
|
+
getSafeAreaInsets(): MapSafeAreaInsets;
|
|
673
|
+
setSafeAreaInsets(insets: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
674
|
+
refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<void>;
|
|
650
675
|
findAdcodeInfo(adcode: number): {
|
|
651
676
|
adcode: number;
|
|
652
677
|
lng: number;
|
|
@@ -736,7 +761,6 @@ declare interface MapOptions extends BaseOptions {
|
|
|
736
761
|
continentsBg?: boolean;
|
|
737
762
|
continentsBgDepth?: number;
|
|
738
763
|
mapDepth?: number;
|
|
739
|
-
mapPadding?: [number, number, number, number];
|
|
740
764
|
fixGeojson?: Record<string, string>;
|
|
741
765
|
showDistrict?: boolean;
|
|
742
766
|
showLabel?: boolean | 'lite';
|
|
@@ -797,6 +821,21 @@ export declare interface MapRegionSwitchInteraction {
|
|
|
797
821
|
};
|
|
798
822
|
}
|
|
799
823
|
|
|
824
|
+
/** 宿主界面覆盖地图的运行时安全区,单位为 CSS px。 */
|
|
825
|
+
export declare interface MapSafeAreaInsets {
|
|
826
|
+
top: number;
|
|
827
|
+
right: number;
|
|
828
|
+
bottom: number;
|
|
829
|
+
left: number;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export declare interface MapSafeAreaOptions {
|
|
833
|
+
/** 设置后是否立即重新适配当前地图。默认 true。 */
|
|
834
|
+
refit?: boolean;
|
|
835
|
+
transition?: boolean;
|
|
836
|
+
smoothTime?: number;
|
|
837
|
+
}
|
|
838
|
+
|
|
800
839
|
/** 平台导出的运行时对象绑定,使用 Lead 的完整 key,不依赖命名规则。 */
|
|
801
840
|
declare interface MapSceneBindings {
|
|
802
841
|
container: string;
|
|
@@ -1032,6 +1071,9 @@ declare interface Options_9 {
|
|
|
1032
1071
|
grey?: boolean;
|
|
1033
1072
|
}
|
|
1034
1073
|
|
|
1074
|
+
/** Pack an export copy only; preserve the editor's independent scene snapshots. */
|
|
1075
|
+
export declare function packSceneDocumentResources<T extends VisSceneDocument>(document: T): T;
|
|
1076
|
+
|
|
1035
1077
|
declare class Plane extends MeshObject {
|
|
1036
1078
|
objectType: string;
|
|
1037
1079
|
create(): void;
|
|
@@ -1168,7 +1210,7 @@ declare class Road extends GroupObject {
|
|
|
1168
1210
|
|
|
1169
1211
|
export declare const SCENE_DOCUMENT_FORMAT: "vis-scene";
|
|
1170
1212
|
|
|
1171
|
-
export declare const SCENE_DOCUMENT_SCHEMA_VERSION:
|
|
1213
|
+
export declare const SCENE_DOCUMENT_SCHEMA_VERSION: 3;
|
|
1172
1214
|
|
|
1173
1215
|
export declare interface SceneBackInteraction {
|
|
1174
1216
|
trigger: 'click' | 'clickOutside';
|
|
@@ -1220,10 +1262,18 @@ export declare class SceneManager extends Event_2 {
|
|
|
1220
1262
|
private isSwitching;
|
|
1221
1263
|
private isRegionSwitching;
|
|
1222
1264
|
private pencil?;
|
|
1265
|
+
private safeAreaInsets;
|
|
1223
1266
|
private debugInteraction;
|
|
1224
1267
|
private enablePickDebug;
|
|
1225
1268
|
private disposeInactiveScenes;
|
|
1226
1269
|
constructor(options: SceneManagerInitOptions);
|
|
1270
|
+
private prepareScene;
|
|
1271
|
+
/**
|
|
1272
|
+
* 设置宿主界面的运行时地图安全区。该状态不进入场景文档,并会自动传给
|
|
1273
|
+
* 当前地图、缓存地图和后续创建的地图区域。
|
|
1274
|
+
*/
|
|
1275
|
+
setSafeAreaInsets(insets: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
1276
|
+
getSafeAreaInsets(): MapSafeAreaInsets;
|
|
1227
1277
|
private captureCamera;
|
|
1228
1278
|
private playTransition;
|
|
1229
1279
|
/** 接管一个已经恢复完成的场景,供编辑器首次加载时复用。 */
|
|
@@ -1290,6 +1340,8 @@ export declare type SceneManagerInitOptions = SceneManagerOptions & SceneManager
|
|
|
1290
1340
|
export declare interface SceneManagerOptions extends Pick<BaseOptions, 'container' | 'controlsContainer' | 'css2DContainer' | 'assetsPrefix' | 'pencilConfig' | 'logarithmicDepthBuffer' | 'tier' | 'observeParentScale'> {
|
|
1291
1341
|
/** 动态行政区数据访问使用的授权 key。 */
|
|
1292
1342
|
mapSwitchKey?: string;
|
|
1343
|
+
/** 宿主大屏图表等覆盖区域形成的运行时地图安全区。 */
|
|
1344
|
+
safeAreaInsets?: Partial<MapSafeAreaInsets>;
|
|
1293
1345
|
}
|
|
1294
1346
|
|
|
1295
1347
|
export declare interface SceneSwitchInteraction {
|
|
@@ -1411,11 +1463,13 @@ export { TWEEN }
|
|
|
1411
1463
|
|
|
1412
1464
|
export { Tween }
|
|
1413
1465
|
|
|
1414
|
-
export declare const VERSION = "0.32.
|
|
1466
|
+
export declare const VERSION = "0.32.5";
|
|
1415
1467
|
|
|
1416
1468
|
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
1417
1469
|
entrySceneId: string;
|
|
1418
1470
|
scenes: SceneViewportDocument[];
|
|
1471
|
+
/** Schema 3: image/video/data payloads shared across scenes, never live textures. */
|
|
1472
|
+
_resourcePool?: any[];
|
|
1419
1473
|
c?: Record<string, any>;
|
|
1420
1474
|
d?: Record<string, any>;
|
|
1421
1475
|
h?: Record<string, any>;
|