import { BeEvent } from "@itwin/core-bentley"; import { MapLayerSource } from "@itwin/core-frontend"; import type { GuidString } from "@itwin/core-bentley"; /** @internal */ export interface MapLayerPreferencesContent { url: string; name: string; formatId: string; transparentBackground: boolean | undefined; } /** @internal */ export declare enum MapLayerSourceChangeType { Added = 0, Removed = 1, Replaced = 2 } /** @internal */ export interface MapLayerSourceArg { readonly source: MapLayerSource; readonly iTwinId: GuidString; readonly iModelId: GuidString; } /** A wrapper around user preferences to provide a way to store [[MapLayerSettings]]. * * Note: This is currently internal only and used directly by the MapLayersExtension. It makes use of the IModelApp.authorizationClient if it exists. * * @internal */ export declare class MapLayerPreferences { /** Event raised whenever a source is added, replaced or removed: * changeType : Type of changed occurred. * oldSource : Source that was removed or replaced. * newSource : Source that was added or replacement of oldSource. * * @see [[MapLayerSourceChangeType]] */ static readonly onLayerSourceChanged: BeEvent<(changeType: MapLayerSourceChangeType, oldSource?: MapLayerSource, newSource?: MapLayerSource) => void>; /** Store the Map Layer source preference. If the same setting exists at a higher level, an error will be thrown and the setting will not be updated. * * Returns false if the settings object would override some other settings object in a larger scope i.e. storing settings on model when * a project setting exists with same name or map layer url. * @param source source to be stored on the setting service * @param storeOnIModel if true store the settings object on the model, if false store it on the project */ static storeSource(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString, storeOnIModel?: boolean): Promise; /** Replace the old map layer source with a new map layer source. * * The source is replaced at the same level that the original source is defined. (i.e. if the old source is defined at a project level, the new source will also be defined there.) * * @param oldSource * @param newSource * @param iTwinId * @param iModelId */ static replaceSource(oldSource: MapLayerSource, newSource: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise; /** Deletes the provided MapLayerSource by name from both the iTwin or iModel level. * * @param source The source to delete. The name is used to identify the source. * @param iTwinId * @param iModelId */ static deleteByName(source: MapLayerSource, iTwinId: GuidString, iModelId?: GuidString): Promise; /** Deletes the current setting with the provided key if it is defined at the same preference level. * * If the preference is defined within a different level, false will be returned indicating the setting should not be overriden. * * The two potential preference levels are iTwin and iModel. * * @param url * @param name * @param iTwinId * @param iModelId * @param storeOnIModel */ private static delete; /** Attempts to get a map layer based off a specific url. * @param url * @param iTwinId * @param iModelId */ static getByUrl(url: string, iTwinId: string, iModelId?: string): Promise; /** Get all MapLayerSources from the user's preferences, iTwin setting and iModel settings. * @param iTwinId id of the iTwin * @param iModelId id of the iModel * @throws if any of the calls to grab settings fail. */ static getSources(iTwinId: GuidString, iModelId?: GuidString): Promise; private static get _preferenceNamespace(); } //# sourceMappingURL=MapLayerPreferences.d.ts.map