vis-core 0.33.3 → 0.33.4
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 +103 -13
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,9 +53,19 @@ declare class Arc extends LineObject {
|
|
|
53
53
|
options: Options_5;
|
|
54
54
|
constructor(options: Options_5);
|
|
55
55
|
create(): Promise<void>;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
/** Internal/local-space curve used for rendering, editor handles and snapshots. */
|
|
57
|
+
getCurve(): ArcCurve;
|
|
58
|
+
/** Set four world-space Bézier controls; persisted coordinates remain local. */
|
|
59
|
+
setControlPoints(points: readonly [ArcPoint, ArcPoint, ArcPoint, ArcPoint]): void;
|
|
60
|
+
/** Set a world-space path without changing this object or its parent transforms. */
|
|
61
|
+
setPath(from: ArcPoint, to: ArcPoint, options: ArcPathOptions): void;
|
|
62
|
+
/** Exact radial lift above the short great circle; preserves every object transform. */
|
|
63
|
+
setSpherePath(from: ArcPoint, to: ArcPoint, options: ArcSpherePathOptions): void;
|
|
64
|
+
private worldToLocalMatrix;
|
|
65
|
+
private validatedNodes;
|
|
66
|
+
private setWorldControls;
|
|
67
|
+
private getPickPathOptions;
|
|
68
|
+
private syncPickPathOptions;
|
|
59
69
|
private updatePickTargetGeometry;
|
|
60
70
|
pickTube: Tube | null;
|
|
61
71
|
private pickTargetVersion;
|
|
@@ -76,6 +86,36 @@ declare class Arc extends LineObject {
|
|
|
76
86
|
render(): void;
|
|
77
87
|
}
|
|
78
88
|
|
|
89
|
+
declare type ArcCurve = THREE.CubicBezierCurve3 | SphereArcCurve;
|
|
90
|
+
|
|
91
|
+
export declare interface ArcPathOptions {
|
|
92
|
+
/** Maximum displacement from the endpoint segment along `up`, in world units. */
|
|
93
|
+
height: number;
|
|
94
|
+
/** World-space lift direction; normalized internally. Defaults to positive Z. */
|
|
95
|
+
up?: ArcPoint;
|
|
96
|
+
setPointWidth?: (progress: number) => number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare type ArcPoint = THREE.Vector3 | readonly number[];
|
|
100
|
+
|
|
101
|
+
/** A sphere frame in Arc-local coordinates. Its basis retains world-unit lengths. */
|
|
102
|
+
declare interface ArcSpherePath {
|
|
103
|
+
matrix: number[];
|
|
104
|
+
angle: number;
|
|
105
|
+
radius: number;
|
|
106
|
+
height: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare interface ArcSpherePathOptions {
|
|
110
|
+
/** World-space sphere center. Both endpoints must lie on the same sphere. */
|
|
111
|
+
center: ArcPoint;
|
|
112
|
+
/** Maximum distance above the sphere surface, in world units. Zero follows its surface. */
|
|
113
|
+
height: number;
|
|
114
|
+
/** World-space circle-plane normal for coincident or antipodal endpoints. */
|
|
115
|
+
normal?: ArcPoint;
|
|
116
|
+
setPointWidth?: (progress: number) => number;
|
|
117
|
+
}
|
|
118
|
+
|
|
79
119
|
declare class Area extends GroupObject {
|
|
80
120
|
objectType: string;
|
|
81
121
|
options: Options_11;
|
|
@@ -117,6 +157,9 @@ declare class Base_2 extends Camera {
|
|
|
117
157
|
visName: string;
|
|
118
158
|
private detectRes?;
|
|
119
159
|
private ownsPencil;
|
|
160
|
+
private renderingSuspensions;
|
|
161
|
+
/* Excluded from this release type: suspendRendering */
|
|
162
|
+
private acquireRenderingSuspensions;
|
|
120
163
|
publicDir: Record<string, string>;
|
|
121
164
|
private prefabAssets;
|
|
122
165
|
private prefabMaterials;
|
|
@@ -445,7 +488,7 @@ declare class ContinentsBg extends GroupObject {
|
|
|
445
488
|
mapArr: PlaneMap[];
|
|
446
489
|
constructor(options: Options_8);
|
|
447
490
|
create(): Promise<void>;
|
|
448
|
-
getLocationPosition(location: [number, number], name?: string): [number, number, number] | undefined;
|
|
491
|
+
getLocationPosition(location: [number, number], name?: string, height?: number): [number, number, number] | undefined;
|
|
449
492
|
private calculatePosition;
|
|
450
493
|
render(): void;
|
|
451
494
|
rebuildFromScene(): void;
|
|
@@ -533,19 +576,28 @@ declare class Earth_2 extends Base_2 {
|
|
|
533
576
|
};
|
|
534
577
|
private rotationControls?;
|
|
535
578
|
private releaseRotationLock?;
|
|
579
|
+
private visibilityChecks?;
|
|
536
580
|
private readonly stopAutoRotate;
|
|
537
581
|
private readonly resumeAutoRotate;
|
|
538
582
|
protected onRuntimeReady(): Promise<void>;
|
|
539
583
|
protected onDispose(): void;
|
|
540
|
-
|
|
584
|
+
private getLocationFrame;
|
|
585
|
+
/** 球体表面的世界坐标;height 沿真实表面法线偏移,单位为世界单位。 */
|
|
586
|
+
getLocationPosition(location: [number, number], height?: number): [number, number, number];
|
|
587
|
+
/** 球对象原点对应的世界球心。 */
|
|
588
|
+
getCenter(): [number, number, number];
|
|
589
|
+
/** 几何的本地半径,用于创建同坐标空间的地图图层。 */
|
|
541
590
|
getRadius(): number;
|
|
542
|
-
|
|
591
|
+
/** 真球的世界半径;非均匀缩放或剪切形成椭球时不能用于球面路径。 */
|
|
592
|
+
getWorldRadius(): number;
|
|
593
|
+
private requireSurfaceTransform;
|
|
594
|
+
checkBehindEarth(objArr: () => BaseObject[], cb: (obj: BaseObject[], res: boolean[]) => any): () => void;
|
|
543
595
|
/**
|
|
544
596
|
* 设置物体在球面上的位置和旋转,使其垂直于球面
|
|
545
597
|
* @param object - 要设置的物体
|
|
546
598
|
* @param location - 经纬度 [经度, 纬度]
|
|
547
|
-
* @param height -
|
|
548
|
-
* @param upAxis -
|
|
599
|
+
* @param height - 沿球面世界法线的距离,默认为0
|
|
600
|
+
* @param upAxis - Plane 的本地面法线(默认 -Z,正面朝球心);其他对象的本地朝向轴(默认 Y)
|
|
549
601
|
*/
|
|
550
602
|
setObjectOnSphere(baseObject: BaseObject, location: [number, number], height?: number, upAxis?: [number, number, number]): void;
|
|
551
603
|
getSceneBindings(): EarthSceneBindings;
|
|
@@ -759,12 +811,15 @@ declare class Map_3 extends Base_2 {
|
|
|
759
811
|
private labelGroupObject3dUserData;
|
|
760
812
|
eraseLabels(): void;
|
|
761
813
|
geAdcodePosition(adcode: number): [number, number, number] | undefined;
|
|
762
|
-
|
|
814
|
+
/** 地图顶面的世界坐标;height 沿顶面世界法线偏移,单位为世界单位。 */
|
|
815
|
+
getLocationPosition(location: [number, number], height?: number): [number, number, number];
|
|
816
|
+
private getMainMapLocationPosition;
|
|
817
|
+
private worldToObjectParent;
|
|
763
818
|
/**
|
|
764
819
|
* 设置物体在平面地图上的位置
|
|
765
820
|
* @param object - 要设置的物体
|
|
766
821
|
* @param location - 经纬度 [经度, 纬度]
|
|
767
|
-
* @param height -
|
|
822
|
+
* @param height - 沿地图顶面法线的世界距离,默认为0
|
|
768
823
|
*/
|
|
769
824
|
setObjectOnMap(object: BaseObject, location: [number, number], height?: number): void;
|
|
770
825
|
setObjectOnMapAreaByProperty(object: BaseObject, key: string, value: any, height?: number): void;
|
|
@@ -813,7 +868,7 @@ declare class Map_3 extends Base_2 {
|
|
|
813
868
|
/** undefined 表示沿用设计师构图;对象(包括全 0)表示宿主覆盖。 */
|
|
814
869
|
getSafeAreaInsets(): MapSafeAreaInsets | undefined;
|
|
815
870
|
setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
816
|
-
refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<
|
|
871
|
+
refitSafeAreaIfNeeded(options?: MapSafeAreaOptions): Promise<boolean>;
|
|
817
872
|
findAdcodeInfo(adcode: number): {
|
|
818
873
|
adcode: number;
|
|
819
874
|
lng: number;
|
|
@@ -850,7 +905,7 @@ declare class Map_3 extends Base_2 {
|
|
|
850
905
|
/* Excluded from this release type: rebuildRegion */
|
|
851
906
|
private rebuildRegionGeometry;
|
|
852
907
|
/** 候选区域提交后的相机过渡,不参与场景序列化。 */
|
|
853
|
-
playRegionEnterTransition({ duration, sourceCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
908
|
+
playRegionEnterTransition({ duration, sourceCamera, preparedCamera, onPrepared, }: MapRegionEnterTransitionOptions): Promise<void>;
|
|
854
909
|
/** Region rules are page-local runtime overrides of a saved material asset. */
|
|
855
910
|
private regionRuleMaterial;
|
|
856
911
|
private setRegionTexture;
|
|
@@ -960,6 +1015,7 @@ export declare interface MapRegionBackInteraction {
|
|
|
960
1015
|
|
|
961
1016
|
declare interface MapRegionEnterTransitionOptions extends SceneEnterTransitionOptions {
|
|
962
1017
|
sourceCamera?: [number, number, number, number, number, number];
|
|
1018
|
+
/* Excluded from this release type: preparedCamera */
|
|
963
1019
|
}
|
|
964
1020
|
|
|
965
1021
|
export declare type MapRegionSceneResolver = (document: VisSceneDocument, adcode: number) => string | SceneViewportDocument | null | undefined | Promise<string | SceneViewportDocument | null | undefined>;
|
|
@@ -1271,6 +1327,7 @@ declare interface Options_5 extends NonNullable<ConstructorParameters<typeof Lin
|
|
|
1271
1327
|
to: number[];
|
|
1272
1328
|
control1?: number[];
|
|
1273
1329
|
control2?: number[];
|
|
1330
|
+
spherePath?: ArcSpherePath;
|
|
1274
1331
|
radius?: number;
|
|
1275
1332
|
globe?: boolean;
|
|
1276
1333
|
color?: string;
|
|
@@ -1284,6 +1341,7 @@ declare interface Options_6 {
|
|
|
1284
1341
|
multiplyScalar?: number;
|
|
1285
1342
|
/** Compact saved inputs for an Arc's derived picking geometry. */
|
|
1286
1343
|
arcControlPoints?: number[][];
|
|
1344
|
+
arcSpherePath?: ArcSpherePath;
|
|
1287
1345
|
}
|
|
1288
1346
|
|
|
1289
1347
|
declare interface Options_7 {
|
|
@@ -1542,6 +1600,14 @@ declare interface SceneControlsOptions {
|
|
|
1542
1600
|
autoRotateSpeed?: number;
|
|
1543
1601
|
}
|
|
1544
1602
|
|
|
1603
|
+
export declare interface SceneDisplayContext {
|
|
1604
|
+
sceneId: string;
|
|
1605
|
+
/** 本次准备前已重新适配地图相机;false 的缓存页保留此前视角。 */
|
|
1606
|
+
cameraRefitted: boolean;
|
|
1607
|
+
/** 文档替换或 manager 销毁时取消准备。 */
|
|
1608
|
+
signal: AbortSignal;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1545
1611
|
export declare interface SceneDocumentMarker {
|
|
1546
1612
|
format: typeof SCENE_DOCUMENT_FORMAT;
|
|
1547
1613
|
schemaVersion: number;
|
|
@@ -1585,6 +1651,7 @@ export declare class SceneManager extends Event_2 {
|
|
|
1585
1651
|
private pencil?;
|
|
1586
1652
|
private safeAreaInsets?;
|
|
1587
1653
|
private generation;
|
|
1654
|
+
private displayPreparationAbort;
|
|
1588
1655
|
private documentIdentityRevision;
|
|
1589
1656
|
private preparedStructures;
|
|
1590
1657
|
private pendingInstances;
|
|
@@ -1613,6 +1680,7 @@ export declare class SceneManager extends Event_2 {
|
|
|
1613
1680
|
setSafeAreaInsets(insets?: Partial<MapSafeAreaInsets>, options?: MapSafeAreaOptions): Promise<void>;
|
|
1614
1681
|
getSafeAreaInsets(): MapSafeAreaInsets | undefined;
|
|
1615
1682
|
private captureCamera;
|
|
1683
|
+
private prepareSceneDisplay;
|
|
1616
1684
|
private playTransition;
|
|
1617
1685
|
/** 更新可编辑文档,并释放已经不属于文档的非活动场景实例。 */
|
|
1618
1686
|
setDocument(document: VisSceneDocument): void;
|
|
@@ -1740,6 +1808,8 @@ export declare interface SceneManagerBehaviorOptions {
|
|
|
1740
1808
|
debugInteractions?: boolean;
|
|
1741
1809
|
/** 创建场景后、恢复 JSON 前调用。 */
|
|
1742
1810
|
prepareScene?: (scene: Base_2) => void;
|
|
1811
|
+
/** 场景与最终相机就绪后、提交和首帧绘制前等待宿主准备。失败时保留原场景。 */
|
|
1812
|
+
beforeSceneDisplay?: (scene: Base_2, context: SceneDisplayContext) => void | Promise<void>;
|
|
1743
1813
|
/** 是否保留非活动场景实例;编辑器可关闭以限制 GPU/内存占用。 */
|
|
1744
1814
|
cacheScenes?: boolean;
|
|
1745
1815
|
/** Pages retained after navigation, including the active page; oldest inactive pages retire first. */
|
|
@@ -1936,6 +2006,26 @@ declare class Sphere extends MeshObject {
|
|
|
1936
2006
|
create(): void;
|
|
1937
2007
|
}
|
|
1938
2008
|
|
|
2009
|
+
/** Exact radial lift above the short great circle, expressed in object-local space. */
|
|
2010
|
+
declare class SphereArcCurve extends THREE.Curve<THREE.Vector3> {
|
|
2011
|
+
readonly type = "SphereArcCurve";
|
|
2012
|
+
readonly data: ArcSpherePath;
|
|
2013
|
+
readonly matrix: THREE.Matrix4;
|
|
2014
|
+
constructor(path: ArcSpherePath);
|
|
2015
|
+
get v0(): THREE.Vector3;
|
|
2016
|
+
get v3(): THREE.Vector3;
|
|
2017
|
+
getPoint(t: number, target?: THREE.Vector3): THREE.Vector3;
|
|
2018
|
+
getTangent(t: number, target?: THREE.Vector3): THREE.Vector3;
|
|
2019
|
+
clone(): this;
|
|
2020
|
+
copy(source: THREE.Curve<THREE.Vector3>): this;
|
|
2021
|
+
toJSON(): SphereArcCurveJSON;
|
|
2022
|
+
fromJSON(json: THREE.CurveJSON): this;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
declare interface SphereArcCurveJSON extends THREE.CurveJSON {
|
|
2026
|
+
spherePath: ArcSpherePath;
|
|
2027
|
+
}
|
|
2028
|
+
|
|
1939
2029
|
declare class SphereShadow extends MeshObject {
|
|
1940
2030
|
objectType: string;
|
|
1941
2031
|
options: Required<Options_3>;
|
|
@@ -2009,7 +2099,7 @@ declare interface TweenOptions {
|
|
|
2009
2099
|
|
|
2010
2100
|
export declare function updateProjectMaterial<T extends VisSceneDocument>(document: T, assetId: string, patch: Partial<Pick<MaterialAsset, 'name' | 'material' | 'locked'>>): T;
|
|
2011
2101
|
|
|
2012
|
-
export declare const VERSION = "0.33.
|
|
2102
|
+
export declare const VERSION = "0.33.4";
|
|
2013
2103
|
|
|
2014
2104
|
export declare interface VisSceneDocument extends SceneDocumentMarker {
|
|
2015
2105
|
entrySceneId: string;
|