import { LRUCache } from '../utilities/LRUCache.js'; import { PriorityQueue } from '../utilities/PriorityQueue.js'; import { DownloadPriorityQueue } from '../utilities/DownloadPriorityQueue.js'; import { Tile } from './Tile.js'; import { Tileset } from './Tileset.js'; export const DEFAULT_LRU_CACHE : LRUCache; export const DEFAULT_DOWNLOAD_QUEUE : DownloadPriorityQueue; export const DEFAULT_PARSE_QUEUE : PriorityQueue; export const DEFAULT_NODE_QUEUE : PriorityQueue; // Events dispatched by TilesRendererBase, available across all renderer implementations. export interface TilesRendererBaseEventMap { 'needs-update': {}; 'load-tileset': { tileset : Tileset, url : string }; 'load-root-tileset': { tileset : Tileset, url : string }; 'tiles-load-start': {}; 'tiles-load-end': {}; 'tile-download-start': { tile : Tile, url : string }; 'load-model': { scene : TScene, tile : Tile, url : string }; 'dispose-model': { scene : TScene, tile : Tile }; 'tile-visibility-change': { scene : TScene, tile : Tile, visible : boolean }; 'update-before': {}; 'update-after': {}; 'load-error': { tile : Tile | null, error : Error, url : string | URL }; } export class TilesRendererBase { readonly rootTileset : Tileset | null; readonly root : Tile | null; readonly visibleTiles : Set; readonly activeTiles : Set; errorTarget : number; errorFalloff : number; errorFalloffDensity : number; displayActiveTiles : boolean; maxDepth : number; loadSiblings : boolean; loadAncestors : boolean; maxTilesProcessed : number; readonly loadProgress : number; fetchOptions : RequestInit; lruCache : LRUCache; parseQueue : PriorityQueue; downloadQueue : DownloadPriorityQueue; processNodeQueue: PriorityQueue; constructor( url?: string ); update() : void; registerPlugin( plugin: object ) : void; unregisterPlugin( plugin: object | string ) : boolean; getPluginByName( plugin: object | string ) : object; traverse( beforeCb : ( ( tile : object, parent : object, depth : number ) => boolean ) | null, afterCb : ( ( tile : object, parent : object, depth : number ) => boolean ) | null ) : void; getAttributions( target? : Array<{ type: string, value: any }> ) : Array<{ type: string, value: any }>; addEventListener( name : T, callback : ( event : TEventMap[ T ] & { type : T } ) => void ) : void; addEventListener( name : string, callback : ( event : any ) => void ) : void; removeEventListener( name : T, callback : ( event : TEventMap[ T ] & { type : T } ) => void ) : void; removeEventListener( name : string, callback : ( event : any ) => void ) : void; hasEventListener( name : T, callback : ( event : TEventMap[ T ] & { type : T } ) => void ) : boolean; hasEventListener( name : string, callback : ( event : any ) => void ) : boolean; dispatchEvent( event : TEventMap[ T ] & { type : T } ) : void; dispatchEvent( event : { type : string } ) : void; dispose() : void; resetFailedTiles() : void; }