vis-core 0.32.6 → 0.32.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -88,7 +88,9 @@ export declare function assertRuntimeSceneDocument(value: unknown): asserts valu
88
88
 
89
89
  export declare function assertSupportedSceneDocument(value: unknown): void;
90
90
 
91
- export declare class Base extends Camera {
91
+ export declare type Base = Base_2;
92
+
93
+ declare class Base_2 extends Camera {
92
94
  static VisName: string;
93
95
  runtimePolicy: {
94
96
  observeParentScale: boolean;
@@ -119,7 +121,7 @@ export declare class Base extends Camera {
119
121
  private resolveRendererDepthBufferOptions;
120
122
  private showDetectRes;
121
123
  setOptions(options: Record<string, any>): void;
122
- fromJSON(jsonOrUrl: Record<string, any> | string, hooksE?: Record<string, any>): Promise<void>;
124
+ /* Excluded from this release type: fromJSON */
123
125
  private runtimeInitialization?;
124
126
  private disposed;
125
127
  /* Excluded from this release type: initializeRuntime */
@@ -393,7 +395,9 @@ declare class DirectionalLight extends DirectionalLightObject {
393
395
  render(): void;
394
396
  }
395
397
 
396
- export declare class Earth extends Base {
398
+ export declare type Earth = Earth_2;
399
+
400
+ declare class Earth_2 extends Base_2 {
397
401
  static VisName: string;
398
402
  leftTruck: boolean;
399
403
  options: Required<EarthOptions>;
@@ -404,7 +408,7 @@ export declare class Earth extends Base {
404
408
  setOptions(options: EarthOptions): void;
405
409
  handleSetting(key: string, value: any): void;
406
410
  protected get objectTypes(): {
407
- Earth: Earth_2;
411
+ Earth: Earth_3;
408
412
  SphereShadow: SphereShadow;
409
413
  Countries: typeof PlaneMap;
410
414
  PlaneMap: typeof PlaneMap;
@@ -450,7 +454,7 @@ export declare class Earth extends Base {
450
454
  protected onSceneRestored(): Promise<void>;
451
455
  }
452
456
 
453
- declare class Earth_2 extends Sphere {
457
+ declare class Earth_3 extends Sphere {
454
458
  objectType: string;
455
459
  options: Required<Options_4>;
456
460
  constructor(options: Options_4);
@@ -473,6 +477,8 @@ declare interface EarthSceneBindings {
473
477
  secondaryMap?: string;
474
478
  }
475
479
 
480
+ export declare type EmptySceneDefinition = Omit<SceneViewportDocument, 'scene'>;
481
+
476
482
  declare class Event_2 {
477
483
  event: EventEmitter;
478
484
  private eventHandlers;
@@ -517,7 +523,10 @@ declare class HemisphereLight extends HemisphereLightObject {
517
523
  */
518
524
  export declare function isSceneDocument(value: unknown): value is SceneDocumentMarker & Record<string, any>;
519
525
 
520
- declare class Map_2 extends Base {
526
+ declare type Map_2 = Map_3;
527
+ export { Map_2 as Map }
528
+
529
+ declare class Map_3 extends Base_2 {
521
530
  static VisName: string;
522
531
  options: Required<MapCityOptions>;
523
532
  /** 当前唯一主地图的运行时状态。 */
@@ -712,7 +721,6 @@ declare class Map_2 extends Base {
712
721
  applyRegionTextureRules(adcode: number): Promise<void>;
713
722
  protected onDispose(): void;
714
723
  }
715
- export { Map_2 as Map }
716
724
 
717
725
  declare interface MapAssetSources {
718
726
  worldGeojson: string;
@@ -1276,28 +1284,31 @@ export declare class SceneManager extends Event_2 {
1276
1284
  getSafeAreaInsets(): MapSafeAreaInsets;
1277
1285
  private captureCamera;
1278
1286
  private playTransition;
1279
- /** 接管一个已经恢复完成的场景,供编辑器首次加载时复用。 */
1280
- attach(document: VisSceneDocument, sceneId: string, scene: Base): Base;
1281
1287
  /** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
1282
1288
  setDocument(document: VisSceneDocument): void;
1283
- load(documentOrUrl: VisSceneDocument | string, hooks?: Record<string, any>): Promise<Base>;
1289
+ load(documentOrUrl: VisSceneDocument | string, hooks?: Record<string, any>): Promise<Base_2>;
1290
+ /**
1291
+ * 创建一个没有快照输入的运行时页面,并在可选构建步骤完成后将其导出为
1292
+ * 标准单场景文档。主要供编辑器新建和旧模板迁移使用。
1293
+ */
1294
+ createEmptyScene(definition: EmptySceneDefinition, build?: (scene: Base_2) => void | Promise<void>): Promise<Base_2>;
1284
1295
  /**
1285
1296
  * 以指定地图模板和行政区直接启动,不先加载文档配置的入口场景。
1286
1297
  * 适用于宿主按路由或业务参数决定初始省、市、区的场景。
1287
1298
  */
1288
- loadMapRegion(documentOrUrl: VisSceneDocument | string, sceneId: string, adcode: number, hooks?: Record<string, any>): Promise<Map_2>;
1289
- loadMapRegion(documentOrUrl: VisSceneDocument | string, adcode: number, resolveScene: MapRegionSceneResolver, hooks?: Record<string, any>): Promise<Map_2>;
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>;
1290
1301
  private loadDocument;
1291
- switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base | null>;
1302
+ switchScene(sceneId: string, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Base_2 | null>;
1292
1303
  /**
1293
1304
  * 恢复并缓存一个非活动场景,不改变当前场景、导航历史或相机。
1294
1305
  * 适合预制件场景:调用方可从返回实例取对象,再通过 instantiate({ target })
1295
1306
  * 直接实例化到当前场景。
1296
1307
  */
1297
- preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base>;
1308
+ preloadScene(sceneId: string, hooks?: Record<string, any>): Promise<Base_2>;
1298
1309
  /** 编辑器事务:在独立页面上修改参数并重建快照,成功后一起提交文档和实例。 */
1299
- editScene(sceneId: string, edit: (scene: Base, definition: SceneViewportDocument) => Promise<SceneViewportDocument>, hooks?: Record<string, any>): Promise<Base>;
1300
- back(hooks?: Record<string, any>): Promise<Base | null>;
1310
+ editScene(sceneId: string, edit: (scene: Base_2, definition: SceneViewportDocument) => Promise<SceneViewportDocument>, hooks?: Record<string, any>): Promise<Base_2>;
1311
+ back(hooks?: Record<string, any>): Promise<Base_2 | null>;
1301
1312
  /**
1302
1313
  * 切到目标地图场景,并按 adcode 重建其中的地图。sceneId 不同时,语义等价于
1303
1314
  * switchScene(sceneId) 后 switchMapRegion(adcode),但候选场景只在两步都成功后提交,
@@ -1305,17 +1316,17 @@ export declare class SceneManager extends Event_2 {
1305
1316
  * 始终从文档基线构建隔离页面,避免对缓存实例反复施加缩放/删除修正。
1306
1317
  * 旧页面在构建期间保持完整;只有所有资源、几何和交互就绪才提交导航。
1307
1318
  */
1308
- switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Map_2 | null>;
1319
+ switchMapRegion(sceneId: string, adcode: number, options?: SwitchSceneOptions, hooks?: Record<string, any>): Promise<Map_3 | null>;
1309
1320
  /** 场景切换与区域切换共享一条返回历史。 */
1310
- backMapRegion(hooks?: Record<string, any>): Promise<Base | null>;
1321
+ backMapRegion(hooks?: Record<string, any>): Promise<Base_2 | null>;
1311
1322
  getCurrentSceneId(): string;
1312
1323
  getCurrentScene<T extends SceneType>(type: T): SceneTypeMap[T] | null;
1313
- getCurrentScene(): Base | null;
1324
+ getCurrentScene(): Base_2 | null;
1314
1325
  private getCurrentSceneByType;
1315
1326
  getScene<T extends SceneType>(sceneId: string, type: T): SceneTypeMap[T] | undefined;
1316
- getScene(sceneId: string): Base | undefined;
1327
+ getScene(sceneId: string): Base_2 | undefined;
1317
1328
  getSceneByName<T extends SceneType>(name: string, type: T): SceneTypeMap[T] | undefined;
1318
- getSceneByName(name: string): Base | undefined;
1329
+ getSceneByName(name: string): Base_2 | undefined;
1319
1330
  private getSceneByType;
1320
1331
  getDocument(): VisSceneDocument | undefined;
1321
1332
  private bindSceneInteractions;
@@ -1330,7 +1341,7 @@ export declare interface SceneManagerBehaviorOptions {
1330
1341
  /** 输出射线命中和场景交互诊断,仅用于开发排查。 */
1331
1342
  debugInteractions?: boolean;
1332
1343
  /** 创建场景后、恢复 JSON 前调用。 */
1333
- prepareScene?: (scene: Base) => void;
1344
+ prepareScene?: (scene: Base_2) => void;
1334
1345
  /** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
1335
1346
  cacheScenes?: boolean;
1336
1347
  }
@@ -1362,9 +1373,9 @@ export declare interface SceneTransitionOptions {
1362
1373
  export declare type SceneType = keyof SceneTypeMap;
1363
1374
 
1364
1375
  export declare interface SceneTypeMap {
1365
- base: Base;
1366
- earth: Earth;
1367
- map: Map_2;
1376
+ base: Base_2;
1377
+ earth: Earth_2;
1378
+ map: Map_3;
1368
1379
  }
1369
1380
 
1370
1381
  export declare interface SceneViewportDocument {
@@ -1463,7 +1474,7 @@ export { TWEEN }
1463
1474
 
1464
1475
  export { Tween }
1465
1476
 
1466
- export declare const VERSION = "0.32.6";
1477
+ export declare const VERSION = "0.32.7";
1467
1478
 
1468
1479
  export declare interface VisSceneDocument extends SceneDocumentMarker {
1469
1480
  entrySceneId: string;