/**
 * @typedef {Object} ExternalDataSourcesManagerWMTSCacheItem
 * @property {import('ol/layer/WebGLTile').default<import('ol/source/Tile').default>} layerObj
 * @property {Function} unregister
 */
/**
 * @hidden
 */
export class ExternalDatSourcesManager {
    /**
     * External data sources come remote online resources, such as WMS/WMTS
     * servers, and also files such as KML/GPX. This service is responsible of
     * creating, storing and managing them.
     *
     * @param {angular.gettext.gettextCatalog} gettextCatalog service.
     * @param {angular.auto.IInjectorService} $injector Main injector.
     * @param {angular.IQService} $q The Angular $q service.
     * @param {angular.IScope} $rootScope The rootScope provider.
     * @param {import('gmf/datasource/fileGroupModule').DatasourceFileGroup} gmfDatasourceFileGroup Group that contains file data sources.
     * @param {import('ngeo/datasource/DataSources').DataSource} ngeoDataSources Ngeo data sources service.
     * @param {import('ngeo/misc/File').FileService} ngeoFile Ngeo file.
     * @param {import('ngeo/map/LayerHelper').LayerHelper} ngeoLayerHelper Ngeo layer helper service.
     * @ngdoc service
     * @ngname gmfExternalDataSourcesManager
     */
    constructor(gettextCatalog: angular.gettext.gettextCatalog, $injector: angular.auto.IInjectorService, $q: angular.IQService, $rootScope: angular.IScope, gmfDatasourceFileGroup: import("gmf/datasource/fileGroupModule").DatasourceFileGroup, ngeoDataSources: import("ngeo/datasource/DataSources").DataSource, ngeoFile: import("ngeo/misc/File").FileService, ngeoLayerHelper: import("ngeo/map/LayerHelper").LayerHelper);
    /**
     * @type {angular.auto.IInjectorService}
     * @private
     */
    private injector_;
    /**
     * @type {angular.IQService}
     * @private
     */
    private q_;
    /**
     * @type {angular.IScope}
     * @private
     */
    private rootScope_;
    /**
     * The collection of DataSources from ngeo. When this service creates
     * a data source, its gets added to that collection.
     *
     * @type {import('ngeo/datasource/DataSource').DataSources}
     * @private
     */
    private dataSources_;
    /**
     * @type {import('ngeo/misc/File').FileService}
     * @private
     */
    private ngeoFile_;
    /**
     * @type {import('ngeo/map/LayerHelper').LayerHelper}
     * @private
     */
    private ngeoLayerHelper_;
    /**
     * All external data sources that are created are stored here. The key
     * is the data source id.
     *
     * Note: This cache is never cleaned and elements are never removed from it.
     * If a data source with an id already exists in this cache, it is used
     * instead of being re-created.
     *
     * @type {Object<number, import('ngeo/datasource/OGC').default|import('ngeo/datasource/File').default>}
     * @private
     */
    private extDataSources_;
    /**
     * File external data sources, with the key being the file name.
     *
     * @type {Object<string, import('ngeo/datasource/File').default>}
     * @private
     */
    private files_;
    /**
     * @type {?import('ol/Map').default}
     * @private
     */
    private map_;
    /**
     * Group that contains file data sources.
     *
     * @type {import('ngeo/datasource/FileGroup').default}
     * @private
     */
    private fileGroup_;
    /**
     * Collection of WMS groups.
     *
     * @type {import('ol/Collection').default<import('ngeo/datasource/WMSGroup').default>}
     * @private
     */
    private wmsGroupsCollection_;
    /**
     * Collection of groups for WMTS data sources.
     *
     * @type {import('ol/Collection').default<import('ngeo/datasource/OGCGroup').default>}
     * @private
     */
    private wmtsGroupsCollection_;
    /**
     * Cache that stores the information of a WMTS data source. The key is the
     * data source id.
     *
     * @type {Object<number, ExternalDataSourcesManagerWMTSCacheItem>}
     * @private
     */
    private wmtsCache_;
    /**
     * @returns {import('ngeo/datasource/FileGroup').default} File group.
     */
    get fileGroup(): ngeoDatasourceFileGroup;
    /**
     * @param {import('ngeo/datasource/WMSGroup').default} wmsGroup WMS group.
     * @private
     */
    private addWMSGroup_;
    /**
     * @param {import('ngeo/datasource/WMSGroup').default} wmsGroup WMS group.
     * @private
     */
    private removeWMSGroup_;
    /**
     * @param {string} url Online resource url
     * @returns {?import('ngeo/datasource/WMSGroup').default} WMS group.
     */
    getWMSGroup(url: string): import("ngeo/datasource/WMSGroup").default | null;
    /**
     * @returns {import('ngeo/datasource/WMSGroup').default[]} List of WMS groups.
     */
    get wmsGroups(): ngeoDatasourceWMSGroup[];
    /**
     * @returns {import('ol/Collection').default<import('ngeo/datasource/WMSGroup').default>}
     *    Collection of WMS groups.
     */
    get wmsGroupsCollection(): olCollection<ngeoDatasourceWMSGroup>;
    /**
     * @param {import('ngeo/datasource/OGCGroup').default} wmtsGroup Group for WMTS data sources.
     * @private
     */
    private addWMTSGroup_;
    /**
     * @param {import('ngeo/datasource/OGCGroup').default} wmtsGroup Group for WMTS data sources.
     * @private
     */
    private removeWMTSGroup_;
    /**
     * @param {string} url Online resource url
     * @returns {?import('ngeo/datasource/OGCGroup').default} WMTS group.
     */
    getWMTSGroup(url: string): import("ngeo/datasource/OGCGroup").default | null;
    /**
     * @returns {import('ngeo/datasource/OGCGroup').default[]} List of groups for WMTS data sources.
     */
    get wmtsGroups(): ngeoDatasourceOGCGroup[];
    /**
     * @returns {import('ol/Collection').default<import('ngeo/datasource/OGCGroup').default>}
     *    Collection of groups for WMTS data sources.
     */
    get wmtsGroupsCollection(): olCollection<ngeoDatasourceOGCGroup>;
    /**
     * @param {import('ngeo/datasource/DataSource').default} dataSource Data source
     * @returns {boolean} Whether the given data source is external or not. To
     *     be considered external, it needs to be in the external data source
     *     hash (cache).
     */
    isExternalDataSource(dataSource: import("ngeo/datasource/DataSource").default): boolean;
    /**
     * @returns {import('ol/layer/Group').default} Layer group where to push layers created by
     *     this service.
     */
    get layerGroup(): import("ol/layer/Group").default;
    /**
     * @param {?import('ol/Map').default} map Map
     */
    set map(map: import("ol/Map").default);
    /**
     * @param {import('ol/layer/Layer').default<import('ol/source/Source').default>} layer Layer.
     * @private
     */
    private addLayer_;
    /**
     * @param {import('ol/layer/Layer').default<import('ol/source/Source').default>} layer Layer.
     * @private
     */
    private removeLayer_;
    /**
     * @param {any} layer WMS Capability Layer object.
     * @param {any} capabilities  WMS Capabilities definition
     * @param {?string} url The WMS service url.
     */
    createAndAddDataSourceFromWMSCapability(layer: any, capabilities: any, url: string | null): void;
    /**
     * @param {any} layer WTMS Capability Layer object.
     * @param {any} capabilities  WMTS Capabilities definition
     * @param {string} wmtsUrl The WMTS capabilities url
     */
    createAndAddDataSourceFromWMTSCapability(layer: any, capabilities: any, wmtsUrl: string): void;
    /**
     * @param {File} file File.
     * @param {function(boolean):*?} opt_callback Callback called with true if the file is loaded and added.
     *     Otherwise with false.
     */
    createAndAddDataSourceFromFile(file: File, opt_callback: (arg0: boolean) => any | null): void;
    /**
     * Get file data source from cache, else create, store and return a new one.
     *
     * @param {File} file File.
     * @returns {angular.IPromise<ngeoDatasourceFile>} Promise
     * @private
     */
    private getFileDataSource_;
    /**
     * @param {import('ol/layer/WebGLTile').default<import('ol/source/Tile').default>} layer WMTS layer
     * @param {boolean|undefined} value Current visible property of the DS
     * @param {boolean|undefined} oldValue Old visible property of the DS
     * @private
     */
    private handleWMTSDataSourceVisibleChange_;
    /**
     * Called when a data source is removed from the collection of ngeo data
     * sources. If it's an external data source, remove it from its WMS Group
     *
     * @param {Event|import('ol/events/Event').default} evt Collection event.
     * @private
     */
    private handleDataSourcesRemove_;
    /**
     * Remove a data source from its group. Remove its layer from the map as well.
     *
     * Note: it is expected that the data source has already been removed
     * from the ngeo collection.
     *
     * @param {import('ngeo/datasource/File').default} dataSource External File data source.
     * @private
     */
    private removeFileDataSource_;
    /**
     * Remove the data source from its group. If the group no longer has
     * any data source in it, it is removed then destroyed and its layer is
     * removed from the map.
     *
     * Note: it is expected that the data source has already been removed
     * from the ngeo collection.
     *
     * @param {import('ngeo/datasource/OGC').default} dataSource External OGC data source.
     * @private
     */
    private removeOGCDataSource_;
    /**
     * @returns {boolean} is empty.
     */
    isEmpty(): boolean;
    /**
     * Remove all groups.
     */
    removeAll(): void;
}
export namespace ExternalDatSourcesManager {
    let $inject: string[];
}
export default myModule;
export type ExternalDataSourcesManagerWMTSCacheItem = {
    layerObj: import("ol/layer/WebGLTile").default<import("ol/source/Tile").default>;
    unregister: Function;
};
import ngeoDatasourceFileGroup from 'ngeo/datasource/FileGroup';
import ngeoDatasourceWMSGroup from 'ngeo/datasource/WMSGroup';
import olCollection from 'ol/Collection';
import ngeoDatasourceOGCGroup from 'ngeo/datasource/OGCGroup';
import angular from 'angular';
/**
 * @type {angular.IModule}
 * @hidden
 */
declare const myModule: angular.IModule;
