vesium 1.0.1-beta.51 → 1.0.1-beta.54
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/README.md +1 -1
- package/dist/index.cjs +160 -698
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -568
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +96 -568
- package/dist/index.d.mts.map +1 -1
- package/dist/index.iife.js +910 -1452
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +134 -644
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Arrayable, FunctionArgs, MaybeComputedElementRef } from "@vueuse/core";
|
|
2
|
+
import * as vue0 from "vue";
|
|
2
3
|
import { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowReactive, ShallowRef, WatchStopHandle } from "vue";
|
|
3
|
-
import { Camera, Cartesian2, Cartesian3, Cartographic,
|
|
4
|
+
import { Camera, Cartesian2, Cartesian3, Cartographic, DataSourceCollection, Entity, EntityCollection, Event, ImageryLayer, ImageryLayerCollection, KeyboardEventModifier, PostProcessStage, PostProcessStageCollection, PostProcessStageComposite, PrimitiveCollection, Rectangle, ScreenSpaceEventHandler, ScreenSpaceEventType, Viewer } from "cesium";
|
|
5
|
+
import { CesiumDataSource, CommonCoord, Nullable } from "@vesium/shared";
|
|
6
|
+
export * from "@vesium/shared";
|
|
4
7
|
|
|
5
8
|
//#region createViewer/index.d.ts
|
|
6
9
|
|
|
@@ -9,6 +12,8 @@ import { Camera, Cartesian2, Cartesian3, Cartographic, CustomDataSource, CzmlDat
|
|
|
9
12
|
* which can be accessed by the current component and its descendant components using {@link useViewer}
|
|
10
13
|
*
|
|
11
14
|
* When the Viewer instance referenced by this overloaded function becomes invalid, it will not trigger destruction.
|
|
15
|
+
* @param viewer - Existing viewer instance
|
|
16
|
+
* @returns The Viewer instance
|
|
12
17
|
*/
|
|
13
18
|
declare function createViewer(viewer: MaybeRef<Viewer | undefined>): Readonly<ShallowRef<Viewer | undefined>>;
|
|
14
19
|
/**
|
|
@@ -18,10 +23,10 @@ declare function createViewer(viewer: MaybeRef<Viewer | undefined>): Readonly<Sh
|
|
|
18
23
|
* The Viewer instance created by this overloaded function will automatically be destroyed when it becomes invalid.
|
|
19
24
|
*
|
|
20
25
|
* @param element - The DOM element or ID that will contain the widget
|
|
21
|
-
* @param options -
|
|
26
|
+
* @param options - see `Viewer.ConstructorOptions`
|
|
27
|
+
* @returns The Viewer instance
|
|
22
28
|
*/
|
|
23
29
|
declare function createViewer(element?: MaybeComputedElementRef, options?: Viewer.ConstructorOptions): Readonly<ShallowRef<Viewer | undefined>>;
|
|
24
|
-
//# sourceMappingURL=index.d.ts.map
|
|
25
30
|
//#endregion
|
|
26
31
|
//#region toPromiseValue/index.d.ts
|
|
27
32
|
type OnAsyncGetterCancel = (onCancel: () => void) => void;
|
|
@@ -41,6 +46,7 @@ interface ToPromiseValueOptions {
|
|
|
41
46
|
*
|
|
42
47
|
* @param source The source value, which can be a reactive reference or an asynchronous getter.
|
|
43
48
|
* @param options Conversion options
|
|
49
|
+
* @returns The converted value.
|
|
44
50
|
*
|
|
45
51
|
* @example
|
|
46
52
|
* ```ts
|
|
@@ -52,7 +58,6 @@ interface ToPromiseValueOptions {
|
|
|
52
58
|
* ```
|
|
53
59
|
*/
|
|
54
60
|
declare function toPromiseValue<T>(source: MaybeRefOrAsyncGetter<T>, options?: ToPromiseValueOptions): Promise<T>;
|
|
55
|
-
//# sourceMappingURL=index.d.ts.map
|
|
56
61
|
//#endregion
|
|
57
62
|
//#region useCameraState/index.d.ts
|
|
58
63
|
interface UseCameraStateOptions {
|
|
@@ -73,21 +78,24 @@ interface UseCameraStateOptions {
|
|
|
73
78
|
delay?: number;
|
|
74
79
|
}
|
|
75
80
|
interface UseCameraStateRetrun {
|
|
81
|
+
/**
|
|
82
|
+
* The camera
|
|
83
|
+
*/
|
|
76
84
|
camera: ComputedRef<Camera | undefined>;
|
|
77
85
|
/**
|
|
78
|
-
* The position of the camera
|
|
86
|
+
* The position of the camera
|
|
79
87
|
*/
|
|
80
88
|
position: ComputedRef<Cartesian3 | undefined>;
|
|
81
89
|
/**
|
|
82
|
-
* The view direction of the
|
|
90
|
+
* The view direction of the camer
|
|
83
91
|
*/
|
|
84
92
|
direction: ComputedRef<Cartesian3 | undefined>;
|
|
85
93
|
/**
|
|
86
|
-
* The up direction of the camera
|
|
94
|
+
* The up direction of the camera
|
|
87
95
|
*/
|
|
88
96
|
up: ComputedRef<Cartesian3 | undefined>;
|
|
89
97
|
/**
|
|
90
|
-
* The right direction of the camera
|
|
98
|
+
* The right direction of the camera
|
|
91
99
|
*/
|
|
92
100
|
right: ComputedRef<Cartesian3 | undefined>;
|
|
93
101
|
/**
|
|
@@ -98,35 +106,35 @@ interface UseCameraStateRetrun {
|
|
|
98
106
|
*/
|
|
99
107
|
positionCartographic: ComputedRef<Cartographic | undefined>;
|
|
100
108
|
/**
|
|
101
|
-
* Gets the position of the camera in world coordinates
|
|
109
|
+
* Gets the position of the camera in world coordinates
|
|
102
110
|
*/
|
|
103
111
|
positionWC: ComputedRef<Cartesian3 | undefined>;
|
|
104
112
|
/**
|
|
105
|
-
* Gets the view direction of the camera in world coordinates
|
|
113
|
+
* Gets the view direction of the camera in world coordinates
|
|
106
114
|
*/
|
|
107
115
|
directionWC: ComputedRef<Cartesian3 | undefined>;
|
|
108
116
|
/**
|
|
109
|
-
* Gets the up direction of the camera in world coordinates
|
|
117
|
+
* Gets the up direction of the camera in world coordinates
|
|
110
118
|
*/
|
|
111
119
|
upWC: ComputedRef<Cartesian3 | undefined>;
|
|
112
120
|
/**
|
|
113
|
-
* Gets the right direction of the camera in world coordinates
|
|
121
|
+
* Gets the right direction of the camera in world coordinates
|
|
114
122
|
*/
|
|
115
123
|
rightWC: ComputedRef<Cartesian3 | undefined>;
|
|
116
124
|
/**
|
|
117
|
-
* Computes the approximate visible rectangle on the ellipsoid
|
|
125
|
+
* Computes the approximate visible rectangle on the ellipsoid
|
|
118
126
|
*/
|
|
119
127
|
viewRectangle: ComputedRef<Rectangle | undefined>;
|
|
120
128
|
/**
|
|
121
|
-
* Gets the camera heading in radians
|
|
129
|
+
* Gets the camera heading in radians
|
|
122
130
|
*/
|
|
123
131
|
heading: ComputedRef<number | undefined>;
|
|
124
132
|
/**
|
|
125
|
-
* Gets the camera pitch in radians
|
|
133
|
+
* Gets the camera pitch in radians
|
|
126
134
|
*/
|
|
127
135
|
pitch: ComputedRef<number | undefined>;
|
|
128
136
|
/**
|
|
129
|
-
* Gets the camera roll in radians
|
|
137
|
+
* Gets the camera roll in radians
|
|
130
138
|
*/
|
|
131
139
|
roll: ComputedRef<number | undefined>;
|
|
132
140
|
/**
|
|
@@ -136,9 +144,10 @@ interface UseCameraStateRetrun {
|
|
|
136
144
|
}
|
|
137
145
|
/**
|
|
138
146
|
* Reactive Cesium Camera state
|
|
147
|
+
* @param options options
|
|
148
|
+
* @returns Reactive camera states
|
|
139
149
|
*/
|
|
140
150
|
declare function useCameraState(options?: UseCameraStateOptions): UseCameraStateRetrun;
|
|
141
|
-
//# sourceMappingURL=index.d.ts.map
|
|
142
151
|
//#endregion
|
|
143
152
|
//#region useCesiumEventListener/index.d.ts
|
|
144
153
|
interface UseCesiumEventListenerOptions {
|
|
@@ -152,9 +161,13 @@ interface UseCesiumEventListenerOptions {
|
|
|
152
161
|
* Easily use the `addEventListener` in `Cesium.Event` instances,
|
|
153
162
|
* when the dependent data changes or the component is unmounted,
|
|
154
163
|
* the listener function will automatically reload or destroy.
|
|
164
|
+
*
|
|
165
|
+
* @param event The Cesium.Event instance
|
|
166
|
+
* @param listener The listener function
|
|
167
|
+
* @param options additional options
|
|
168
|
+
* @returns A function that can be called to remove the event listener
|
|
155
169
|
*/
|
|
156
170
|
declare function useCesiumEventListener<FN extends FunctionArgs<any[]>>(event: Arrayable<Event<FN> | undefined> | Arrayable<MaybeRefOrGetter<Event<FN> | undefined>> | MaybeRefOrGetter<Arrayable<Event<FN> | undefined>>, listener: FN, options?: UseCesiumEventListenerOptions): WatchStopHandle;
|
|
157
|
-
//# sourceMappingURL=index.d.ts.map
|
|
158
171
|
//#endregion
|
|
159
172
|
//#region useCesiumFps/index.d.ts
|
|
160
173
|
interface UseCesiumFpsOptions {
|
|
@@ -176,13 +189,28 @@ interface UseCesiumFpsRetrun {
|
|
|
176
189
|
}
|
|
177
190
|
/**
|
|
178
191
|
* Reactive get the frame rate of Cesium
|
|
192
|
+
* @param options options
|
|
193
|
+
* @returns Reactive fps states
|
|
179
194
|
*/
|
|
180
195
|
declare function useCesiumFps(options?: UseCesiumFpsOptions): UseCesiumFpsRetrun;
|
|
181
|
-
//# sourceMappingURL=index.d.ts.map
|
|
182
196
|
//#endregion
|
|
183
197
|
//#region useCollectionScope/index.d.ts
|
|
184
198
|
type EffcetRemovePredicate<T> = (instance: T) => boolean;
|
|
185
|
-
interface
|
|
199
|
+
interface UseCollectionScopeOptions<T, AddArgs extends any[], RemoveArgs extends any[] = [], RemoveReturn = any> {
|
|
200
|
+
/**
|
|
201
|
+
* add SideEffect function. eg.`entites.add`
|
|
202
|
+
*/
|
|
203
|
+
addEffect: (instance: T | Promise<T>, ...args: AddArgs) => T | Promise<T>;
|
|
204
|
+
/**
|
|
205
|
+
* Clean SideEffect function. eg.`entities.remove`
|
|
206
|
+
*/
|
|
207
|
+
removeEffect: (instance: T, ...args: RemoveArgs) => RemoveReturn;
|
|
208
|
+
/**
|
|
209
|
+
* The parameters to pass for `removeScope` triggered when the component is unmounted
|
|
210
|
+
*/
|
|
211
|
+
removeScopeArgs?: RemoveArgs;
|
|
212
|
+
}
|
|
213
|
+
interface UseCollectionScopeReturn<T, AddArgs extends any[], RemoveArgs extends any[], RemoveReturn = any> {
|
|
186
214
|
/**
|
|
187
215
|
* A `Set` for storing SideEffect instance,
|
|
188
216
|
* which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
|
|
@@ -191,11 +219,11 @@ interface UseCollectionScopeReturn<isPromise extends boolean, T, AddArgs extends
|
|
|
191
219
|
/**
|
|
192
220
|
* Add SideEffect instance
|
|
193
221
|
*/
|
|
194
|
-
add: (
|
|
222
|
+
add: <R extends T | Promise<T>>(instance: R, ...args: AddArgs) => R extends Promise<infer U> ? Promise<U> : T;
|
|
195
223
|
/**
|
|
196
224
|
* Remove specified SideEffect instance
|
|
197
225
|
*/
|
|
198
|
-
remove: (
|
|
226
|
+
remove: (instance: T, ...args: RemoveArgs) => RemoveReturn;
|
|
199
227
|
/**
|
|
200
228
|
* Remove all SideEffect instance that meets the specified criteria
|
|
201
229
|
*/
|
|
@@ -208,391 +236,9 @@ interface UseCollectionScopeReturn<isPromise extends boolean, T, AddArgs extends
|
|
|
208
236
|
/**
|
|
209
237
|
* Scope the SideEffects of Cesium-related `Collection` and automatically remove them when unmounted.
|
|
210
238
|
* - note: This is a basic function that is intended to be called by other lower-level function
|
|
211
|
-
* @
|
|
212
|
-
* @param removeFn - Clean SideEffect function. eg.`entities.remove`
|
|
213
|
-
* @param removeScopeArgs - The parameters to pass for `removeScope` triggered when the component is unmounted
|
|
214
|
-
*/
|
|
215
|
-
declare function useCollectionScope<isPromise extends boolean, T = any, AddArgs extends any[] = any[], RemoveArgs extends any[] = any[], RemoveReturn = any>(addFn: (i: T, ...args: AddArgs) => isPromise extends true ? Promise<T> : T, removeFn: (i: T, ...args: RemoveArgs) => RemoveReturn, removeScopeArgs: RemoveArgs): UseCollectionScopeReturn<isPromise, T, AddArgs, RemoveArgs, RemoveReturn>;
|
|
216
|
-
//# sourceMappingURL=index.d.ts.map
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region utils/arrayDiff.d.ts
|
|
219
|
-
interface ArrayDiffRetrun<T> {
|
|
220
|
-
added: T[];
|
|
221
|
-
removed: T[];
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* 计算两个数组的差异,返回新增和删除的元素
|
|
225
|
-
*/
|
|
226
|
-
declare function arrayDiff<T>(list: T[], oldList: T[] | undefined): ArrayDiffRetrun<T>;
|
|
227
|
-
//# sourceMappingURL=arrayDiff.d.ts.map
|
|
228
|
-
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region utils/canvasCoordToCartesian.d.ts
|
|
231
|
-
/**
|
|
232
|
-
* Convert canvas coordinates to Cartesian coordinates
|
|
233
|
-
*
|
|
234
|
-
* @param canvasCoord Canvas coordinates
|
|
235
|
-
* @param scene Cesium.Scene instance
|
|
236
|
-
* @param mode optional values are 'pickPosition' | 'globePick' | 'auto' | 'noHeight' @default 'auto'
|
|
237
|
-
*
|
|
238
|
-
* `pickPosition`: Use scene.pickPosition for conversion, which can be used for picking models, oblique photography, etc.
|
|
239
|
-
* However, if depth detection is not enabled (globe.depthTestAgainstTerrain=false), picking terrain or inaccurate issues may occur
|
|
240
|
-
*
|
|
241
|
-
* `globePick`: Use camera.getPickRay for conversion, which cannot be used for picking models or oblique photography,
|
|
242
|
-
* but can be used for picking terrain. If terrain does not exist, the picked elevation is 0
|
|
243
|
-
*
|
|
244
|
-
* `auto`: Automatically determine which picking content to return
|
|
245
|
-
*
|
|
246
|
-
* Calculation speed comparison: globePick > auto >= pickPosition
|
|
247
|
-
*/
|
|
248
|
-
declare function canvasCoordToCartesian(canvasCoord: Cartesian2, scene: Scene, mode?: 'pickPosition' | 'globePick' | 'auto'): Cartesian3 | undefined;
|
|
249
|
-
//# sourceMappingURL=canvasCoordToCartesian.d.ts.map
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region utils/cartesianToCanvasCoord.d.ts
|
|
252
|
-
/**
|
|
253
|
-
* Convert Cartesian coordinates to canvas coordinates
|
|
254
|
-
*
|
|
255
|
-
* @param position Cartesian coordinates
|
|
256
|
-
* @param scene Cesium.Scene instance
|
|
257
|
-
*/
|
|
258
|
-
declare function cartesianToCanvasCoord(position: Cartesian3, scene: Scene): Cartesian2;
|
|
259
|
-
//# sourceMappingURL=cartesianToCanvasCoord.d.ts.map
|
|
260
|
-
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region utils/cesiumEquals.d.ts
|
|
263
|
-
/**
|
|
264
|
-
* Determines if two Cesium objects are equal.
|
|
265
|
-
*
|
|
266
|
-
* This function not only judges whether the instances are equal,
|
|
267
|
-
* but also judges the equals method in the example.
|
|
268
|
-
*
|
|
269
|
-
* @param left The first Cesium object
|
|
270
|
-
* @param right The second Cesium object
|
|
271
|
-
* @returns Returns true if the two Cesium objects are equal, otherwise false
|
|
272
|
-
*/
|
|
273
|
-
declare function cesiumEquals(left: any, right: any): boolean;
|
|
274
|
-
//# sourceMappingURL=cesiumEquals.d.ts.map
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region utils/types.d.ts
|
|
277
|
-
type Nullable<T> = T | null | undefined;
|
|
278
|
-
type BasicType = number | string | boolean | symbol | bigint | null | undefined;
|
|
279
|
-
type ArgsFn<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
|
|
280
|
-
type AnyFn = (...args: any[]) => any;
|
|
281
|
-
type MaybePromise<T = any> = T | (() => T) | Promise<T> | (() => Promise<T>);
|
|
282
|
-
/**
|
|
283
|
-
* 2D Coordinate System
|
|
284
|
-
*/
|
|
285
|
-
type CoordArray = [longitude: number, latitude: number];
|
|
286
|
-
/**
|
|
287
|
-
* 3D Coordinate System
|
|
288
|
-
*/
|
|
289
|
-
type CoordArray_ALT = [longitude: number, latitude: number, height?: number];
|
|
290
|
-
/**
|
|
291
|
-
* 2D Coordinate System
|
|
292
|
-
*/
|
|
293
|
-
interface CoordObject {
|
|
294
|
-
longitude: number;
|
|
295
|
-
latitude: number;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* 3D Coordinate System
|
|
299
|
-
*/
|
|
300
|
-
interface CoordObject_ALT {
|
|
301
|
-
longitude: number;
|
|
302
|
-
latitude: number;
|
|
303
|
-
height?: number | undefined;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Common Coordinate
|
|
307
|
-
* Can be a Cartesian3 point, a Cartographic point, an array, or an object containing longitude, latitude, and optional height information
|
|
308
|
-
*/
|
|
309
|
-
type CommonCoord = Cartesian3 | Cartographic | CoordArray | CoordArray_ALT | CoordObject | CoordObject_ALT;
|
|
310
|
-
/**
|
|
311
|
-
* Common DataSource
|
|
312
|
-
*/
|
|
313
|
-
type CesiumDataSource = DataSource | CustomDataSource | CzmlDataSource | GeoJsonDataSource | GpxDataSource | KmlDataSource;
|
|
314
|
-
//# sourceMappingURL=types.d.ts.map
|
|
315
|
-
//#endregion
|
|
316
|
-
//#region utils/convertDMS.d.ts
|
|
317
|
-
type DMSCoord = [longitude: string, latitude: string, height?: number];
|
|
318
|
-
/**
|
|
319
|
-
* Convert degrees to DMS (Degrees Minutes Seconds) format string
|
|
320
|
-
*
|
|
321
|
-
* @param degrees The angle value
|
|
322
|
-
* @param precision The number of decimal places to retain for the seconds, defaults to 3
|
|
323
|
-
* @returns A DMS formatted string in the format: degrees° minutes′ seconds″
|
|
324
|
-
*/
|
|
325
|
-
declare function dmsEncode(degrees: number, precision?: number): string;
|
|
326
|
-
/**
|
|
327
|
-
* Decode a DMS (Degrees Minutes Seconds) formatted string to a decimal angle value
|
|
328
|
-
*
|
|
329
|
-
* @param dmsCode DMS formatted string, e.g. "120°30′45″N"
|
|
330
|
-
* @returns The decoded decimal angle value, or 0 if decoding fails
|
|
331
|
-
*/
|
|
332
|
-
declare function dmsDecode(dmsCode: string): number;
|
|
333
|
-
/**
|
|
334
|
-
* Convert latitude and longitude coordinates to degrees-minutes-seconds format
|
|
335
|
-
*
|
|
336
|
-
* @param position The latitude and longitude coordinates
|
|
337
|
-
* @param precision The number of decimal places to retain for 'seconds', default is 3
|
|
338
|
-
* @returns Returns the coordinates in degrees-minutes-seconds format, or undefined if the conversion fails
|
|
339
|
-
*/
|
|
340
|
-
declare function degreesToDms(position: CommonCoord, precision?: number): DMSCoord | undefined;
|
|
341
|
-
/**
|
|
342
|
-
* Convert DMS (Degrees Minutes Seconds) format to decimal degrees for latitude and longitude coordinates
|
|
343
|
-
*
|
|
344
|
-
* @param dms The latitude or longitude coordinate in DMS format
|
|
345
|
-
* @returns Returns the coordinate in decimal degrees format, or undefined if the conversion fails
|
|
346
|
-
*/
|
|
347
|
-
declare function dmsToDegrees(dms: DMSCoord): CoordArray_ALT | undefined;
|
|
348
|
-
//# sourceMappingURL=convertDMS.d.ts.map
|
|
349
|
-
//#endregion
|
|
350
|
-
//#region utils/is.d.ts
|
|
351
|
-
declare function isDef<T = any>(val?: T): val is T;
|
|
352
|
-
declare function isBoolean(val: any): val is boolean;
|
|
353
|
-
declare function isFunction<T extends AnyFn>(val: any): val is T;
|
|
354
|
-
declare function isNumber(val: any): val is number;
|
|
355
|
-
declare function isString(val: unknown): val is string;
|
|
356
|
-
declare function isObject(val: any): val is object;
|
|
357
|
-
declare function isWindow(val: any): val is Window;
|
|
358
|
-
declare function isPromise$1<T extends Promise<any>>(val: any): val is T;
|
|
359
|
-
declare function isElement<T extends Element>(val: any): val is T;
|
|
360
|
-
declare const isArray: (arg: any) => arg is any[];
|
|
361
|
-
declare function isBase64(val: string): boolean;
|
|
362
|
-
declare function assertError(condition: boolean, error: any): void;
|
|
363
|
-
//# sourceMappingURL=is.d.ts.map
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region utils/property.d.ts
|
|
366
|
-
type MaybeProperty<T = any> = T | {
|
|
367
|
-
getValue: (time?: JulianDate) => T;
|
|
368
|
-
};
|
|
369
|
-
type MaybePropertyOrGetter<T = any> = MaybeProperty<T> | (() => T);
|
|
370
|
-
/**
|
|
371
|
-
* Is Cesium.Property
|
|
372
|
-
* @param value - The target object
|
|
373
|
-
*/
|
|
374
|
-
declare function isProperty(value: any): value is Property;
|
|
375
|
-
/**
|
|
376
|
-
* Converts a value that may be a Property into its target value, @see {toProperty} for the reverse operation
|
|
377
|
-
* ```typescript
|
|
378
|
-
* toPropertyValue('val') //=> 'val'
|
|
379
|
-
* toPropertyValue(new ConstantProperty('val')) //=> 'val'
|
|
380
|
-
* toPropertyValue(new CallbackProperty(()=>'val')) //=> 'val'
|
|
381
|
-
* ```
|
|
382
|
-
*
|
|
383
|
-
* @param value - The value to convert
|
|
384
|
-
*/
|
|
385
|
-
declare function toPropertyValue<T = unknown>(value: MaybeProperty<T>, time?: JulianDate): T;
|
|
386
|
-
type PropertyCallback<T = any> = (time: JulianDate, result?: T) => T;
|
|
387
|
-
/**
|
|
388
|
-
* Converts a value that may be a Property into a Property object, @see {toPropertyValue} for the reverse operation
|
|
389
|
-
*
|
|
390
|
-
* @param value - The property value or getter to convert, can be undefined or null
|
|
391
|
-
* @param isConstant - The second parameter for converting to CallbackProperty
|
|
392
|
-
* @returns Returns the converted Property object, if value is undefined or null, returns undefined
|
|
393
|
-
*/
|
|
394
|
-
declare function toProperty<T>(value?: MaybePropertyOrGetter<T>, isConstant?: boolean): Property;
|
|
395
|
-
/**
|
|
396
|
-
* Create a Cesium property key
|
|
397
|
-
*
|
|
398
|
-
* @param scope The host object
|
|
399
|
-
* @param field The property name
|
|
400
|
-
* @param maybeProperty Optional property or getter
|
|
401
|
-
* @param readonly Whether the property is read-only
|
|
402
|
-
*/
|
|
403
|
-
declare function createPropertyField<T>(scope: any, field: string, maybeProperty?: MaybePropertyOrGetter<T>, readonly?: boolean): void;
|
|
404
|
-
interface CreateCesiumAttributeOptions {
|
|
405
|
-
readonly?: boolean;
|
|
406
|
-
toProperty?: boolean;
|
|
407
|
-
/**
|
|
408
|
-
* The event name that triggers the change
|
|
409
|
-
* @default 'definitionChanged'
|
|
410
|
-
*/
|
|
411
|
-
changedEventKey?: string;
|
|
412
|
-
shallowClone?: boolean;
|
|
413
|
-
}
|
|
414
|
-
declare function createCesiumAttribute<Scope extends object>(scope: Scope, key: keyof Scope, value: any, options?: CreateCesiumAttributeOptions): void;
|
|
415
|
-
interface CreateCesiumPropertyOptions {
|
|
416
|
-
readonly?: boolean;
|
|
417
|
-
/**
|
|
418
|
-
* The event name that triggers the change
|
|
419
|
-
* @default 'definitionChanged'
|
|
420
|
-
*/
|
|
421
|
-
changedEventKey?: string;
|
|
422
|
-
}
|
|
423
|
-
declare function createCesiumProperty<Scope extends object>(scope: Scope, key: keyof Scope, value: any, options?: CreateCesiumPropertyOptions): void;
|
|
424
|
-
//# sourceMappingURL=property.d.ts.map
|
|
425
|
-
//#endregion
|
|
426
|
-
//#region utils/isCesiumConstant.d.ts
|
|
427
|
-
/**
|
|
428
|
-
* Determines if the Cesium property is a constant.
|
|
429
|
-
*
|
|
430
|
-
* @param value Cesium property
|
|
431
|
-
*/
|
|
432
|
-
declare function isCesiumConstant(value: MaybeProperty): boolean;
|
|
433
|
-
//# sourceMappingURL=isCesiumConstant.d.ts.map
|
|
434
|
-
//#endregion
|
|
435
|
-
//#region utils/material.d.ts
|
|
436
|
-
/**
|
|
437
|
-
* Cesium.Material.fabric parameters
|
|
438
|
-
*/
|
|
439
|
-
interface CesiumMaterialFabricOptions<U> {
|
|
440
|
-
/**
|
|
441
|
-
* Used to declare what material the fabric object will ultimately generate. If it's an official built-in one, use the official built-in one directly; otherwise, create a custom material and cache it.
|
|
442
|
-
*/
|
|
443
|
-
type: string;
|
|
444
|
-
/**
|
|
445
|
-
* Can nest another level of child fabric to form a composite material
|
|
446
|
-
*/
|
|
447
|
-
materials?: Material;
|
|
448
|
-
/**
|
|
449
|
-
* glsl code
|
|
450
|
-
*/
|
|
451
|
-
source?: string;
|
|
452
|
-
components?: {
|
|
453
|
-
diffuse?: string;
|
|
454
|
-
alpha?: string;
|
|
455
|
-
};
|
|
456
|
-
/**
|
|
457
|
-
* Pass variables to glsl code
|
|
458
|
-
*/
|
|
459
|
-
uniforms?: U & Record<string, any>;
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Cesium.Material parameters
|
|
463
|
-
*/
|
|
464
|
-
interface CesiumMaterialConstructorOptions<U> {
|
|
465
|
-
/**
|
|
466
|
-
* Strict mode
|
|
467
|
-
*/
|
|
468
|
-
strict?: boolean;
|
|
469
|
-
/**
|
|
470
|
-
* translucent
|
|
471
|
-
*/
|
|
472
|
-
translucent?: boolean | ((...params: any[]) => any);
|
|
473
|
-
/**
|
|
474
|
-
* Minification filter
|
|
475
|
-
*/
|
|
476
|
-
minificationFilter?: TextureMinificationFilter;
|
|
477
|
-
/**
|
|
478
|
-
* Magnification filter
|
|
479
|
-
*/
|
|
480
|
-
magnificationFilter?: TextureMagnificationFilter;
|
|
481
|
-
/**
|
|
482
|
-
* Matrix configuration
|
|
483
|
-
*/
|
|
484
|
-
fabric: CesiumMaterialFabricOptions<U>;
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Only as a type fix for `Cesium.Material`
|
|
488
|
-
*/
|
|
489
|
-
declare class CesiumMaterial<U> extends Material {
|
|
490
|
-
constructor(options: CesiumMaterialConstructorOptions<U>);
|
|
491
|
-
/**
|
|
492
|
-
* Matrix configuration
|
|
493
|
-
*/
|
|
494
|
-
fabric: CesiumMaterialFabricOptions<U>;
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* Only as a type fix for `Cesium.MaterialProperty`
|
|
498
|
-
*/
|
|
499
|
-
interface CesiumMaterialProperty<V> extends MaterialProperty {
|
|
500
|
-
get isConstant(): boolean;
|
|
501
|
-
get definitionChanged(): Event<(scope: this, field: string, value: any, previous: any) => void>;
|
|
502
|
-
getType: (time: JulianDate) => string;
|
|
503
|
-
getValue: (time: JulianDate, result?: V) => V;
|
|
504
|
-
equals: (other?: any) => boolean;
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Get material from cache, alias of `Material._materialCache.getMaterial`
|
|
508
|
-
*/
|
|
509
|
-
declare function getMaterialCache<T extends Material = CesiumMaterial<any>>(type: string): T | undefined;
|
|
510
|
-
/**
|
|
511
|
-
* Add material to Cesium's material cache, alias of `Material._materialCache.addMaterial`
|
|
512
|
-
*/
|
|
513
|
-
declare function addMaterialCache(type: string, material: CesiumMaterialConstructorOptions<any>): void;
|
|
514
|
-
//# sourceMappingURL=material.d.ts.map
|
|
515
|
-
//#endregion
|
|
516
|
-
//#region utils/pick.d.ts
|
|
517
|
-
/**
|
|
518
|
-
* Analyze the result of Cesium's `scene.pick` and convert it to an array format
|
|
519
|
-
*/
|
|
520
|
-
declare function resolvePick(pick?: any): any[];
|
|
521
|
-
/**
|
|
522
|
-
* Determine if the given array of graphics is hit by Cesium's `scene.pick`
|
|
523
|
-
*
|
|
524
|
-
* @param pick The `scene.pick` object used for matching
|
|
525
|
-
* @param graphic An array of graphics to check for hits
|
|
526
|
-
*/
|
|
527
|
-
declare function pickHitGraphic(pick: any, graphic: any | any[]): boolean;
|
|
528
|
-
//# sourceMappingURL=pick.d.ts.map
|
|
529
|
-
//#endregion
|
|
530
|
-
//#region utils/throttle.d.ts
|
|
531
|
-
type ThrottleCallback<T extends any[]> = (...rest: T) => void;
|
|
532
|
-
/**
|
|
533
|
-
* Throttle function, which limits the frequency of execution of the function
|
|
534
|
-
*
|
|
535
|
-
* @param callback raw function
|
|
536
|
-
* @param delay Throttled delay duration (ms)
|
|
537
|
-
* @param trailing Trigger callback function after last call @default true
|
|
538
|
-
* @param leading Trigger the callback function immediately on the first call @default false
|
|
539
|
-
* @returns Throttle function
|
|
540
|
-
*/
|
|
541
|
-
declare function throttle<T extends any[]>(callback: ThrottleCallback<T>, delay?: number, trailing?: boolean, leading?: boolean): ThrottleCallback<T>;
|
|
542
|
-
//# sourceMappingURL=throttle.d.ts.map
|
|
543
|
-
//#endregion
|
|
544
|
-
//#region utils/toCartesian3.d.ts
|
|
545
|
-
/**
|
|
546
|
-
* Converts position to a coordinate point in the Cartesian coordinate system
|
|
547
|
-
*
|
|
548
|
-
* @param position Position information, which can be a Cartesian coordinate point (Cartesian3), a geographic coordinate point (Cartographic), an array, or an object containing WGS84 latitude, longitude, and height information
|
|
549
|
-
* @returns The converted Cartesian coordinate point. If the input parameter is invalid, undefined is returned
|
|
550
|
-
*/
|
|
551
|
-
declare function toCartesian3(position?: CommonCoord): Cartesian3 | undefined;
|
|
552
|
-
//# sourceMappingURL=toCartesian3.d.ts.map
|
|
553
|
-
//#endregion
|
|
554
|
-
//#region utils/toCartographic.d.ts
|
|
555
|
-
/**
|
|
556
|
-
* Converts a position to a Cartographic coordinate point
|
|
557
|
-
*
|
|
558
|
-
* @param position Position information, which can be a Cartesian3 coordinate point, a Cartographic coordinate point, an array, or an object containing WGS84 longitude, latitude, and height information
|
|
559
|
-
* @returns The converted Cartographic coordinate point, or undefined if the input parameter is invalid
|
|
560
|
-
*/
|
|
561
|
-
declare function toCartographic(position?: CommonCoord): Cartographic | undefined;
|
|
562
|
-
//# sourceMappingURL=toCartographic.d.ts.map
|
|
563
|
-
//#endregion
|
|
564
|
-
//#region utils/toCoord.d.ts
|
|
565
|
-
interface ToCoordOptions<T extends 'Array' | 'Object', Alt extends boolean> {
|
|
566
|
-
/**
|
|
567
|
-
* Return type
|
|
568
|
-
* @default 'Array'
|
|
569
|
-
*/
|
|
570
|
-
type?: T;
|
|
571
|
-
/**
|
|
572
|
-
* Whether to return altitude information
|
|
573
|
-
*/
|
|
574
|
-
alt?: Alt;
|
|
575
|
-
}
|
|
576
|
-
type ToCoordReturn<T extends 'Array' | 'Object', Alt extends boolean> = T extends 'Array' ? Alt extends true ? CoordArray_ALT : CoordArray : Alt extends true ? CoordObject_ALT : CoordObject;
|
|
577
|
-
/**
|
|
578
|
-
* Converts coordinates to an array or object in the specified format.
|
|
579
|
-
*
|
|
580
|
-
* @param position The coordinate to be converted, which can be a Cartesian3, Cartographic, array, or object.
|
|
581
|
-
* @param options Conversion options, including conversion type and whether to include altitude information.
|
|
582
|
-
* @returns The converted coordinate, which may be an array or object. If the input position is empty, undefined is returned.
|
|
583
|
-
*
|
|
584
|
-
* @template T Conversion type, optional values are 'Array' or 'Object', @default 'Array'.
|
|
585
|
-
* @template Alt Whether to include altitude information, default is false
|
|
239
|
+
* @returns Contains side effect addition and removal functions
|
|
586
240
|
*/
|
|
587
|
-
declare function
|
|
588
|
-
//#endregion
|
|
589
|
-
//#region utils/tryRun.d.ts
|
|
590
|
-
/**
|
|
591
|
-
* Safely execute the provided function without throwing errors,
|
|
592
|
-
* essentially a simple wrapper around a `try...catch...` block
|
|
593
|
-
*/
|
|
594
|
-
declare function tryRun<T extends AnyFn>(fn: T): T;
|
|
595
|
-
//# sourceMappingURL=tryRun.d.ts.map
|
|
241
|
+
declare function useCollectionScope<T, AddArgs extends any[] = any[], RemoveArgs extends any[] = any[], RemoveReturn = any>(options: UseCollectionScopeOptions<T, AddArgs, RemoveArgs, RemoveReturn>): UseCollectionScopeReturn<T, AddArgs, RemoveArgs, RemoveReturn>;
|
|
596
242
|
//#endregion
|
|
597
243
|
//#region useDataSource/index.d.ts
|
|
598
244
|
interface UseDataSourceOptions {
|
|
@@ -620,16 +266,29 @@ interface UseDataSourceOptions {
|
|
|
620
266
|
/**
|
|
621
267
|
* Add `DataSource` to the `DataSourceCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `DataSource`.
|
|
622
268
|
*
|
|
623
|
-
*
|
|
269
|
+
* overload1: Parameter supports passing in a single value.
|
|
270
|
+
*
|
|
271
|
+
* @param dataSource The `DataSource` to added
|
|
272
|
+
* @param options additional options
|
|
273
|
+
*
|
|
274
|
+
* @returns computedRef of the `DataSource`
|
|
275
|
+
*
|
|
276
|
+
* @overload
|
|
624
277
|
*/
|
|
625
278
|
declare function useDataSource<T extends CesiumDataSource = CesiumDataSource>(dataSource?: MaybeRefOrAsyncGetter<T | undefined>, options?: UseDataSourceOptions): ComputedRef<T | undefined>;
|
|
626
279
|
/**
|
|
627
280
|
* Add `DataSource` to the `DataSourceCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `DataSource`.
|
|
628
281
|
*
|
|
629
|
-
*
|
|
282
|
+
* overload1: Parameter supports passing in an array.
|
|
283
|
+
*
|
|
284
|
+
* @param dataSources The list of `DataSource` to added
|
|
285
|
+
* @param options additional options
|
|
286
|
+
*
|
|
287
|
+
* @returns computedRef of the `DataSource`
|
|
288
|
+
*
|
|
289
|
+
* @overload
|
|
630
290
|
*/
|
|
631
291
|
declare function useDataSource<T extends CesiumDataSource = CesiumDataSource>(dataSources?: MaybeRefOrAsyncGetter<T[] | undefined>, options?: UseDataSourceOptions): ComputedRef<T[] | undefined>;
|
|
632
|
-
//# sourceMappingURL=index.d.ts.map
|
|
633
292
|
//#endregion
|
|
634
293
|
//#region useDataSourceScope/index.d.ts
|
|
635
294
|
interface UseDataSourceScopeOptions {
|
|
@@ -637,7 +296,7 @@ interface UseDataSourceScopeOptions {
|
|
|
637
296
|
* The collection of DataSource to be added
|
|
638
297
|
* @default useViewer().value.dataSources
|
|
639
298
|
*/
|
|
640
|
-
collection?: MaybeRefOrGetter<DataSourceCollection>;
|
|
299
|
+
collection?: MaybeRefOrGetter<DataSourceCollection | undefined>;
|
|
641
300
|
/**
|
|
642
301
|
* The second parameter passed to the `remove` function
|
|
643
302
|
*
|
|
@@ -645,34 +304,10 @@ interface UseDataSourceScopeOptions {
|
|
|
645
304
|
*/
|
|
646
305
|
destroyOnRemove?: boolean;
|
|
647
306
|
}
|
|
648
|
-
interface UseDataSourceScopeRetrun {
|
|
649
|
-
/**
|
|
650
|
-
* A `Set` for storing SideEffect instance,
|
|
651
|
-
* which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
|
|
652
|
-
*/
|
|
653
|
-
scope: Readonly<ShallowReactive<Set<CesiumDataSource>>>;
|
|
654
|
-
/**
|
|
655
|
-
* Add SideEffect instance
|
|
656
|
-
*/
|
|
657
|
-
add: <T extends CesiumDataSource>(dataSource: T) => Promise<T>;
|
|
658
|
-
/**
|
|
659
|
-
* Remove specified SideEffect instance
|
|
660
|
-
*/
|
|
661
|
-
remove: (dataSource: CesiumDataSource, destroy?: boolean) => boolean;
|
|
662
|
-
/**
|
|
663
|
-
* Remove all SideEffect instance that meets the specified criteria
|
|
664
|
-
*/
|
|
665
|
-
removeWhere: (predicate: EffcetRemovePredicate<CesiumDataSource>, destroy?: boolean) => void;
|
|
666
|
-
/**
|
|
667
|
-
* Remove all SideEffect instance within current scope
|
|
668
|
-
*/
|
|
669
|
-
removeScope: (destroy?: boolean) => void;
|
|
670
|
-
}
|
|
671
307
|
/**
|
|
672
|
-
*
|
|
308
|
+
* Scope the SideEffects of `DataSourceCollection` operations and automatically remove them when unmounted
|
|
673
309
|
*/
|
|
674
|
-
declare function useDataSourceScope(options?: UseDataSourceScopeOptions):
|
|
675
|
-
//# sourceMappingURL=index.d.ts.map
|
|
310
|
+
declare function useDataSourceScope(options?: UseDataSourceScopeOptions): UseCollectionScopeReturn<CesiumDataSource, any[], any[], any>;
|
|
676
311
|
//#endregion
|
|
677
312
|
//#region useElementOverlay/index.d.ts
|
|
678
313
|
interface UseElementOverlayOptions {
|
|
@@ -727,7 +362,6 @@ interface UseElementOverlayRetrun {
|
|
|
727
362
|
* Cesium HtmlElement Overlay
|
|
728
363
|
*/
|
|
729
364
|
declare function useElementOverlay(target?: MaybeComputedElementRef, position?: MaybeRefOrGetter<CommonCoord | undefined>, options?: UseElementOverlayOptions): UseElementOverlayRetrun;
|
|
730
|
-
//# sourceMappingURL=index.d.ts.map
|
|
731
365
|
//#endregion
|
|
732
366
|
//#region useEntity/index.d.ts
|
|
733
367
|
interface UseEntityOptions {
|
|
@@ -757,8 +391,7 @@ declare function useEntity<T extends Entity = Entity>(entity?: MaybeRefOrAsyncGe
|
|
|
757
391
|
*
|
|
758
392
|
* overLoaded2: Parameter supports passing in an array.
|
|
759
393
|
*/
|
|
760
|
-
declare function useEntity<T extends Entity = Entity>(entities?: MaybeRefOrAsyncGetter<Array<T | undefined
|
|
761
|
-
//# sourceMappingURL=index.d.ts.map
|
|
394
|
+
declare function useEntity<T extends Entity = Entity>(entities?: MaybeRefOrAsyncGetter<Array<T | undefined> | undefined>, options?: UseEntityOptions): ComputedRef<T[] | undefined>;
|
|
762
395
|
//#endregion
|
|
763
396
|
//#region useEntityScope/index.d.ts
|
|
764
397
|
interface UseEntityScopeOptions {
|
|
@@ -766,37 +399,13 @@ interface UseEntityScopeOptions {
|
|
|
766
399
|
* The collection of Entity to be added
|
|
767
400
|
* @default useViewer().value.entities
|
|
768
401
|
*/
|
|
769
|
-
collection?: MaybeRefOrGetter<EntityCollection>;
|
|
770
|
-
}
|
|
771
|
-
interface UseEntityScopeRetrun {
|
|
772
|
-
/**
|
|
773
|
-
* A `Set` for storing SideEffect instance,
|
|
774
|
-
* which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
|
|
775
|
-
*/
|
|
776
|
-
scope: Readonly<ShallowReactive<Set<Entity>>>;
|
|
777
|
-
/**
|
|
778
|
-
* Add SideEffect instance
|
|
779
|
-
*/
|
|
780
|
-
add: <T extends Entity>(entity: T) => T;
|
|
781
|
-
/**
|
|
782
|
-
* Remove specified SideEffect instance
|
|
783
|
-
*/
|
|
784
|
-
remove: (entity: Entity, destroy?: boolean) => boolean;
|
|
785
|
-
/**
|
|
786
|
-
* Remove all SideEffect instance that meets the specified criteria
|
|
787
|
-
*/
|
|
788
|
-
removeWhere: (predicate: EffcetRemovePredicate<Entity>, destroy?: boolean) => void;
|
|
789
|
-
/**
|
|
790
|
-
* Remove all SideEffect instance within current scope
|
|
791
|
-
*/
|
|
792
|
-
removeScope: (destroy?: boolean) => void;
|
|
402
|
+
collection?: MaybeRefOrGetter<EntityCollection | undefined>;
|
|
793
403
|
}
|
|
794
404
|
/**
|
|
795
405
|
* Make `add` and `remove` operations of `EntityCollection` scoped,
|
|
796
406
|
* automatically remove `Entity` instance when component is unmounted.
|
|
797
407
|
*/
|
|
798
|
-
declare function useEntityScope(options?: UseEntityScopeOptions):
|
|
799
|
-
//# sourceMappingURL=index.d.ts.map
|
|
408
|
+
declare function useEntityScope(options?: UseEntityScopeOptions): UseCollectionScopeReturn<Entity, any[], any[], any>;
|
|
800
409
|
//#endregion
|
|
801
410
|
//#region useGraphicEvent/useDrag.d.ts
|
|
802
411
|
/**
|
|
@@ -820,9 +429,6 @@ interface GraphicDragEvent {
|
|
|
820
429
|
*/
|
|
821
430
|
lockCamera: () => void;
|
|
822
431
|
}
|
|
823
|
-
/**
|
|
824
|
-
* Use graphic drag events with ease, and remove listener automatically on unmounted.
|
|
825
|
-
*/
|
|
826
432
|
//#endregion
|
|
827
433
|
//#region useGraphicEvent/useHover.d.ts
|
|
828
434
|
/**
|
|
@@ -842,9 +448,6 @@ interface GraphicHoverEvent {
|
|
|
842
448
|
*/
|
|
843
449
|
hovering: boolean;
|
|
844
450
|
}
|
|
845
|
-
/**
|
|
846
|
-
* Use graphic hover events with ease, and remove listener automatically on unmounted.
|
|
847
|
-
*/
|
|
848
451
|
//#endregion
|
|
849
452
|
//#region useGraphicEvent/usePositioned.d.ts
|
|
850
453
|
type PositionedEventType = 'LEFT_DOWN' | 'LEFT_UP' | 'LEFT_CLICK' | 'LEFT_DOUBLE_CLICK' | 'RIGHT_DOWN' | 'RIGHT_UP' | 'RIGHT_CLICK' | 'MIDDLE_DOWN' | 'MIDDLE_UP' | 'MIDDLE_CLICK';
|
|
@@ -866,7 +469,7 @@ interface GraphicPositionedEvent {
|
|
|
866
469
|
type CesiumGraphic = Entity | any;
|
|
867
470
|
type GraphicEventType = PositionedEventType | 'HOVER' | 'DRAG';
|
|
868
471
|
type GraphicEventListener<T extends GraphicEventType> = T extends 'DRAG' ? (event: GraphicDragEvent) => void : T extends 'HOVER' ? (event: GraphicHoverEvent) => void : (event: GraphicPositionedEvent) => void;
|
|
869
|
-
type
|
|
472
|
+
type removeFn = () => void;
|
|
870
473
|
interface AddGraphicEventOptions {
|
|
871
474
|
/**
|
|
872
475
|
* The cursor style to use when the mouse is over the graphic.
|
|
@@ -886,27 +489,26 @@ interface UseGraphicEventRetrun {
|
|
|
886
489
|
* @param type - The event type, 'all' indicates clearing all events.
|
|
887
490
|
* @param listener - The event listener function.
|
|
888
491
|
*/
|
|
889
|
-
|
|
492
|
+
add: <T extends GraphicEventType>(graphic: CesiumGraphic | 'global', type: T, listener: GraphicEventListener<T>, options?: AddGraphicEventOptions) => removeFn;
|
|
890
493
|
/**
|
|
891
494
|
* Remove a graphic event listener.
|
|
892
495
|
* @param graphic - The graphic object, 'global' indicates the global graphic object.
|
|
893
496
|
* @param type - The event type, 'all' indicates clearing all events.
|
|
894
497
|
* @param listener - The event listener function.
|
|
895
498
|
*/
|
|
896
|
-
|
|
499
|
+
remove: <T extends GraphicEventType>(graphic: CesiumGraphic | 'global', type: T, listener: GraphicEventListener<T>) => void;
|
|
897
500
|
/**
|
|
898
501
|
* Clear graphic event listeners.
|
|
899
502
|
* @param graphic - The graphic object.
|
|
900
503
|
* @param type - The event type, 'all' indicates clearing all events.
|
|
901
504
|
*/
|
|
902
|
-
|
|
505
|
+
clear: (graphic: CesiumGraphic | 'global', type: GraphicEventType | 'all') => void;
|
|
903
506
|
}
|
|
904
507
|
/**
|
|
905
508
|
* Handle graphic event listeners and cursor styles for Cesium graphics.
|
|
906
509
|
* You don't need to overly worry about memory leaks from the function, as it automatically cleans up internally.
|
|
907
510
|
*/
|
|
908
511
|
declare function useGraphicEvent(): UseGraphicEventRetrun;
|
|
909
|
-
//# sourceMappingURL=index.d.ts.map
|
|
910
512
|
//#endregion
|
|
911
513
|
//#region useImageryLayer/index.d.ts
|
|
912
514
|
interface UseImageryLayerOptions {
|
|
@@ -942,8 +544,7 @@ declare function useImageryLayer<T extends ImageryLayer = ImageryLayer>(layer?:
|
|
|
942
544
|
*
|
|
943
545
|
* overLoaded2: Parameter supports passing in an array.
|
|
944
546
|
*/
|
|
945
|
-
declare function useImageryLayer<T extends ImageryLayer = ImageryLayer>(layers?: MaybeRefOrAsyncGetter<Array<T | undefined
|
|
946
|
-
//# sourceMappingURL=index.d.ts.map
|
|
547
|
+
declare function useImageryLayer<T extends ImageryLayer = ImageryLayer>(layers?: MaybeRefOrAsyncGetter<Array<T | undefined> | undefined>, options?: UseImageryLayerOptions): ComputedRef<T[] | undefined>;
|
|
947
548
|
//#endregion
|
|
948
549
|
//#region useImageryLayerScope/index.d.ts
|
|
949
550
|
interface UseImageryLayerScopeOptions {
|
|
@@ -951,7 +552,7 @@ interface UseImageryLayerScopeOptions {
|
|
|
951
552
|
* The collection of ImageryLayer to be added
|
|
952
553
|
* @default useViewer().value.imageryLayers
|
|
953
554
|
*/
|
|
954
|
-
collection?: MaybeRefOrGetter<ImageryLayerCollection>;
|
|
555
|
+
collection?: MaybeRefOrGetter<ImageryLayerCollection | undefined>;
|
|
955
556
|
/**
|
|
956
557
|
* The second parameter passed to the `remove` function
|
|
957
558
|
*
|
|
@@ -959,35 +560,11 @@ interface UseImageryLayerScopeOptions {
|
|
|
959
560
|
*/
|
|
960
561
|
destroyOnRemove?: boolean;
|
|
961
562
|
}
|
|
962
|
-
interface UseImageryLayerScopeRetrun {
|
|
963
|
-
/**
|
|
964
|
-
* A `Set` for storing SideEffect instance,
|
|
965
|
-
* which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
|
|
966
|
-
*/
|
|
967
|
-
scope: Readonly<ShallowReactive<Set<ImageryLayer>>>;
|
|
968
|
-
/**
|
|
969
|
-
* Add SideEffect instance
|
|
970
|
-
*/
|
|
971
|
-
add: <T extends ImageryLayer>(imageryLayer: T) => T;
|
|
972
|
-
/**
|
|
973
|
-
* Remove specified SideEffect instance
|
|
974
|
-
*/
|
|
975
|
-
remove: (imageryLayer: ImageryLayer, destroy?: boolean) => boolean;
|
|
976
|
-
/**
|
|
977
|
-
* Remove all SideEffect instance that meets the specified criteria
|
|
978
|
-
*/
|
|
979
|
-
removeWhere: (predicate: EffcetRemovePredicate<ImageryLayer>, destroy?: boolean) => void;
|
|
980
|
-
/**
|
|
981
|
-
* Remove all SideEffect instance within current scope
|
|
982
|
-
*/
|
|
983
|
-
removeScope: (destroy?: boolean) => void;
|
|
984
|
-
}
|
|
985
563
|
/**
|
|
986
564
|
* Make `add` and `remove` operations of `ImageryLayerCollection` scoped,
|
|
987
565
|
* automatically remove `ImageryLayer` instance when component is unmounted.
|
|
988
566
|
*/
|
|
989
|
-
declare function useImageryLayerScope(options?: UseImageryLayerScopeOptions):
|
|
990
|
-
//# sourceMappingURL=index.d.ts.map
|
|
567
|
+
declare function useImageryLayerScope(options?: UseImageryLayerScopeOptions): UseCollectionScopeReturn<ImageryLayer, any[], any[], any>;
|
|
991
568
|
//#endregion
|
|
992
569
|
//#region usePostProcessStage/index.d.ts
|
|
993
570
|
interface UsePostProcessStageOptions {
|
|
@@ -1017,8 +594,7 @@ declare function usePostProcessStage<T extends PostProcessStage = PostProcessSta
|
|
|
1017
594
|
*
|
|
1018
595
|
* overLoaded2: Parameter supports passing in an array.
|
|
1019
596
|
*/
|
|
1020
|
-
declare function usePostProcessStage<T extends PostProcessStage = PostProcessStage>(stages?: MaybeRefOrAsyncGetter<Array<T | undefined
|
|
1021
|
-
//# sourceMappingURL=index.d.ts.map
|
|
597
|
+
declare function usePostProcessStage<T extends PostProcessStage = PostProcessStage>(stages?: MaybeRefOrAsyncGetter<Array<T | undefined> | undefined>, options?: UsePostProcessStageOptions): ComputedRef<T[] | undefined>;
|
|
1022
598
|
//#endregion
|
|
1023
599
|
//#region usePostProcessStageScope/index.d.ts
|
|
1024
600
|
interface UsePostProcessStageScopeOptions {
|
|
@@ -1026,37 +602,13 @@ interface UsePostProcessStageScopeOptions {
|
|
|
1026
602
|
* The collection of PostProcessStage to be added
|
|
1027
603
|
* @default useViewer().value.postProcessStages
|
|
1028
604
|
*/
|
|
1029
|
-
collection?: MaybeRefOrGetter<PostProcessStageCollection>;
|
|
1030
|
-
}
|
|
1031
|
-
interface UsePostProcessStageScopeRetrun {
|
|
1032
|
-
/**
|
|
1033
|
-
* A `Set` for storing SideEffect instance,
|
|
1034
|
-
* which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
|
|
1035
|
-
*/
|
|
1036
|
-
scope: Readonly<ShallowReactive<Set<PostProcessStage>>>;
|
|
1037
|
-
/**
|
|
1038
|
-
* Add SideEffect instance
|
|
1039
|
-
*/
|
|
1040
|
-
add: <T extends PostProcessStage>(postProcessStage: T) => T;
|
|
1041
|
-
/**
|
|
1042
|
-
* Remove specified SideEffect instance
|
|
1043
|
-
*/
|
|
1044
|
-
remove: (postProcessStage: PostProcessStage, destroy?: boolean) => boolean;
|
|
1045
|
-
/**
|
|
1046
|
-
* Remove all SideEffect instance that meets the specified criteria
|
|
1047
|
-
*/
|
|
1048
|
-
removeWhere: (predicate: EffcetRemovePredicate<PostProcessStage>, destroy?: boolean) => void;
|
|
1049
|
-
/**
|
|
1050
|
-
* Remove all SideEffect instance within current scope
|
|
1051
|
-
*/
|
|
1052
|
-
removeScope: (destroy?: boolean) => void;
|
|
605
|
+
collection?: MaybeRefOrGetter<PostProcessStageCollection | undefined>;
|
|
1053
606
|
}
|
|
1054
607
|
/**
|
|
1055
608
|
* Make `add` and `remove` operations of `PostProcessStageCollection` scoped,
|
|
1056
609
|
* automatically remove `PostProcessStage` instance when component is unmounted.
|
|
1057
610
|
*/
|
|
1058
|
-
declare function usePostProcessStageScope(options?: UsePostProcessStageScopeOptions):
|
|
1059
|
-
//# sourceMappingURL=index.d.ts.map
|
|
611
|
+
declare function usePostProcessStageScope(options?: UsePostProcessStageScopeOptions): UseCollectionScopeReturn<PostProcessStage | PostProcessStageComposite, any[], any[], any>;
|
|
1060
612
|
//#endregion
|
|
1061
613
|
//#region usePrimitive/index.d.ts
|
|
1062
614
|
interface UsePrimitiveOptions {
|
|
@@ -1087,46 +639,28 @@ declare function usePrimitive<T = any>(primitive?: MaybeRefOrAsyncGetter<T | und
|
|
|
1087
639
|
*
|
|
1088
640
|
* overLoaded2: Parameter supports passing in an array.
|
|
1089
641
|
*/
|
|
1090
|
-
declare function usePrimitive<T = any>(primitives?: MaybeRefOrAsyncGetter<Array<T | undefined
|
|
1091
|
-
//# sourceMappingURL=index.d.ts.map
|
|
642
|
+
declare function usePrimitive<T = any>(primitives?: MaybeRefOrAsyncGetter<Array<T | undefined> | undefined>, options?: UsePrimitiveOptions): ComputedRef<T[] | undefined>;
|
|
1092
643
|
//#endregion
|
|
1093
644
|
//#region usePrimitiveScope/index.d.ts
|
|
1094
645
|
interface UsePrimitiveScopeOptions {
|
|
1095
646
|
/**
|
|
1096
|
-
* The collection of Primitive to be added
|
|
647
|
+
* The collection of Primitive to be added,
|
|
648
|
+
* 'ground' alias `useViewer().value.scene.groundPrimitives`
|
|
1097
649
|
* @default useViewer().value.scene.primitives
|
|
1098
650
|
*/
|
|
1099
|
-
collection?: MaybeRefOrGetter<PrimitiveCollection>;
|
|
1100
|
-
}
|
|
1101
|
-
interface UsePrimitiveScopeRetrun {
|
|
1102
|
-
/**
|
|
1103
|
-
* A `Set` for storing SideEffect instance,
|
|
1104
|
-
* which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
|
|
1105
|
-
*/
|
|
1106
|
-
scope: Readonly<ShallowReactive<Set<any>>>;
|
|
1107
|
-
/**
|
|
1108
|
-
* Add SideEffect instance
|
|
1109
|
-
*/
|
|
1110
|
-
add: <T>(primitive: T) => T;
|
|
1111
|
-
/**
|
|
1112
|
-
* Remove specified SideEffect instance
|
|
1113
|
-
*/
|
|
1114
|
-
remove: (primitive: any, destroy?: boolean) => boolean;
|
|
1115
|
-
/**
|
|
1116
|
-
* Remove all SideEffect instance that meets the specified criteria
|
|
1117
|
-
*/
|
|
1118
|
-
removeWhere: (predicate: EffcetRemovePredicate<any>, destroy?: boolean) => void;
|
|
1119
|
-
/**
|
|
1120
|
-
* Remove all SideEffect instance within current scope
|
|
1121
|
-
*/
|
|
1122
|
-
removeScope: (destroy?: boolean) => void;
|
|
651
|
+
collection?: MaybeRefOrGetter<PrimitiveCollection | 'ground' | undefined>;
|
|
1123
652
|
}
|
|
1124
653
|
/**
|
|
1125
654
|
* Make `add` and `remove` operations of `PrimitiveCollection` scoped,
|
|
1126
655
|
* automatically remove `Primitive` instance when component is unmounted.
|
|
1127
656
|
*/
|
|
1128
|
-
declare function usePrimitiveScope(options?: UsePrimitiveScopeOptions):
|
|
1129
|
-
|
|
657
|
+
declare function usePrimitiveScope(options?: UsePrimitiveScopeOptions): {
|
|
658
|
+
scope: Readonly<vue0.ShallowReactive<Set<any>>>;
|
|
659
|
+
add: <R extends any>(instance: R, ...args: any[]) => R extends Promise<infer U> ? Promise<U> : any;
|
|
660
|
+
remove: (instance: any, ...args: any[]) => any;
|
|
661
|
+
removeWhere: (predicate: EffcetRemovePredicate<any>, ...args: any[]) => void;
|
|
662
|
+
removeScope: (...args: any[]) => void;
|
|
663
|
+
};
|
|
1130
664
|
//#endregion
|
|
1131
665
|
//#region useScaleBar/index.d.ts
|
|
1132
666
|
interface UseScaleBarOptions {
|
|
@@ -1164,7 +698,6 @@ interface UseScaleBarRetrun {
|
|
|
1164
698
|
* Reactive generation of scale bars
|
|
1165
699
|
*/
|
|
1166
700
|
declare function useScaleBar(options?: UseScaleBarOptions): UseScaleBarRetrun;
|
|
1167
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1168
701
|
//#endregion
|
|
1169
702
|
//#region useSceneDrillPick/index.d.ts
|
|
1170
703
|
interface UseSceneDrillPickOptions {
|
|
@@ -1200,7 +733,6 @@ interface UseSceneDrillPickOptions {
|
|
|
1200
733
|
* @param windowPosition The screen coordinates of the pick point.
|
|
1201
734
|
*/
|
|
1202
735
|
declare function useSceneDrillPick(windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>, options?: UseSceneDrillPickOptions): ComputedRef<any[] | undefined>;
|
|
1203
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1204
736
|
//#endregion
|
|
1205
737
|
//#region useScenePick/index.d.ts
|
|
1206
738
|
interface UseScenePickOptions {
|
|
@@ -1232,7 +764,6 @@ interface UseScenePickOptions {
|
|
|
1232
764
|
* @param windowPosition The screen coordinates of the pick point.
|
|
1233
765
|
*/
|
|
1234
766
|
declare function useScenePick(windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>, options?: UseScenePickOptions): Readonly<ShallowRef<any | undefined>>;
|
|
1235
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1236
767
|
//#endregion
|
|
1237
768
|
//#region useScreenSpaceEventHandler/index.d.ts
|
|
1238
769
|
type ScreenSpaceEvent<T extends ScreenSpaceEventType> = {
|
|
@@ -1272,7 +803,6 @@ interface UseScreenSpaceEventHandlerOptions {
|
|
|
1272
803
|
* @param inputAction Callback function for listening
|
|
1273
804
|
*/
|
|
1274
805
|
declare function useScreenSpaceEventHandler<T extends ScreenSpaceEventType>(type?: MaybeRefOrGetter<T | undefined>, inputAction?: (event: ScreenSpaceEvent<T>) => any, options?: UseScreenSpaceEventHandlerOptions): WatchStopHandle;
|
|
1275
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1276
806
|
//#endregion
|
|
1277
807
|
//#region useViewer/index.d.ts
|
|
1278
808
|
/**
|
|
@@ -1283,8 +813,6 @@ declare function useScreenSpaceEventHandler<T extends ScreenSpaceEventType>(type
|
|
|
1283
813
|
* - When calling `createViewer` and `useViewer` in the same component, `createViewer` should be called before `useViewer`.
|
|
1284
814
|
*/
|
|
1285
815
|
declare function useViewer(): Readonly<ShallowRef<Viewer | undefined>>;
|
|
1286
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1287
|
-
|
|
1288
816
|
//#endregion
|
|
1289
|
-
export { AddGraphicEventOptions,
|
|
817
|
+
export { AddGraphicEventOptions, CesiumGraphic, EffcetRemovePredicate, GraphicEventListener, GraphicEventType, MaybeAsyncGetter, MaybeRefOrAsyncGetter, OnAsyncGetterCancel, ScreenSpaceEvent, ToPromiseValueOptions, UseCameraStateOptions, UseCameraStateRetrun, UseCesiumEventListenerOptions, UseCesiumFpsOptions, UseCesiumFpsRetrun, UseCollectionScopeOptions, UseCollectionScopeReturn, UseDataSourceOptions, UseDataSourceScopeOptions, UseElementOverlayOptions, UseElementOverlayRetrun, UseEntityOptions, UseEntityScopeOptions, UseGraphicEventRetrun, UseImageryLayerOptions, UseImageryLayerScopeOptions, UsePostProcessStageOptions, UsePostProcessStageScopeOptions, UsePrimitiveOptions, UsePrimitiveScopeOptions, UseScaleBarOptions, UseScaleBarRetrun, UseSceneDrillPickOptions, UseScenePickOptions, UseScreenSpaceEventHandlerOptions, createViewer, removeFn, toPromiseValue, useCameraState, useCesiumEventListener, useCesiumFps, useCollectionScope, useDataSource, useDataSourceScope, useElementOverlay, useEntity, useEntityScope, useGraphicEvent, useImageryLayer, useImageryLayerScope, usePostProcessStage, usePostProcessStageScope, usePrimitive, usePrimitiveScope, useScaleBar, useSceneDrillPick, useScenePick, useScreenSpaceEventHandler, useViewer };
|
|
1290
818
|
//# sourceMappingURL=index.d.cts.map
|