@juun-roh/cesium-utils 0.3.1 → 0.3.3

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.
@@ -1,5 +1,11 @@
1
1
  import { DataSourceCollection, EntityCollection, ImageryLayerCollection, PrimitiveCollection, Billboard, Cesium3DTileset, GroundPrimitive, Label, PointPrimitive, Polyline, Primitive, DataSource, Entity, ImageryLayer } from 'cesium';
2
2
 
3
+ /**
4
+ * Runtime type validator to identify the non-function property.
5
+ */
6
+ type NonFunction<T> = {
7
+ [K in keyof T]: T[K] extends Function ? never : K;
8
+ }[keyof T];
3
9
  /**
4
10
  * Examine the property descriptors at runtime
5
11
  * to detect properties that only have getters.
@@ -8,12 +14,6 @@ import { DataSourceCollection, EntityCollection, ImageryLayerCollection, Primiti
8
14
  * @param k The key value of the property.
9
15
  */
10
16
  declare function isGetterOnly(o: object, k: string | number | symbol): boolean;
11
- /**
12
- * Runtime type validator to identify the non-function property.
13
- */
14
- type NonFunction<T> = {
15
- [K in keyof T]: T[K] extends Function ? never : K;
16
- }[keyof T];
17
17
 
18
18
  /**
19
19
  * @class
@@ -171,44 +171,29 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
171
171
  */
172
172
  [Symbol.iterator](): Iterator<I>;
173
173
  /**
174
- * Emits an event to all registered listeners.
175
- *
176
- * @private
177
- * @param type - The event type
178
- * @param data - Additional event data
179
- */
180
- private _emit;
181
- /**
182
- * Adds an item to the internal tag map for quick lookups.
183
- *
184
- * @private
185
- * @param item - The item to add
186
- * @param tag - The tag to associate with the item
187
- */
188
- private _addToTagMap;
189
- /**
190
- * Removes an item from the internal tag map.
174
+ * Gets all item instances in the collection.
175
+ * This array should not be modified directly.
191
176
  *
192
- * @private
193
- * @param item - The item to remove
177
+ * @returns An array of all items in the collection
194
178
  */
195
- private _removeFromTagMap;
179
+ get values(): I[];
196
180
  /**
197
- * Invalidates the values cache when collection changes.
181
+ * Gets the number of items in the collection.
198
182
  *
199
- * @private
183
+ * @returns The item count
200
184
  */
201
- private _invalidateCache;
185
+ get length(): number;
202
186
  /**
203
- * Sets up automatic cache invalidation by registering event listeners on the underlying Cesium collection.
187
+ * Gets all unique tags currently in use in the collection.
204
188
  *
205
- * @private
206
- * @param collection - The Cesium collection to monitor for changes
189
+ * @returns An array of all unique tags
207
190
  *
208
- * @see {@link destroy} For cleanup of event listeners
209
- * @see {@link _invalidateCache} For the actual cache invalidation logic
191
+ * @example
192
+ * // Get all tags
193
+ * const tags = collection.tags;
194
+ * console.log(`Collection has these tags: ${tags.join(', ')}`);
210
195
  */
211
- private _setupCacheInvalidator;
196
+ get tags(): Collection.Tag[];
212
197
  /**
213
198
  * Registers an event listener for collection events.
214
199
  *
@@ -300,19 +285,6 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
300
285
  * The Collection instance should not be used after calling this method.
301
286
  */
302
287
  destroy(): void;
303
- /**
304
- * Gets all item instances in the collection.
305
- * This array should not be modified directly.
306
- *
307
- * @returns An array of all items in the collection
308
- */
309
- get values(): I[];
310
- /**
311
- * Gets the number of items in the collection.
312
- *
313
- * @returns The item count
314
- */
315
- get length(): number;
316
288
  /**
317
289
  * Gets all items with the specified tag from the collection.
318
290
  * Uses an optimized internal map for faster lookups.
@@ -337,17 +309,6 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
337
309
  * const firstBuilding = collection.first('buildings');
338
310
  */
339
311
  first(by: Collection.Tag): I | undefined;
340
- /**
341
- * Gets all unique tags currently in use in the collection.
342
- *
343
- * @returns An array of all unique tags
344
- *
345
- * @example
346
- * // Get all tags
347
- * const tags = collection.tags;
348
- * console.log(`Collection has these tags: ${tags.join(', ')}`);
349
- */
350
- get tags(): Collection.Tag[];
351
312
  /**
352
313
  * Updates the tag for all items with the specified tag.
353
314
  *
@@ -482,6 +443,45 @@ declare class Collection<C extends Collection.Base, I extends Collection.ItemFor
482
443
  * );
483
444
  */
484
445
  find(predicate: (value: I) => boolean, by?: Collection.Tag): I | undefined;
446
+ /**
447
+ * Emits an event to all registered listeners.
448
+ *
449
+ * @private
450
+ * @param type - The event type
451
+ * @param data - Additional event data
452
+ */
453
+ private _emit;
454
+ /**
455
+ * Adds an item to the internal tag map for quick lookups.
456
+ *
457
+ * @private
458
+ * @param item - The item to add
459
+ * @param tag - The tag to associate with the item
460
+ */
461
+ private _addToTagMap;
462
+ /**
463
+ * Removes an item from the internal tag map.
464
+ *
465
+ * @private
466
+ * @param item - The item to remove
467
+ */
468
+ private _removeFromTagMap;
469
+ /**
470
+ * Invalidates the values cache when collection changes.
471
+ *
472
+ * @private
473
+ */
474
+ private _invalidateCache;
475
+ /**
476
+ * Sets up automatic cache invalidation by registering event listeners on the underlying Cesium collection.
477
+ *
478
+ * @private
479
+ * @param collection - The Cesium collection to monitor for changes
480
+ *
481
+ * @see {@link destroy} For cleanup of event listeners
482
+ * @see {@link _invalidateCache} For the actual cache invalidation logic
483
+ */
484
+ private _setupCacheInvalidator;
485
485
  }
486
486
  /**
487
487
  * @namespace