@maptalks/vt 0.96.4 → 0.97.1

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,5 @@
1
1
  /*!
2
- * @maptalks/vt v0.96.4
2
+ * @maptalks/vt v0.97.1
3
3
  * LICENSE : undefined
4
4
  * (c) 2016-2024 maptalks.org
5
5
  */
@@ -491,6 +491,129 @@ type GeoJSONVectorTileLayerOptionsType = {
491
491
  convertFn?: (data: any) => any;
492
492
  } & VectorTileLayerOptionsType;
493
493
 
494
+ /**
495
+ * from mapbox-gl-js
496
+ * A [least-recently-used cache](http://en.wikipedia.org/wiki/Cache_algorithms)
497
+ * with hash lookup made possible by keeping a list of keys in parallel to
498
+ * an array of dictionary of values
499
+ *
500
+ * @public
501
+ */
502
+ declare class LRUCache {
503
+ /**
504
+ * @param {number} max number of permitted values
505
+ * @param {Function} onRemove callback called with items when they expire
506
+ */
507
+ constructor(max: number);
508
+ max: number;
509
+ /**
510
+ * Clear the cache
511
+ *
512
+ * @returns {LRUCache} this cache
513
+ */
514
+ reset(): LRUCache;
515
+ data: {};
516
+ order: any[];
517
+ clear(): void;
518
+ /**
519
+ * Add a key, value combination to the cache, trimming its size if this pushes
520
+ * it over max length.
521
+ *
522
+ * @param {string} key lookup key for the item
523
+ * @param {*} data any value
524
+ *
525
+ * @returns {LRUCache} this cache
526
+ */
527
+ add(key: string, data: any): LRUCache;
528
+ /**
529
+ * Determine whether the value attached to `key` is present
530
+ *
531
+ * @param {String} key the key to be looked-up
532
+ * @returns {Boolean} whether the cache has this value
533
+ */
534
+ has(key: string): boolean;
535
+ /**
536
+ * List all keys in the cache
537
+ *
538
+ * @returns {Array<string>} an array of keys in this cache.
539
+ */
540
+ keys(): Array<string>;
541
+ /**
542
+ * Get the value attached to a specific key and remove data from cache.
543
+ * If the key is not found, returns `null`
544
+ *
545
+ * @param {string} key the key to look up
546
+ * @returns {*} the data, or null if it isn't found
547
+ */
548
+ getAndRemove(key: string): any;
549
+ /**
550
+ * Get the value attached to a specific key without removing data
551
+ * from the cache. If the key is not found, returns `null`
552
+ *
553
+ * @param {string} key the key to look up
554
+ * @returns {*} the data, or null if it isn't found
555
+ */
556
+ get(key: string): any;
557
+ /**
558
+ * Remove a key/value combination from the cache.
559
+ *
560
+ * @param {string} key the key for the pair to delete
561
+ * @returns {LRUCache} this cache
562
+ */
563
+ remove(key: string): LRUCache;
564
+ /**
565
+ * Change the max size of the cache.
566
+ *
567
+ * @param {number} max the max size of the cache
568
+ * @returns {LRUCache} this cache
569
+ */
570
+ setMaxSize(max: number): LRUCache;
571
+ }
572
+ //# sourceMappingURL=LRUCache.d.ts.map
573
+
574
+ declare class GlyphRequestor {
575
+ constructor(framer: any, limit: number, isCompactChars: any, sdfURL: any);
576
+ entries: {};
577
+ _cachedFont: {};
578
+ _cache: LRUCache;
579
+ _framer: any;
580
+ _limit: number;
581
+ _isCompactChars: any;
582
+ _sdfURL: any;
583
+ _isValidSDFURL(url: any): boolean;
584
+ getGlyphs(glyphs: any, cb: any): void;
585
+ _requestRemoteSDF(glyphs: any, cb: any): void;
586
+ _requestGlyph(): Promise<any>;
587
+ _tinySDF(entry: any, fonts: any, charCode: any, isCharsCompact: any): {
588
+ charCode: any;
589
+ bitmap: {
590
+ width: number;
591
+ height: number;
592
+ data: any;
593
+ };
594
+ metrics: {
595
+ width: number;
596
+ height: number;
597
+ left: number;
598
+ top: number;
599
+ advance: number;
600
+ };
601
+ };
602
+ }
603
+
604
+ declare class IconRequestor {
605
+ constructor(options: any);
606
+ options: any;
607
+ _requesting: {};
608
+ _cache: LRUCache;
609
+ ctx: CanvasRenderingContext2D;
610
+ getIcons(icons: any, cb: any): void;
611
+ _hasCache(url: any, width: any, height: any): boolean;
612
+ _addCache(url: any, data: any, width: any, height: any): void;
613
+ _getCache(url: any, size: any): any;
614
+ _ensureMaxSize(url: any, size: any): void;
615
+ }
616
+
494
617
  declare const WorkerConnection_base: {
495
618
  new (workerKey: string): {
496
619
  initializing: boolean;
@@ -533,8 +656,8 @@ declare class WorkerConnection extends WorkerConnection_base {
533
656
  _workerLayerId: string;
534
657
  _isDedicated: boolean;
535
658
  _dedicatedVTWorkers: {};
536
- _iconRequestor: any;
537
- _glyphRequestor: any;
659
+ _iconRequestor: IconRequestor;
660
+ _glyphRequestor: GlyphRequestor;
538
661
  initialize(cb: any): void;
539
662
  addLayer(cb: any): void;
540
663
  abortTile(url: any, cb: any): void;
@@ -691,7 +814,7 @@ declare class VectorTileLayerRenderer extends maptalks.renderer.TileLayerCanvasR
691
814
  _endFrame(timestamp: any): void;
692
815
  getPolygonOffsetCount(): number;
693
816
  _drawDebug(): void;
694
- _isVisitable(plugin: any): true | 0 | 1 | 2;
817
+ _isVisitable(plugin: any): true | 1 | 2 | 0;
695
818
  _getPluginContext(plugin: any, polygonOffsetIndex: any, cameraPosition: any, timestamp: any): {
696
819
  regl: any;
697
820
  layer: any;
@@ -820,7 +943,7 @@ declare class Vector3DLayer extends maptalks.OverlayLayer {
820
943
  * 获取图层的polygonOffsetCount
821
944
  * 用于GroupGLLayer全局管理polygonOffset
822
945
  */
823
- getPolygonOffsetCount(): 0 | 1;
946
+ getPolygonOffsetCount(): 1 | 0;
824
947
  /**
825
948
  * 获取图层的polygonOffset
826
949
  * 用于GroupGLLayer全局管理polygonOffset