import Tile from './tile';
import { Evented } from '../util/evented';
import TileCache from './tile_cache';
import Context from '../gl/context';
import Point from '../util/point';
import { OverscaledTileID } from './tile_id';
import SourceFeatureState from './source_state';
import type { Source } from './source';
import type Map from '../ui/map';
import type Style from '../style/style';
import type Dispatcher from '../util/dispatcher';
import type Transform from '../geo/transform';
import type { TileState } from './tile';
import type { Callback } from '../types/callback';
import type { SourceSpecification } from '../style-spec/types';
/**
 * `SourceCache` is responsible for
 *
 *  - creating an instance of `Source`
 *  - forwarding events from `Source`
 *  - caching tiles loaded from an instance of `Source`
 *  - loading the tiles needed to render a given viewport
 *  - unloading the cached tiles not needed to render a given viewport
 *
 * @private
 */
declare class SourceCache extends Evented {
    id: string;
    dispatcher: Dispatcher;
    map: Map;
    style: Style;
    _source: Source;
    _sourceLoaded: boolean;
    _sourceErrored: boolean;
    _tiles: {
        [_: string]: Tile;
    };
    _prevLng: number;
    _cache: TileCache;
    _timers: {
        [_ in any]: ReturnType<typeof setTimeout>;
    };
    _cacheTimers: {
        [_ in any]: ReturnType<typeof setTimeout>;
    };
    _maxTileCacheSize: number | undefined | null;
    _paused: boolean;
    _shouldReloadOnResume: boolean;
    _coveredTiles: {
        [_: string]: boolean;
    };
    transform: Transform;
    used: boolean;
    _state: SourceFeatureState;
    _loadedParentTiles: {
        [_: string]: Tile | undefined | null;
    };
    static maxUnderzooming: number;
    static maxOverzooming: number;
    constructor(id: string, options: SourceSpecification, dispatcher: Dispatcher);
    onAdd(map: Map): void;
    onRemove(map: Map): void;
    /**
     * Return true if no tile data is pending, tiles will not change unless
     * an additional API call is received.
     * @private
     */
    loaded(): boolean;
    getSource(): Source;
    pause(): void;
    resume(): void;
    _loadTile(tile: Tile, callback: Callback<void>): void;
    _unloadTile(tile: Tile): void;
    _abortTile(tile: Tile): void;
    serialize(): any;
    prepare(context: Context): void;
    /**
     * Return all tile ids ordered with z-order, and cast to numbers
     * @private
     */
    getIds(): Array<string>;
    getRenderableIds(symbolLayer?: boolean): Array<string>;
    hasRenderableParent(tileID: OverscaledTileID): boolean;
    _isIdRenderable(id: string, symbolLayer?: boolean): boolean;
    reload(): void;
    _reloadTile(id: string, state: TileState): void;
    _tileLoaded(tile: Tile, id: string, previousState: TileState, err?: Error | null): void;
    /**
    * For raster terrain source, backfill DEM to eliminate visible tile boundaries
    * @private
    */
    _backfillDEM(tile: Tile): void;
    /**
     * Get a specific tile by TileID
     * @private
     */
    getTile(tileID: OverscaledTileID): Tile;
    /**
     * Get a specific tile by id
     * @private
     */
    getTileByID(id: string): Tile;
    /**
     * For a given set of tiles, retain children that are loaded and have a zoom
     * between `zoom` (exclusive) and `maxCoveringZoom` (inclusive)
     * @private
     */
    _retainLoadedChildren(idealTiles: {
        [_ in any]: OverscaledTileID;
    }, zoom: number, maxCoveringZoom: number, retain: {
        [_ in any]: OverscaledTileID;
    }): void;
    /**
     * Find a loaded parent of the given tile (up to minCoveringZoom)
     * @private
     */
    findLoadedParent(tileID: OverscaledTileID, minCoveringZoom: number): Tile | undefined | null;
    _getLoadedTile(tileID: OverscaledTileID): Tile | undefined | null;
    /**
     * Resizes the tile cache based on the current viewport's size
     * or the maxTileCacheSize option passed during map creation
     *
     * Larger viewports use more tiles and need larger caches. Larger viewports
     * are more likely to be found on devices with more memory and on pages where
     * the map is more important.
     * @private
     */
    updateCacheSize(transform: Transform): void;
    handleWrapJump(lng: number): void;
    /**
     * Removes tiles that are outside the viewport and adds new tiles that
     * are inside the viewport.
     * @private
     */
    update(transform: Transform): void;
    releaseSymbolFadeTiles(): void;
    _updateRetainedTiles(idealTileIDs: Array<OverscaledTileID>, zoom: number): {
        [_: string]: OverscaledTileID;
    };
    _updateLoadedParentTileCache(): void;
    /**
     * Add a tile, given its coordinate, to the pyramid.
     * @private
     */
    _addTile(tileID: OverscaledTileID): Tile;
    _setTileReloadTimer(id: string, tile: Tile): void;
    /**
     * Remove a tile, given its id, from the pyramid
     * @private
     */
    _removeTile(id: string): void;
    /**
     * Remove all tiles from this pyramid
     */
    clearTiles(): void;
    /**
     * Search through our current tiles and attempt to find the tiles that
     * cover the given bounds.
     * @param pointQueryGeometry coordinates of the corners of bounding rectangle
     * @returns {Array<Object>} result items have {tile, minX, maxX, minY, maxY}, where min/max bounding values are the given bounds transformed in into the coordinate space of this tile.
     * @private
     */
    tilesIn(pointQueryGeometry: Array<Point>, maxPitchScaleFactor: number, has3DLayer: boolean): any[];
    getVisibleCoordinates(symbolLayer?: boolean): Array<OverscaledTileID>;
    hasTransition(): boolean;
    /**
     * Set the value of a particular state for a feature
     * @private
     */
    setFeatureState(sourceLayer: string | undefined | null, featureId: number | string, state: any): void;
    /**
     * Resets the value of a particular state key for a feature
     * @private
     */
    removeFeatureState(sourceLayer?: string, featureId?: number | string, key?: string): void;
    /**
     * Get the entire state object for a feature
     * @private
     */
    getFeatureState(sourceLayer: string | undefined | null, featureId: number | string): any;
    /**
     * Sets the set of keys that the tile depends on. This allows tiles to
     * be reloaded when their dependencies change.
     * @private
     */
    setDependencies(tileKey: string, namespace: string, dependencies: Array<string>): void;
    /**
     * Reloads all tiles that depend on the given keys.
     * @private
     */
    reloadTilesForDependencies(namespaces: Array<string>, keys: Array<string>): void;
}
export default SourceCache;
//# sourceMappingURL=source_cache.d.ts.map