import { TileList } from '../layers/TileLayer';
import * as three from "three";
/**
 * A Tile
 */
export interface Tile {
    /**
     * Whether the tile is ready or not
     */
    ready: boolean;
    /**
     * A three texture. If the texture is ready (loaded) then it is non null
     */
    texture: three.Texture | null;
    /**
     * The tile id in the form `"z/x/y"`, for example `"0/0/0"`
     */
    zxy: string;
}
/**
 * An instance of TileTextureSource manages textures (loading, freeing, caching) with tile ID approach
 */
declare class TileTextureSource {
    private readonly url;
    private readonly onTileLoad?;
    private loader;
    private lru;
    private apiKey;
    private sessionId;
    /**
     *
     * @param url The URL must have a pattern such as `https://api.maptiler.com/tiles/something/{zxy}.png`
     * @param onTileLoad
     */
    constructor(url: string, onTileLoad?: ((tile: Tile, url?: string, error?: ErrorEvent | null) => void) | undefined);
    setMaptilerParams(apiKey: string, sessionId: string): void;
    private urlPatternToUrl;
    /**
     * Get a tile from its ID.
     * Retrieves the tile from cache if present, otherwise loads it and adds it to cache
     * @param zxy of shape `"z/x/y"`, for example `"0/0/0"`
     * @param load
     * @returns
     */
    getTile(zxy: string, load: boolean): Tile | null;
    /**
     * Loads a tile and adds it to cache. When created `.ready` is `false` but when the loading callback
     * is successful, it is turned to `true`. Due to this asynchronous behaviour, the `Tile`returned by
     * this function will always have its `.ready`attribute to false.
     *
     * @param zxy of shape `"z/x/y"`, for example `"0/0/0"`
     * @returns
     */
    private createTile;
    /**
     * Frees the GPU related resources allocated by a texture. See [Texture.dispose() on ThreeJS](https://threejs.org/docs/?q=texture#api/en/textures/Texture.dispose).
     * @param tile
     */
    private disposeTile;
    /**
     * Dispose all the Tiles that are overflowing the size of the cache, except the ones provided in argument.
     * @param usedTiles
     */
    expireCache(usedTiles: TileList): void;
    /**
     * Dispose all the tiles from the cache (clearing the cache)
     */
    dispose(): void;
}
export { TileTextureSource };
