vesium 1.0.1-beta.42 → 1.0.1-beta.45

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
@@ -1,5 +1,1329 @@
1
+ import { Arrayable } from '@vueuse/core';
2
+ import { Camera } from 'cesium';
3
+ import { Cartesian2 } from 'cesium';
4
+ import { Cartesian3 } from 'cesium';
5
+ import { Cartographic } from 'cesium';
6
+ import { ComputedRef } from 'vue';
7
+ import { CustomDataSource } from 'cesium';
8
+ import { CzmlDataSource } from 'cesium';
9
+ import { DataSource } from 'cesium';
10
+ import { DataSourceCollection } from 'cesium';
11
+ import { Entity } from 'cesium';
12
+ import { EntityCollection } from 'cesium';
13
+ import { Event as Event_2 } from 'cesium';
14
+ import { FunctionArgs } from '@vueuse/core';
15
+ import { GeoJsonDataSource } from 'cesium';
16
+ import { GpxDataSource } from 'cesium';
17
+ import { ImageryLayer } from 'cesium';
18
+ import { ImageryLayerCollection } from 'cesium';
19
+ import { JulianDate } from 'cesium';
20
+ import { KeyboardEventModifier } from 'cesium';
21
+ import { KmlDataSource } from 'cesium';
22
+ import { Material } from 'cesium';
23
+ import { MaterialProperty } from 'cesium';
24
+ import { MaybeComputedElementRef } from '@vueuse/core';
25
+ import { MaybeRef } from 'vue';
26
+ import { MaybeRefOrGetter } from 'vue';
27
+ import { PostProcessStage } from 'cesium';
28
+ import { PostProcessStageCollection } from 'cesium';
29
+ import { PrimitiveCollection } from 'cesium';
30
+ import { Property } from 'cesium';
31
+ import { Rectangle } from 'cesium';
32
+ import { Ref } from 'vue';
33
+ import { Scene } from 'cesium';
34
+ import { ScreenSpaceEventHandler } from 'cesium';
35
+ import { ScreenSpaceEventType } from 'cesium';
36
+ import { ShallowReactive } from 'vue';
37
+ import { ShallowRef } from 'vue';
38
+ import { TextureMagnificationFilter } from 'cesium';
39
+ import { TextureMinificationFilter } from 'cesium';
40
+ import { Viewer } from 'cesium';
41
+ import { WatchStopHandle } from 'vue';
1
42
 
2
- export * from "@vesium/core";
3
- export * from "@vesium/shared";
43
+ export declare interface AddGraphicEventOptions {
44
+ /**
45
+ * The cursor style to use when the mouse is over the graphic.
46
+ * @default 'pointer'
47
+ */
48
+ cursor?: Nullable<string> | ((event: GraphicHoverEvent) => Nullable<string>);
49
+ /**
50
+ * The cursor style to use when the mouse is over the graphic during a drag operation.
51
+ * @default 'crosshair'
52
+ */
53
+ dragCursor?: Nullable<string> | ((event: GraphicHoverEvent) => Nullable<string>);
54
+ }
55
+
56
+ /**
57
+ * Add material to Cesium's material cache, alias of `Material._materialCache.addMaterial`
58
+ */
59
+ export declare function addMaterialCache(type: string, material: CesiumMaterialConstructorOptions<any>): void;
60
+
61
+ export declare type AnyFn = (...args: any[]) => any;
62
+
63
+ export declare type ArgsFn<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
64
+
65
+ /**
66
+ * 计算两个数组的差异,返回新增和删除的元素
67
+ */
68
+ export declare function arrayDiff<T>(list: T[], oldList: T[] | undefined): ArrayDiffRetrun<T>;
69
+
70
+ export declare interface ArrayDiffRetrun<T> {
71
+ added: T[];
72
+ removed: T[];
73
+ }
74
+
75
+ export declare function assertError(condition: boolean, error: any): void;
76
+
77
+ export declare type BasicType = number | string | boolean | symbol | bigint | null | undefined;
78
+
79
+ /**
80
+ * Convert canvas coordinates to Cartesian coordinates
81
+ *
82
+ * @param canvasCoord Canvas coordinates
83
+ * @param scene Cesium.Scene instance
84
+ * @param mode optional values are 'pickPosition' | 'globePick' | 'auto' | 'noHeight' @default 'auto'
85
+ *
86
+ * `pickPosition`: Use scene.pickPosition for conversion, which can be used for picking models, oblique photography, etc.
87
+ * However, if depth detection is not enabled (globe.depthTestAgainstTerrain=false), picking terrain or inaccurate issues may occur
88
+ *
89
+ * `globePick`: Use camera.getPickRay for conversion, which cannot be used for picking models or oblique photography,
90
+ * but can be used for picking terrain. If terrain does not exist, the picked elevation is 0
91
+ *
92
+ * `auto`: Automatically determine which picking content to return
93
+ *
94
+ * Calculation speed comparison: globePick > auto >= pickPosition
95
+ */
96
+ export declare function canvasCoordToCartesian(canvasCoord: Cartesian2, scene: Scene, mode?: 'pickPosition' | 'globePick' | 'auto'): Cartesian3 | undefined;
97
+
98
+ /**
99
+ * Convert Cartesian coordinates to canvas coordinates
100
+ *
101
+ * @param position Cartesian coordinates
102
+ * @param scene Cesium.Scene instance
103
+ */
104
+ export declare function cartesianToCanvasCoord(position: Cartesian3, scene: Scene): Cartesian2;
105
+
106
+ /**
107
+ * Common DataSource
108
+ */
109
+ export declare type CesiumDataSource = DataSource | CustomDataSource | CzmlDataSource | GeoJsonDataSource | GpxDataSource | KmlDataSource;
110
+
111
+ /**
112
+ * Determines if two Cesium objects are equal.
113
+ *
114
+ * This function not only judges whether the instances are equal,
115
+ * but also judges the equals method in the example.
116
+ *
117
+ * @param left The first Cesium object
118
+ * @param right The second Cesium object
119
+ * @returns Returns true if the two Cesium objects are equal, otherwise false
120
+ */
121
+ export declare function cesiumEquals(left: any, right: any): boolean;
122
+
123
+ export declare type CesiumGraphic = Entity | any;
124
+
125
+ /**
126
+ * Only as a type fix for `Cesium.Material`
127
+ */
128
+ export declare class CesiumMaterial<U> extends Material {
129
+ constructor(options: CesiumMaterialConstructorOptions<U>);
130
+ /**
131
+ * Matrix configuration
132
+ */
133
+ fabric: CesiumMaterialFabricOptions<U>;
134
+ }
135
+
136
+ /**
137
+ * Cesium.Material parameters
138
+ */
139
+ export declare interface CesiumMaterialConstructorOptions<U> {
140
+ /**
141
+ * Strict mode
142
+ */
143
+ strict?: boolean;
144
+ /**
145
+ * translucent
146
+ */
147
+ translucent?: boolean | ((...params: any[]) => any);
148
+ /**
149
+ * Minification filter
150
+ */
151
+ minificationFilter?: TextureMinificationFilter;
152
+ /**
153
+ * Magnification filter
154
+ */
155
+ magnificationFilter?: TextureMagnificationFilter;
156
+ /**
157
+ * Matrix configuration
158
+ */
159
+ fabric: CesiumMaterialFabricOptions<U>;
160
+ }
161
+
162
+ /**
163
+ * Cesium.Material.fabric parameters
164
+ */
165
+ export declare interface CesiumMaterialFabricOptions<U> {
166
+ /**
167
+ * 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.
168
+ */
169
+ type: string;
170
+ /**
171
+ * Can nest another level of child fabric to form a composite material
172
+ */
173
+ materials?: Material;
174
+ /**
175
+ * glsl code
176
+ */
177
+ source?: string;
178
+ components?: {
179
+ diffuse?: string;
180
+ alpha?: string;
181
+ };
182
+ /**
183
+ * Pass variables to glsl code
184
+ */
185
+ uniforms?: U & Record<string, any>;
186
+ }
187
+
188
+ /**
189
+ * Only as a type fix for `Cesium.MaterialProperty`
190
+ */
191
+ export declare interface CesiumMaterialProperty<V> extends MaterialProperty {
192
+ get isConstant(): boolean;
193
+ get definitionChanged(): Event_2<(scope: this, field: string, value: any, previous: any) => void>;
194
+ getType: (time: JulianDate) => string;
195
+ getValue: (time: JulianDate, result?: V) => V;
196
+ equals: (other?: any) => boolean;
197
+ }
198
+
199
+ /**
200
+ * Common Coordinate
201
+ * Can be a Cartesian3 point, a Cartographic point, an array, or an object containing longitude, latitude, and optional height information
202
+ */
203
+ export declare type CommonCoord = Cartesian3 | Cartographic | CoordArray | CoordArray_ALT | CoordObject | CoordObject_ALT;
204
+
205
+ /**
206
+ * 2D Coordinate System
207
+ */
208
+ export declare type CoordArray = [longitude: number, latitude: number];
209
+
210
+ /**
211
+ * 3D Coordinate System
212
+ */
213
+ export declare type CoordArray_ALT = [longitude: number, latitude: number, height?: number];
214
+
215
+ /**
216
+ * 2D Coordinate System
217
+ */
218
+ export declare interface CoordObject {
219
+ longitude: number;
220
+ latitude: number;
221
+ }
222
+
223
+ /**
224
+ * 3D Coordinate System
225
+ */
226
+ export declare interface CoordObject_ALT {
227
+ longitude: number;
228
+ latitude: number;
229
+ height?: number | undefined;
230
+ }
231
+
232
+ export declare function createCesiumAttribute<Scope extends object>(scope: Scope, key: keyof Scope, value: any, options?: CreateCesiumAttributeOptions): void;
233
+
234
+ export declare interface CreateCesiumAttributeOptions {
235
+ readonly?: boolean;
236
+ toProperty?: boolean;
237
+ /**
238
+ * The event name that triggers the change
239
+ * @default 'definitionChanged'
240
+ */
241
+ changedEventKey?: string;
242
+ shallowClone?: boolean;
243
+ }
244
+
245
+ export declare function createCesiumProperty<Scope extends object>(scope: Scope, key: keyof Scope, value: any, options?: CreateCesiumPropertyOptions): void;
246
+
247
+ export declare interface CreateCesiumPropertyOptions {
248
+ readonly?: boolean;
249
+ /**
250
+ * The event name that triggers the change
251
+ * @default 'definitionChanged'
252
+ */
253
+ changedEventKey?: string;
254
+ }
255
+
256
+ /**
257
+ * Create a Cesium property key
258
+ *
259
+ * @param scope The host object
260
+ * @param field The property name
261
+ * @param maybeProperty Optional property or getter
262
+ * @param readonly Whether the property is read-only
263
+ */
264
+ export declare function createPropertyField<T>(scope: any, field: string, maybeProperty?: MaybePropertyOrGetter<T>, readonly?: boolean): void;
265
+
266
+ /**
267
+ * Pass in an existing Viewer instance,
268
+ * which can be accessed by the current component and its descendant components using {@link useViewer}
269
+ *
270
+ * When the Viewer instance referenced by this overloaded function becomes invalid, it will not trigger destruction.
271
+ */
272
+ export declare function createViewer(viewer: MaybeRefOrGetter<Viewer | undefined>): Readonly<ShallowRef<Viewer | undefined>>;
273
+
274
+ /**
275
+ * Initialize a Viewer instance, which can be accessed by the
276
+ * current component and its descendant components using {@link useViewer}.
277
+ *
278
+ * The Viewer instance created by this overloaded function will automatically be destroyed when it becomes invalid.
279
+ *
280
+ * @param element - The DOM element or ID that will contain the widget
281
+ * @param options - @see {Viewer.ConstructorOptions}
282
+ */
283
+ export declare function createViewer(element?: MaybeComputedElementRef, options?: Viewer.ConstructorOptions): Readonly<ShallowRef<Viewer | undefined>>;
284
+
285
+ /**
286
+ * Convert latitude and longitude coordinates to degrees-minutes-seconds format
287
+ *
288
+ * @param position The latitude and longitude coordinates
289
+ * @param precision The number of decimal places to retain for 'seconds', default is 3
290
+ * @returns Returns the coordinates in degrees-minutes-seconds format, or undefined if the conversion fails
291
+ */
292
+ export declare function degreesToDms(position: CommonCoord, precision?: number): DMSCoord | undefined;
293
+
294
+ export declare type DMSCoord = [longitude: string, latitude: string, height?: number];
295
+
296
+ /**
297
+ * Decode a DMS (Degrees Minutes Seconds) formatted string to a decimal angle value
298
+ *
299
+ * @param dmsCode DMS formatted string, e.g. "120°30′45″N"
300
+ * @returns The decoded decimal angle value, or 0 if decoding fails
301
+ */
302
+ export declare function dmsDecode(dmsCode: string): number;
303
+
304
+ /**
305
+ * Convert degrees to DMS (Degrees Minutes Seconds) format string
306
+ *
307
+ * @param degrees The angle value
308
+ * @param precision The number of decimal places to retain for the seconds, defaults to 3
309
+ * @returns A DMS formatted string in the format: degrees° minutes′ seconds″
310
+ */
311
+ export declare function dmsEncode(degrees: number, precision?: number): string;
312
+
313
+ /**
314
+ * Convert DMS (Degrees Minutes Seconds) format to decimal degrees for latitude and longitude coordinates
315
+ *
316
+ * @param dms The latitude or longitude coordinate in DMS format
317
+ * @returns Returns the coordinate in decimal degrees format, or undefined if the conversion fails
318
+ */
319
+ export declare function dmsToDegrees(dms: DMSCoord): CoordArray_ALT | undefined;
320
+
321
+ export declare type EffcetRemovePredicate<T> = (instance: T) => boolean;
322
+
323
+ /**
324
+ * Get material from cache, alias of `Material._materialCache.getMaterial`
325
+ */
326
+ export declare function getMaterialCache<T extends Material = CesiumMaterial<any>>(type: string): T | undefined;
327
+
328
+ /**
329
+ * Parameters for graphic drag events
330
+ */
331
+ declare interface GraphicDragEvent {
332
+ /**
333
+ * Event of the motion event
334
+ */
335
+ event: ScreenSpaceEventHandler.MotionEvent;
336
+ /**
337
+ * The graphic object picked by `scene.pick`
338
+ */
339
+ pick: any;
340
+ /**
341
+ * Whether the graphic is currently being dragged.
342
+ */
343
+ dragging: boolean;
344
+ /**
345
+ * Whether to lock the camera, Will automatically resume when you end dragging.
346
+ */
347
+ lockCamera: () => void;
348
+ }
349
+
350
+ export declare type GraphicEventListener<T extends GraphicEventType> = T extends 'DRAG' ? (event: GraphicDragEvent) => void : T extends 'HOVER' ? (event: GraphicHoverEvent) => void : (event: GraphicPositionedEvent) => void;
351
+
352
+ export declare type GraphicEventType = PositionedEventType | 'HOVER' | 'DRAG';
353
+
354
+ /**
355
+ * Parameters for graphic hover events
356
+ */
357
+ declare interface GraphicHoverEvent {
358
+ /**
359
+ * Event of the motion event
360
+ */
361
+ event: ScreenSpaceEventHandler.MotionEvent;
362
+ /**
363
+ * The graphic object picked by `scene.pick`
364
+ */
365
+ pick: any;
366
+ /**
367
+ * Whether the graphic is currently being hoverged. Returns `true` continuously while hoverging, and `false` once it ends.
368
+ */
369
+ hovering: boolean;
370
+ }
371
+
372
+ /**
373
+ * Parameters for graphics click related events
374
+ */
375
+ declare interface GraphicPositionedEvent {
376
+ /**
377
+ * Event of the picked area
378
+ */
379
+ event: ScreenSpaceEventHandler.PositionedEvent;
380
+ /**
381
+ * The graphic object picked by `scene.pick`
382
+ */
383
+ pick: any;
384
+ }
385
+
386
+ export declare const isArray: (arg: any) => arg is any[];
387
+
388
+ export declare function isBase64(val: string): boolean;
389
+
390
+ export declare function isBoolean(val: any): val is boolean;
391
+
392
+ /**
393
+ * Determines if the Cesium property is a constant.
394
+ *
395
+ * @param value Cesium property
396
+ */
397
+ export declare function isCesiumConstant(value: MaybeProperty): boolean;
398
+
399
+ export declare function isDef<T = any>(val?: T): val is T;
400
+
401
+ export declare function isElement<T extends Element>(val: any): val is T;
402
+
403
+ export declare function isFunction<T extends AnyFn>(val: any): val is T;
404
+
405
+ export declare function isNumber(val: any): val is number;
406
+
407
+ export declare function isObject(val: any): val is object;
408
+
409
+ export declare function isPromise<T extends Promise<any>>(val: any): val is T;
410
+
411
+ /**
412
+ * Is Cesium.Property
413
+ * @param value - The target object
414
+ */
415
+ export declare function isProperty(value: any): value is Property;
416
+
417
+ export declare function isString(val: unknown): val is string;
418
+
419
+ export declare function isWindow(val: any): val is Window;
420
+
421
+ export declare type MaybeAsyncGetter<T> = () => (Promise<T> | T);
422
+
423
+ export declare type MaybePromise<T = any> = T | (() => T) | Promise<T> | (() => Promise<T>);
424
+
425
+ export declare type MaybeProperty<T = any> = T | {
426
+ getValue: (time?: JulianDate) => T;
427
+ };
428
+
429
+ export declare type MaybePropertyOrGetter<T = any> = MaybeProperty<T> | (() => T);
430
+
431
+ export declare type MaybeRefOrAsyncGetter<T> = MaybeRef<T> | MaybeAsyncGetter<T>;
432
+
433
+ export declare type Nullable<T> = T | null | undefined;
434
+
435
+ export declare type OnAsyncGetterCancel = (onCancel: () => void) => void;
436
+
437
+ /**
438
+ * Determine if the given array of graphics is hit by Cesium's `scene.pick`
439
+ *
440
+ * @param pick The `scene.pick` object used for matching
441
+ * @param graphic An array of graphics to check for hits
442
+ */
443
+ export declare function pickHitGraphic(pick: any, graphic: any | any[]): boolean;
444
+
445
+ declare type PositionedEventType = 'LEFT_DOWN' | 'LEFT_UP' | 'LEFT_CLICK' | 'LEFT_DOUBLE_CLICK' | 'RIGHT_DOWN' | 'RIGHT_UP' | 'RIGHT_CLICK' | 'MIDDLE_DOWN' | 'MIDDLE_UP' | 'MIDDLE_CLICK';
446
+
447
+ export declare type PropertyCallback<T = any> = (time: JulianDate, result?: T) => T;
448
+
449
+ export declare type RemoveGraphicEventFn = () => void;
450
+
451
+ /**
452
+ * Analyze the result of Cesium's `scene.pick` and convert it to an array format
453
+ */
454
+ export declare function resolvePick(pick?: any): any[];
455
+
456
+ export declare type ScreenSpaceEvent<T extends ScreenSpaceEventType> = {
457
+ [ScreenSpaceEventType.LEFT_DOWN]: ScreenSpaceEventHandler.PositionedEvent;
458
+ [ScreenSpaceEventType.LEFT_UP]: ScreenSpaceEventHandler.PositionedEvent;
459
+ [ScreenSpaceEventType.LEFT_CLICK]: ScreenSpaceEventHandler.PositionedEvent;
460
+ [ScreenSpaceEventType.LEFT_DOUBLE_CLICK]: ScreenSpaceEventHandler.PositionedEvent;
461
+ [ScreenSpaceEventType.RIGHT_DOWN]: ScreenSpaceEventHandler.PositionedEvent;
462
+ [ScreenSpaceEventType.RIGHT_UP]: ScreenSpaceEventHandler.PositionedEvent;
463
+ [ScreenSpaceEventType.RIGHT_CLICK]: ScreenSpaceEventHandler.PositionedEvent;
464
+ [ScreenSpaceEventType.MIDDLE_DOWN]: ScreenSpaceEventHandler.PositionedEvent;
465
+ [ScreenSpaceEventType.MIDDLE_UP]: ScreenSpaceEventHandler.PositionedEvent;
466
+ [ScreenSpaceEventType.MIDDLE_CLICK]: ScreenSpaceEventHandler.PositionedEvent;
467
+ [ScreenSpaceEventType.MOUSE_MOVE]: ScreenSpaceEventHandler.MotionEvent;
468
+ [ScreenSpaceEventType.WHEEL]: number;
469
+ [ScreenSpaceEventType.PINCH_START]: ScreenSpaceEventHandler.TwoPointEvent;
470
+ [ScreenSpaceEventType.PINCH_END]: ScreenSpaceEventHandler.TwoPointEvent;
471
+ [ScreenSpaceEventType.PINCH_MOVE]: ScreenSpaceEventHandler.TwoPointMotionEvent;
472
+ }[T];
473
+
474
+ /**
475
+ * Throttle function, which limits the frequency of execution of the function
476
+ *
477
+ * @param callback raw function
478
+ * @param delay Throttled delay duration (ms)
479
+ * @param trailing Trigger callback function after last call @default true
480
+ * @param leading Trigger the callback function immediately on the first call @default false
481
+ * @returns Throttle function
482
+ */
483
+ export declare function throttle<T extends any[]>(callback: ThrottleCallback<T>, delay?: number, trailing?: boolean, leading?: boolean): ThrottleCallback<T>;
484
+
485
+ export declare type ThrottleCallback<T extends any[]> = (...rest: T) => void;
486
+
487
+ /**
488
+ * Converts position to a coordinate point in the Cartesian coordinate system
489
+ *
490
+ * @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
491
+ * @returns The converted Cartesian coordinate point. If the input parameter is invalid, undefined is returned
492
+ */
493
+ export declare function toCartesian3(position?: CommonCoord): Cartesian3 | undefined;
494
+
495
+ /**
496
+ * Converts a position to a Cartographic coordinate point
497
+ *
498
+ * @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
499
+ * @returns The converted Cartographic coordinate point, or undefined if the input parameter is invalid
500
+ */
501
+ export declare function toCartographic(position?: CommonCoord): Cartographic | undefined;
502
+
503
+ /**
504
+ * Converts coordinates to an array or object in the specified format.
505
+ *
506
+ * @param position The coordinate to be converted, which can be a Cartesian3, Cartographic, array, or object.
507
+ * @param options Conversion options, including conversion type and whether to include altitude information.
508
+ * @returns The converted coordinate, which may be an array or object. If the input position is empty, undefined is returned.
509
+ *
510
+ * @template T Conversion type, optional values are 'Array' or 'Object', @default 'Array'.
511
+ * @template Alt Whether to include altitude information, default is false
512
+ */
513
+ export declare function toCoord<T extends 'Array' | 'Object' = 'Array', Alt extends boolean = false>(position?: CommonCoord, options?: ToCoordOptions<T, Alt>): ToCoordReturn<T, Alt> | undefined;
514
+
515
+ declare interface ToCoordOptions<T extends 'Array' | 'Object', Alt extends boolean> {
516
+ /**
517
+ * Return type
518
+ * @default 'Array'
519
+ */
520
+ type?: T;
521
+ /**
522
+ * Whether to return altitude information
523
+ */
524
+ alt?: Alt;
525
+ }
526
+
527
+ export declare type ToCoordReturn<T extends 'Array' | 'Object', Alt extends boolean> = T extends 'Array' ? Alt extends true ? CoordArray_ALT : CoordArray : Alt extends true ? CoordObject_ALT : CoordObject;
528
+
529
+ /**
530
+ * Similar to Vue's built-in `toValue`, but capable of handling asynchronous functions, thus returning a `await value`.
531
+ *
532
+ * Used in conjunction with VueUse's `computedAsync`.
533
+ *
534
+ * @param source The source value, which can be a reactive reference or an asynchronous getter.
535
+ * @param options Conversion options
536
+ *
537
+ * @example
538
+ * ```ts
539
+ *
540
+ * const data = computedAsync(async ()=> {
541
+ * return await toPromiseValue(promiseRef)
542
+ * })
543
+ *
544
+ * ```
545
+ */
546
+ export declare function toPromiseValue<T>(source: MaybeRefOrAsyncGetter<T>, options?: ToPromiseValueOptions): Promise<T>;
547
+
548
+ export declare interface ToPromiseValueOptions {
549
+ /**
550
+ * Determines whether the source should be unwrapped to its raw value.
551
+ * @default true
552
+ */
553
+ raw?: boolean;
554
+ }
555
+
556
+ /**
557
+ * Converts a value that may be a Property into a Property object, @see {toPropertyValue} for the reverse operation
558
+ *
559
+ * @param value - The property value or getter to convert, can be undefined or null
560
+ * @param isConstant - The second parameter for converting to CallbackProperty
561
+ * @returns Returns the converted Property object, if value is undefined or null, returns undefined
562
+ */
563
+ export declare function toProperty<T>(value?: MaybePropertyOrGetter<T>, isConstant?: boolean): Property;
564
+
565
+ /**
566
+ * Converts a value that may be a Property into its target value, @see {toProperty} for the reverse operation
567
+ * ```typescript
568
+ * toPropertyValue('val') //=> 'val'
569
+ * toPropertyValue(new ConstantProperty('val')) //=> 'val'
570
+ * toPropertyValue(new CallbackProperty(()=>'val')) //=> 'val'
571
+ * ```
572
+ *
573
+ * @param value - The value to convert
574
+ */
575
+ export declare function toPropertyValue<T = unknown>(value: MaybeProperty<T>, time?: JulianDate): T;
576
+
577
+ /**
578
+ * Safely execute the provided function without throwing errors,
579
+ * essentially a simple wrapper around a `try...catch...` block
580
+ */
581
+ export declare function tryRun<T extends AnyFn>(fn: T): T;
582
+
583
+ /**
584
+ * Reactive Cesium Camera state
585
+ */
586
+ export declare function useCameraState(options?: UseCameraStateOptions): UseCameraStateRetrun;
587
+
588
+ export declare interface UseCameraStateOptions {
589
+ /**
590
+ * The camera to use
591
+ * @default useViewer().value.scene.camera
592
+ */
593
+ camera?: MaybeRefOrGetter<Camera | undefined>;
594
+ /**
595
+ * Camera event type to watch
596
+ * @default `changed`
597
+ */
598
+ event?: MaybeRefOrGetter<'changed' | 'moveStart' | 'moveEnd'>;
599
+ /**
600
+ * Throttled delay duration (ms)
601
+ * @default 8
602
+ */
603
+ delay?: number;
604
+ }
605
+
606
+ export declare interface UseCameraStateRetrun {
607
+ camera: ComputedRef<Camera | undefined>;
608
+ /**
609
+ * The position of the camera.
610
+ */
611
+ position: ComputedRef<Cartesian3 | undefined>;
612
+ /**
613
+ * The view direction of the camera.
614
+ */
615
+ direction: ComputedRef<Cartesian3 | undefined>;
616
+ /**
617
+ * The up direction of the camera.
618
+ */
619
+ up: ComputedRef<Cartesian3 | undefined>;
620
+ /**
621
+ * The right direction of the camera.
622
+ */
623
+ right: ComputedRef<Cartesian3 | undefined>;
624
+ /**
625
+ * Gets the {@link Cartographic} position of the camera, with longitude and latitude
626
+ * expressed in radians and height in meters. In 2D and Columbus View, it is possible
627
+ * for the returned longitude and latitude to be outside the range of valid longitudes
628
+ * and latitudes when the camera is outside the map.
629
+ */
630
+ positionCartographic: ComputedRef<Cartographic | undefined>;
631
+ /**
632
+ * Gets the position of the camera in world coordinates.
633
+ */
634
+ positionWC: ComputedRef<Cartesian3 | undefined>;
635
+ /**
636
+ * Gets the view direction of the camera in world coordinates.
637
+ */
638
+ directionWC: ComputedRef<Cartesian3 | undefined>;
639
+ /**
640
+ * Gets the up direction of the camera in world coordinates.
641
+ */
642
+ upWC: ComputedRef<Cartesian3 | undefined>;
643
+ /**
644
+ * Gets the right direction of the camera in world coordinates.
645
+ */
646
+ rightWC: ComputedRef<Cartesian3 | undefined>;
647
+ /**
648
+ * Computes the approximate visible rectangle on the ellipsoid.
649
+ */
650
+ viewRectangle: ComputedRef<Rectangle | undefined>;
651
+ /**
652
+ * Gets the camera heading in radians.
653
+ */
654
+ heading: ComputedRef<number | undefined>;
655
+ /**
656
+ * Gets the camera pitch in radians.
657
+ */
658
+ pitch: ComputedRef<number | undefined>;
659
+ /**
660
+ * Gets the camera roll in radians.
661
+ */
662
+ roll: ComputedRef<number | undefined>;
663
+ /**
664
+ * Gets the camera center hierarchy level
665
+ */
666
+ level: ComputedRef<number | undefined>;
667
+ }
668
+
669
+ /**
670
+ * Easily use the `addEventListener` in `Cesium.Event` instances,
671
+ * when the dependent data changes or the component is unmounted,
672
+ * the listener function will automatically reload or destroy.
673
+ */
674
+ export declare function useCesiumEventListener<FN extends FunctionArgs<any[]>>(event: Arrayable<Event_2<FN> | undefined> | Arrayable<MaybeRefOrGetter<Event_2<FN> | undefined>> | MaybeRefOrGetter<Arrayable<Event_2<FN> | undefined>>, listener: FN, options?: UseCesiumEventListenerOptions): WatchStopHandle;
675
+
676
+ export declare interface UseCesiumEventListenerOptions {
677
+ /**
678
+ * Whether to active the event listener.
679
+ * @default true
680
+ */
681
+ isActive?: MaybeRefOrGetter<boolean>;
682
+ }
683
+
684
+ /**
685
+ * Reactive get the frame rate of Cesium
686
+ */
687
+ export declare function useCesiumFps(options?: UseCesiumFpsOptions): UseCesiumFpsRetrun;
688
+
689
+ export declare interface UseCesiumFpsOptions {
690
+ /**
691
+ * Throttled sampling (ms)
692
+ * @default 100
693
+ */
694
+ delay?: number;
695
+ }
696
+
697
+ export declare interface UseCesiumFpsRetrun {
698
+ /**
699
+ * Inter-frame Interval (ms)
700
+ */
701
+ interval: Readonly<Ref<number>>;
702
+ /**
703
+ * Frames Per Second
704
+ */
705
+ fps: Readonly<Ref<number>>;
706
+ }
707
+
708
+ /**
709
+ * Scope the SideEffects of Cesium-related `Collection` and automatically remove them when unmounted.
710
+ * - note: This is a basic function that is intended to be called by other lower-level function
711
+ * @param addFn - add SideEffect function. eg.`entites.add`
712
+ * @param removeFn - Clean SideEffect function. eg.`entities.remove`
713
+ * @param removeScopeArgs - The parameters to pass for `removeScope` triggered when the component is unmounted
714
+ */
715
+ export 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>;
716
+
717
+ export declare interface UseCollectionScopeReturn<isPromise extends boolean, T, AddArgs extends any[], RemoveArgs extends any[], RemoveReturn = any> {
718
+ /**
719
+ * A `Set` for storing SideEffect instance,
720
+ * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
721
+ */
722
+ scope: Readonly<ShallowReactive<Set<T>>>;
723
+ /**
724
+ * Add SideEffect instance
725
+ */
726
+ add: (i: T, ...args: AddArgs) => isPromise extends true ? Promise<T> : T;
727
+ /**
728
+ * Remove specified SideEffect instance
729
+ */
730
+ remove: (i: T, ...args: RemoveArgs) => RemoveReturn;
731
+ /**
732
+ * Remove all SideEffect instance that meets the specified criteria
733
+ */
734
+ removeWhere: (predicate: EffcetRemovePredicate<T>, ...args: RemoveArgs) => void;
735
+ /**
736
+ * Remove all SideEffect instance within current scope
737
+ */
738
+ removeScope: (...args: RemoveArgs) => void;
739
+ }
740
+
741
+ /**
742
+ * Add `DataSource` to the `DataSourceCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `DataSource`.
743
+ *
744
+ * overLoaded1: Parameter supports passing in a single value.
745
+ */
746
+ export declare function useDataSource<T extends CesiumDataSource = CesiumDataSource>(dataSource?: MaybeRefOrAsyncGetter<T | undefined>, options?: UseDataSourceOptions): ComputedRef<T | undefined>;
747
+
748
+ /**
749
+ * Add `DataSource` to the `DataSourceCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `DataSource`.
750
+ *
751
+ * overLoaded2: Parameter supports passing in an array.
752
+ */
753
+ export declare function useDataSource<T extends CesiumDataSource = CesiumDataSource>(dataSources?: MaybeRefOrAsyncGetter<T[] | undefined>, options?: UseDataSourceOptions): ComputedRef<T[] | undefined>;
754
+
755
+ export declare interface UseDataSourceOptions {
756
+ /**
757
+ * The collection of DataSource to be added
758
+ * @default useViewer().value.dataSources
759
+ */
760
+ collection?: DataSourceCollection;
761
+ /**
762
+ * default value of `isActive`
763
+ * @default true
764
+ */
765
+ isActive?: MaybeRefOrGetter<boolean>;
766
+ /**
767
+ * Ref passed to receive the updated of async evaluation
768
+ */
769
+ evaluating?: Ref<boolean>;
770
+ /**
771
+ * The second parameter passed to the `remove` function
772
+ *
773
+ * `dataSources.remove(dataSource,destroyOnRemove)`
774
+ */
775
+ destroyOnRemove?: MaybeRefOrGetter<boolean>;
776
+ }
777
+
778
+ /**
779
+ * // Scope the SideEffects of `DataSourceCollection` operations and automatically remove them when unmounted
780
+ */
781
+ export declare function useDataSourceScope(options?: UseDataSourceScopeOptions): UseDataSourceScopeRetrun;
782
+
783
+ export declare interface UseDataSourceScopeOptions {
784
+ /**
785
+ * The collection of DataSource to be added
786
+ * @default useViewer().value.dataSources
787
+ */
788
+ collection?: MaybeRefOrGetter<DataSourceCollection>;
789
+ /**
790
+ * The second parameter passed to the `remove` function
791
+ *
792
+ * `dataSources.remove(dataSource,destroyOnRemove)`
793
+ */
794
+ destroyOnRemove?: boolean;
795
+ }
796
+
797
+ export declare interface UseDataSourceScopeRetrun {
798
+ /**
799
+ * A `Set` for storing SideEffect instance,
800
+ * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
801
+ */
802
+ scope: Readonly<ShallowReactive<Set<CesiumDataSource>>>;
803
+ /**
804
+ * Add SideEffect instance
805
+ */
806
+ add: <T extends CesiumDataSource>(dataSource: T) => Promise<T>;
807
+ /**
808
+ * Remove specified SideEffect instance
809
+ */
810
+ remove: (dataSource: CesiumDataSource, destroy?: boolean) => boolean;
811
+ /**
812
+ * Remove all SideEffect instance that meets the specified criteria
813
+ */
814
+ removeWhere: (predicate: EffcetRemovePredicate<CesiumDataSource>, destroy?: boolean) => void;
815
+ /**
816
+ * Remove all SideEffect instance within current scope
817
+ */
818
+ removeScope: (destroy?: boolean) => void;
819
+ }
820
+
821
+ /**
822
+ * Cesium HtmlElement Overlay
823
+ */
824
+ export declare function useElementOverlay(target?: MaybeComputedElementRef, position?: MaybeRefOrGetter<CommonCoord | undefined>, options?: UseElementOverlayOptions): UseElementOverlayRetrun;
825
+
826
+ export declare interface UseElementOverlayOptions {
827
+ /**
828
+ * Horizontal origin of the target element
829
+ * @default `center`
830
+ */
831
+ horizontal?: MaybeRefOrGetter<'center' | 'left' | 'right' | undefined>;
832
+ /**
833
+ * Vertical origin of the target element
834
+ * @default `bottom`
835
+ */
836
+ vertical?: MaybeRefOrGetter<'center' | 'bottom' | 'top' | undefined>;
837
+ /**
838
+ * Pixel offset presented by the target element
839
+ * @default {x:0,y:0}
840
+ */
841
+ offset?: MaybeRefOrGetter<{
842
+ x?: number;
843
+ y?: number;
844
+ } | undefined>;
845
+ /**
846
+ * The reference element for calculating the position of the target element
847
+ * - `true` refer to the browser viewport
848
+ * - `false` refer to the Cesium canvas
849
+ */
850
+ referenceWindow?: MaybeRefOrGetter<boolean>;
851
+ /**
852
+ * Whether to apply style to the target element
853
+ * @default true
854
+ */
855
+ applyStyle?: MaybeRefOrGetter<boolean>;
856
+ }
857
+
858
+ export declare interface UseElementOverlayRetrun {
859
+ /**
860
+ * Calculation result of the target element's horizontal direction
861
+ */
862
+ x: ComputedRef<number>;
863
+ /**
864
+ * Calculation result of the target element's vertical direction
865
+ */
866
+ y: ComputedRef<number>;
867
+ /**
868
+ * Calculation `css` of the target element
869
+ */
870
+ style: ComputedRef<{
871
+ left: string;
872
+ top: string;
873
+ }>;
874
+ }
875
+
876
+ /**
877
+ * Add `Entity` to the `EntityCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Entity`.
878
+ *
879
+ * overLoaded1: Parameter supports passing in a single value.
880
+ */
881
+ export declare function useEntity<T extends Entity = Entity>(entity?: MaybeRefOrAsyncGetter<T | undefined>, options?: UseEntityOptions): ComputedRef<T | undefined>;
882
+
883
+ /**
884
+ * Add `Entity` to the `EntityCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Entity`.
885
+ *
886
+ * overLoaded2: Parameter supports passing in an array.
887
+ */
888
+ export declare function useEntity<T extends Entity = Entity>(entities?: MaybeRefOrAsyncGetter<Array<T | undefined>>, options?: UseEntityOptions): ComputedRef<T[] | undefined>;
889
+
890
+ export declare interface UseEntityOptions {
891
+ /**
892
+ * The collection of Entity to be added
893
+ * @default useViewer().value.entities
894
+ */
895
+ collection?: EntityCollection;
896
+ /**
897
+ * default value of `isActive`
898
+ * @default true
899
+ */
900
+ isActive?: MaybeRefOrGetter<boolean>;
901
+ /**
902
+ * Ref passed to receive the updated of async evaluation
903
+ */
904
+ evaluating?: Ref<boolean>;
905
+ }
906
+
907
+ /**
908
+ * Make `add` and `remove` operations of `EntityCollection` scoped,
909
+ * automatically remove `Entity` instance when component is unmounted.
910
+ */
911
+ export declare function useEntityScope(options?: UseEntityScopeOptions): UseEntityScopeRetrun;
912
+
913
+ export declare interface UseEntityScopeOptions {
914
+ /**
915
+ * The collection of Entity to be added
916
+ * @default useViewer().value.entities
917
+ */
918
+ collection?: MaybeRefOrGetter<EntityCollection>;
919
+ }
920
+
921
+ export declare interface UseEntityScopeRetrun {
922
+ /**
923
+ * A `Set` for storing SideEffect instance,
924
+ * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
925
+ */
926
+ scope: Readonly<ShallowReactive<Set<Entity>>>;
927
+ /**
928
+ * Add SideEffect instance
929
+ */
930
+ add: <T extends Entity>(entity: T) => T;
931
+ /**
932
+ * Remove specified SideEffect instance
933
+ */
934
+ remove: (entity: Entity, destroy?: boolean) => boolean;
935
+ /**
936
+ * Remove all SideEffect instance that meets the specified criteria
937
+ */
938
+ removeWhere: (predicate: EffcetRemovePredicate<Entity>, destroy?: boolean) => void;
939
+ /**
940
+ * Remove all SideEffect instance within current scope
941
+ */
942
+ removeScope: (destroy?: boolean) => void;
943
+ }
944
+
945
+ /**
946
+ * Handle graphic event listeners and cursor styles for Cesium graphics.
947
+ * You don't need to overly worry about memory leaks from the function, as it automatically cleans up internally.
948
+ */
949
+ export declare function useGraphicEvent(): UseGraphicEventRetrun;
950
+
951
+ export declare interface UseGraphicEventRetrun {
952
+ /**
953
+ * Add a graphic event listener and return a function to remove it.
954
+ * @param graphic - The graphic object, 'global' indicates the global graphic object.
955
+ * @param type - The event type, 'all' indicates clearing all events.
956
+ * @param listener - The event listener function.
957
+ */
958
+ addGraphicEvent: <T extends GraphicEventType>(graphic: CesiumGraphic | 'global', type: T, listener: GraphicEventListener<T>, options?: AddGraphicEventOptions) => RemoveGraphicEventFn;
959
+ /**
960
+ * Remove a graphic event listener.
961
+ * @param graphic - The graphic object, 'global' indicates the global graphic object.
962
+ * @param type - The event type, 'all' indicates clearing all events.
963
+ * @param listener - The event listener function.
964
+ */
965
+ removeGraphicEvent: <T extends GraphicEventType>(graphic: CesiumGraphic | 'global', type: T, listener: GraphicEventListener<T>) => void;
966
+ /**
967
+ * Clear graphic event listeners.
968
+ * @param graphic - The graphic object.
969
+ * @param type - The event type, 'all' indicates clearing all events.
970
+ */
971
+ clearGraphicEvent: (graphic: CesiumGraphic | 'global', type: GraphicEventType | 'all') => void;
972
+ }
973
+
974
+ /**
975
+ * Add `ImageryLayer` to the `ImageryLayerCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `ImageryLayer`.
976
+ *
977
+ * overLoaded1: Parameter supports passing in a single value.
978
+ */
979
+ export declare function useImageryLayer<T extends ImageryLayer = ImageryLayer>(layer?: MaybeRefOrAsyncGetter<T | undefined>, options?: UseImageryLayerOptions): ComputedRef<T | undefined>;
980
+
981
+ /**
982
+ * Add `ImageryLayer` to the `ImageryLayerCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `ImageryLayer`.
983
+ *
984
+ * overLoaded2: Parameter supports passing in an array.
985
+ */
986
+ export declare function useImageryLayer<T extends ImageryLayer = ImageryLayer>(layers?: MaybeRefOrAsyncGetter<Array<T | undefined>>, options?: UseImageryLayerOptions): ComputedRef<T[] | undefined>;
987
+
988
+ export declare interface UseImageryLayerOptions {
989
+ /**
990
+ * The collection of ImageryLayer to be added
991
+ * @default useViewer().value.imageryLayers
992
+ */
993
+ collection?: ImageryLayerCollection;
994
+ /**
995
+ * default value of `isActive`
996
+ * @default true
997
+ */
998
+ isActive?: MaybeRefOrGetter<boolean>;
999
+ /**
1000
+ * Ref passed to receive the updated of async evaluation
1001
+ */
1002
+ evaluating?: Ref<boolean>;
1003
+ /**
1004
+ * The second parameter passed to the `remove` function
1005
+ *
1006
+ * `imageryLayers.remove(layer,destroyOnRemove)`
1007
+ */
1008
+ destroyOnRemove?: MaybeRefOrGetter<boolean>;
1009
+ }
1010
+
1011
+ /**
1012
+ * Make `add` and `remove` operations of `ImageryLayerCollection` scoped,
1013
+ * automatically remove `ImageryLayer` instance when component is unmounted.
1014
+ */
1015
+ export declare function useImageryLayerScope(options?: UseImageryLayerScopeOptions): UseImageryLayerScopeRetrun;
1016
+
1017
+ export declare interface UseImageryLayerScopeOptions {
1018
+ /**
1019
+ * The collection of ImageryLayer to be added
1020
+ * @default useViewer().value.imageryLayers
1021
+ */
1022
+ collection?: MaybeRefOrGetter<ImageryLayerCollection>;
1023
+ /**
1024
+ * The second parameter passed to the `remove` function
1025
+ *
1026
+ * `imageryLayers.remove(imageryLayer,destroyOnRemove)`
1027
+ */
1028
+ destroyOnRemove?: boolean;
1029
+ }
1030
+
1031
+ export declare interface UseImageryLayerScopeRetrun {
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<ImageryLayer>>>;
1037
+ /**
1038
+ * Add SideEffect instance
1039
+ */
1040
+ add: <T extends ImageryLayer>(imageryLayer: T) => T;
1041
+ /**
1042
+ * Remove specified SideEffect instance
1043
+ */
1044
+ remove: (imageryLayer: ImageryLayer, destroy?: boolean) => boolean;
1045
+ /**
1046
+ * Remove all SideEffect instance that meets the specified criteria
1047
+ */
1048
+ removeWhere: (predicate: EffcetRemovePredicate<ImageryLayer>, destroy?: boolean) => void;
1049
+ /**
1050
+ * Remove all SideEffect instance within current scope
1051
+ */
1052
+ removeScope: (destroy?: boolean) => void;
1053
+ }
1054
+
1055
+ /**
1056
+ * Add `PostProcessStage` to the `PostProcessStageCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `PostProcessStage`.
1057
+ *
1058
+ * overLoaded1: Parameter supports passing in a single value.
1059
+ */
1060
+ export declare function usePostProcessStage<T extends PostProcessStage = PostProcessStage>(stage?: MaybeRefOrAsyncGetter<T | undefined>, options?: UsePostProcessStageOptions): ComputedRef<T | undefined>;
1061
+
1062
+ /**
1063
+ * Add `PostProcessStage` to the `PostProcessStageCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `PostProcessStage`.
1064
+ *
1065
+ * overLoaded2: Parameter supports passing in an array.
1066
+ */
1067
+ export declare function usePostProcessStage<T extends PostProcessStage = PostProcessStage>(stages?: MaybeRefOrAsyncGetter<Array<T | undefined>>, options?: UsePostProcessStageOptions): ComputedRef<T[] | undefined>;
1068
+
1069
+ export declare interface UsePostProcessStageOptions {
1070
+ /**
1071
+ * The collection of PostProcessStage to be added
1072
+ * @default useViewer().scene.postProcessStages
1073
+ */
1074
+ collection?: PostProcessStageCollection;
1075
+ /**
1076
+ * default value of `isActive`
1077
+ * @default true
1078
+ */
1079
+ isActive?: MaybeRefOrGetter<boolean>;
1080
+ /**
1081
+ * Ref passed to receive the updated of async evaluation
1082
+ */
1083
+ evaluating?: Ref<boolean>;
1084
+ }
1085
+
1086
+ /**
1087
+ * Make `add` and `remove` operations of `PostProcessStageCollection` scoped,
1088
+ * automatically remove `PostProcessStage` instance when component is unmounted.
1089
+ */
1090
+ export declare function usePostProcessStageScope(options?: UsePostProcessStageScopeOptions): UsePostProcessStageScopeRetrun;
1091
+
1092
+ export declare interface UsePostProcessStageScopeOptions {
1093
+ /**
1094
+ * The collection of PostProcessStage to be added
1095
+ * @default useViewer().value.postProcessStages
1096
+ */
1097
+ collection?: MaybeRefOrGetter<PostProcessStageCollection>;
1098
+ }
1099
+
1100
+ export declare interface UsePostProcessStageScopeRetrun {
1101
+ /**
1102
+ * A `Set` for storing SideEffect instance,
1103
+ * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
1104
+ */
1105
+ scope: Readonly<ShallowReactive<Set<PostProcessStage>>>;
1106
+ /**
1107
+ * Add SideEffect instance
1108
+ */
1109
+ add: <T extends PostProcessStage>(postProcessStage: T) => T;
1110
+ /**
1111
+ * Remove specified SideEffect instance
1112
+ */
1113
+ remove: (postProcessStage: PostProcessStage, destroy?: boolean) => boolean;
1114
+ /**
1115
+ * Remove all SideEffect instance that meets the specified criteria
1116
+ */
1117
+ removeWhere: (predicate: EffcetRemovePredicate<PostProcessStage>, destroy?: boolean) => void;
1118
+ /**
1119
+ * Remove all SideEffect instance within current scope
1120
+ */
1121
+ removeScope: (destroy?: boolean) => void;
1122
+ }
1123
+
1124
+ /**
1125
+ * Add `Primitive` to the `PrimitiveCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Primitive`.
1126
+ *
1127
+ * overLoaded1: Parameter supports passing in a single value.
1128
+ */
1129
+ export declare function usePrimitive<T = any>(primitive?: MaybeRefOrAsyncGetter<T | undefined>, options?: UsePrimitiveOptions): ComputedRef<T | undefined>;
1130
+
1131
+ /**
1132
+ * Add `Primitive` to the `PrimitiveCollection`, automatically update when the data changes, and destroy the side effects caused by the previous `Primitive`.
1133
+ *
1134
+ * overLoaded2: Parameter supports passing in an array.
1135
+ */
1136
+ export declare function usePrimitive<T = any>(primitives?: MaybeRefOrAsyncGetter<Array<T | undefined>>, options?: UsePrimitiveOptions): ComputedRef<T[] | undefined>;
1137
+
1138
+ export declare interface UsePrimitiveOptions {
1139
+ /**
1140
+ * The collection of Primitive to be added
1141
+ * - `ground` : `useViewer().scene.groundPrimitives`
1142
+ * @default useViewer().scene.primitives
1143
+ */
1144
+ collection?: PrimitiveCollection | 'ground';
1145
+ /**
1146
+ * default value of `isActive`
1147
+ * @default true
1148
+ */
1149
+ isActive?: MaybeRefOrGetter<boolean>;
1150
+ /**
1151
+ * Ref passed to receive the updated of async evaluation
1152
+ */
1153
+ evaluating?: Ref<boolean>;
1154
+ }
1155
+
1156
+ /**
1157
+ * Make `add` and `remove` operations of `PrimitiveCollection` scoped,
1158
+ * automatically remove `Primitive` instance when component is unmounted.
1159
+ */
1160
+ export declare function usePrimitiveScope(options?: UsePrimitiveScopeOptions): UsePrimitiveScopeRetrun;
1161
+
1162
+ export declare interface UsePrimitiveScopeOptions {
1163
+ /**
1164
+ * The collection of Primitive to be added
1165
+ * @default useViewer().value.scene.primitives
1166
+ */
1167
+ collection?: MaybeRefOrGetter<PrimitiveCollection>;
1168
+ }
1169
+
1170
+ export declare interface UsePrimitiveScopeRetrun {
1171
+ /**
1172
+ * A `Set` for storing SideEffect instance,
1173
+ * which is encapsulated using `ShallowReactive` to provide Vue's reactive functionality
1174
+ */
1175
+ scope: Readonly<ShallowReactive<Set<any>>>;
1176
+ /**
1177
+ * Add SideEffect instance
1178
+ */
1179
+ add: <T>(primitive: T) => T;
1180
+ /**
1181
+ * Remove specified SideEffect instance
1182
+ */
1183
+ remove: (primitive: any, destroy?: boolean) => boolean;
1184
+ /**
1185
+ * Remove all SideEffect instance that meets the specified criteria
1186
+ */
1187
+ removeWhere: (predicate: EffcetRemovePredicate<any>, destroy?: boolean) => void;
1188
+ /**
1189
+ * Remove all SideEffect instance within current scope
1190
+ */
1191
+ removeScope: (destroy?: boolean) => void;
1192
+ }
1193
+
1194
+ /**
1195
+ * Reactive generation of scale bars
1196
+ */
1197
+ export declare function useScaleBar(options?: UseScaleBarOptions): UseScaleBarRetrun;
1198
+
1199
+ export declare interface UseScaleBarOptions {
1200
+ /**
1201
+ * The maximum width of the scale (px)
1202
+ * @default 80
1203
+ */
1204
+ maxPixel?: MaybeRefOrGetter<number>;
1205
+ /**
1206
+ * Throttled delay duration (ms)
1207
+ * @default 8
1208
+ */
1209
+ delay?: number;
1210
+ }
1211
+
1212
+ export declare interface UseScaleBarRetrun {
1213
+ /**
1214
+ * The actual distance of a single pixel in the current canvas
1215
+ */
1216
+ pixelDistance: Readonly<Ref<number | undefined>>;
1217
+ /**
1218
+ * The width of the scale.(px)
1219
+ */
1220
+ width: Readonly<Ref<number>>;
1221
+ /**
1222
+ * The actual distance corresponding to the width of the scale (m)
1223
+ */
1224
+ distance: Readonly<Ref<number | undefined>>;
1225
+ /**
1226
+ * Formatted content of distance.
1227
+ * eg. 100m,100km
1228
+ */
1229
+ distanceText: Readonly<Ref<string | undefined>>;
1230
+ }
1231
+
1232
+ /**
1233
+ * Uses the `scene.drillPick` function to perform screen point picking,
1234
+ * return a computed property containing the pick result, or undefined if no object is picked.
1235
+ *
1236
+ * @param windowPosition The screen coordinates of the pick point.
1237
+ */
1238
+ export declare function useSceneDrillPick(windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>, options?: UseSceneDrillPickOptions): ComputedRef<any[] | undefined>;
1239
+
1240
+ export declare interface UseSceneDrillPickOptions {
1241
+ /**
1242
+ * Whether to activate the pick function.
1243
+ * @default true
1244
+ */
1245
+ isActive?: MaybeRefOrGetter<boolean | undefined>;
1246
+ /**
1247
+ * Throttled sampling (ms)
1248
+ * @default 8
1249
+ */
1250
+ throttled?: number;
1251
+ /**
1252
+ * If supplied, stop drilling after collecting this many picks.
1253
+ */
1254
+ limit?: MaybeRefOrGetter<number | undefined>;
1255
+ /**
1256
+ * The width of the pick rectangle.
1257
+ * @default 3
1258
+ */
1259
+ width?: MaybeRefOrGetter<number | undefined>;
1260
+ /**
1261
+ * The height of the pick rectangle.
1262
+ * @default 3
1263
+ */
1264
+ height?: MaybeRefOrGetter<number | undefined>;
1265
+ }
1266
+
1267
+ /**
1268
+ * Uses the `scene.pick` function in Cesium's Scene object to perform screen point picking,
1269
+ * return a computed property containing the pick result, or undefined if no object is picked.
1270
+ *
1271
+ * @param windowPosition The screen coordinates of the pick point.
1272
+ */
1273
+ export declare function useScenePick(windowPosition: MaybeRefOrGetter<Cartesian2 | undefined>, options?: UseScenePickOptions): Readonly<ShallowRef<any | undefined>>;
1274
+
1275
+ export declare interface UseScenePickOptions {
1276
+ /**
1277
+ * Whether to active the event listener.
1278
+ * @default true
1279
+ */
1280
+ isActive?: MaybeRefOrGetter<boolean>;
1281
+ /**
1282
+ * Throttled sampling (ms)
1283
+ * @default 8
1284
+ */
1285
+ throttled?: number;
1286
+ /**
1287
+ * The width of the pick rectangle.
1288
+ * @default 3
1289
+ */
1290
+ width?: MaybeRefOrGetter<number | undefined>;
1291
+ /**
1292
+ * The height of the pick rectangle.
1293
+ * @default 3
1294
+ */
1295
+ height?: MaybeRefOrGetter<number | undefined>;
1296
+ }
1297
+
1298
+ /**
1299
+ * Easily use the `ScreenSpaceEventHandler`,
1300
+ * when the dependent data changes or the component is unmounted,
1301
+ * the listener function will automatically reload or destroy.
1302
+ *
1303
+ * @param type Types of mouse event
1304
+ * @param inputAction Callback function for listening
1305
+ */
1306
+ export declare function useScreenSpaceEventHandler<T extends ScreenSpaceEventType>(type?: MaybeRefOrGetter<T | undefined>, inputAction?: (event: ScreenSpaceEvent<T>) => any, options?: UseScreenSpaceEventHandlerOptions): WatchStopHandle;
1307
+
1308
+ export declare interface UseScreenSpaceEventHandlerOptions {
1309
+ /**
1310
+ * Modifier key
1311
+ */
1312
+ modifier?: MaybeRefOrGetter<KeyboardEventModifier | undefined>;
1313
+ /**
1314
+ * Whether to active the event listener.
1315
+ * @default true
1316
+ */
1317
+ isActive?: MaybeRefOrGetter<boolean>;
1318
+ }
1319
+
1320
+ /**
1321
+ * Obtain the `Viewer` instance injected through `createViewer` in the current component or its ancestor components.
1322
+ *
1323
+ * note:
1324
+ * - If `createViewer` and `useViewer` are called in the same component, the `Viewer` instance injected by `createViewer` will be used preferentially.
1325
+ * - When calling `createViewer` and `useViewer` in the same component, `createViewer` should be called before `useViewer`.
1326
+ */
1327
+ export declare function useViewer(): Readonly<ShallowRef<Viewer | undefined>>;
4
1328
 
5
1329
  export { }