import SpatialReference from "@arcgis/core/geometry/SpatialReference"; import type { Activator } from "../../Activator"; interface MapViewLike { layers?: __esri.Collection; map?: __esri.Map | null | undefined; } /** Extension for ESRI map views. */ interface ViewExtension { } /** Extension for ESRI sublayers. */ interface SublayerExtension { } /** Extension for ESRI map. */ interface MapExtension { } /** Exposes map information. */ export interface MapInfo { /** Gets the center. */ getCenter(): __esri.Point | undefined; /** Gets the extent. */ getExtent(): __esri.Extent | undefined; /** Gets the scale. */ getScale(): number | undefined; /** Gets the spatial reference. */ getSpatialReference(): __esri.SpatialReference | undefined; } export declare function layerCanChangeDefinitionExpression(layer: __esri.Layer): boolean; export declare function sublayerCanChangeDefinitionExpression(sublayer: __esri.Sublayer): boolean; /** * Provides functionality which affects the map. * @public */ export declare class MapProvider implements MapInfo { static type: string; /** Indicates the layer. */ layer?: __esri.Layer; /** Indicates the map. */ map?: __esri.Map & MapExtension; /** Indicates the map name. */ mapName?: string; /** Indicates the sublayer. */ sublayer?: (__esri.Sublayer & SublayerExtension) | { id?: string | number; visible?: boolean; }; /** Indicates the map name. */ type?: typeof MapProvider; /** Indicates the view. */ view?: __esri.View & ViewExtension; constructor(type: typeof MapProvider, mapView?: MapViewLike, mapName?: string); /** Creates an instance of this class. */ static create(): MapProvider; /** Gets the output SR (or the default). */ static getOutSR(sr?: __esri.SpatialReference | number | string): __esri.SpatialReference | undefined; /** Registers the provider class with the activator. */ static register(activator: Activator): void; /** Adds popup to the template. */ static setPopup(template: object, features: __esri.Graphic[]): void; /** Adds features to the layer. */ addFeatures(features: __esri.Graphic[], layerId: string | number): __esri.Graphic[]; /** Clears features from the map/layer. */ clearFeatures(): boolean; /** Clones this provider. */ clone(): MapProvider; /** Finds the layer. */ findLayer(id: string | number, parent?: __esri.Layer): MapProvider | undefined; /** * Finds a table in the map. * @param id The unique id of the table. * @param mapServiceId The unique id of the map service that the table belongs to. */ findTable(id: string, mapServiceId?: string): MapProvider | undefined; /** Gets the center. */ getCenter(): __esri.Point | undefined; /** Gets the definition expression for the map/layer. */ getDefinitionExpression(): string | undefined; /** Gets the extent. */ getExtent(): __esri.Extent | undefined; /** Gets features from the map/layer. */ getFeatures(): __esri.Graphic[] | undefined; /** * Gets the definition expression for the layer/sublayer that was present when it was first loaded. * @param layerId The unique id of the layer. * @param sublayerId (optional) The unique id of the sublayer. * @returns The definition expression for the layer/sublayer that was present when it was first loaded. */ getInitialDefinitionExpression(layerId: string, sublayerId?: number): string | null | undefined; /** * Gets the initial definition expressions for all layers and sublayers * that were present when the map was first loaded. * @param onlyInitialLayers If true, only layers that were initially loaded with the map will be returned. * Otherwise, all layers currently present in the map will be returned. * @returns The initial definition expressions for all layers and sublayers. The key is the layerId * and sublayerId (if applicable) separated by a semicolon, and the value is the definition expression. */ getInitialDefinitionExpressions(onlyInitialLayers: boolean): Record; /** Gets the property's value for the map/layer. */ getProperty(name: "mosaicRule"): __esri.MosaicRule; getProperty(name: "rasterFunction"): __esri.RasterFunction; getProperty(name: "renderingRule"): __esri.RasterFunction; getProperty(name: "pixelFilter"): __esri.PixelFilterFunction; getProperty(name: string): any; /** Gets the scale. */ getScale(): number | undefined; /** Gets the spatial reference. */ getSpatialReference(): SpatialReference | undefined; /** Gets the viewpoint. */ getViewpoint(): __esri.Viewpoint | undefined; /** Gets the visibility for the map/layer. */ getVisible(): boolean | undefined; /** Loads the map/layer. */ load(): PromiseLike; /** Redraws the layer. */ redraw(): void; /** Removes features from the map/layer. */ removeFeatures(features: __esri.Graphic[]): true | undefined; /** Removes the layer. */ removeLayer(): boolean; /** * Resets the definition expression for the layer or sublayer * to its initial state from when the map was loaded. */ resetDefinitionExpression(): string | nullish; /** * Resets the definition expression for all layers and sublayers * to their initial state from when the map was loaded. * @param onlyInitialLayers If true, only layers that were initially loaded with the map will be reset. * Otherwise, all layers currently present in the map will be reset. */ resetDefinitionExpressions: (onlyInitialLayers: boolean) => void; /** Sets the definition expression for the map/layer. */ setDefinitionExpression(clause: string): boolean | undefined; /** Sets the extent. */ setExtent(target: __esri.Geometry[], scale?: number): PromiseLike; /** * Sets the definition expression for the layer/sublayer to be used as its initial state. * This should only be used for layers/sublayers that were added after the map was loaded. * @param layerId The unique id of the layer. * @param sublayerId The unique id of the sublayer, or undefined if this is not for a sublayer. * @param definitionExpression The initial definition expression to store for the layer/sublayer. */ setInitialDefinitionExpression(layerId: string, sublayerId: number | undefined, definitionExpression: string | null | undefined): void; /** Adds popup to the map/layer. */ setPopup(template: object): void; /** Sets the `mosaicRule` property on the current layer. */ setProperty(name: "mosaicRule", value: __esri.MosaicRule): boolean; /** Sets the `rasterFunction` property on the current layer. */ setProperty(name: "rasterFunction", value: __esri.RasterFunction): boolean; /** Sets the `renderingRule` property on the current layer. */ setProperty(name: "renderingRule", value: __esri.RasterFunction): boolean; /** Sets the `pixelFilter` property on the current layer. */ setProperty(name: "pixelFilter", value: __esri.PixelFilterFunction): boolean; /** Sets the specified property on the current layer. */ setProperty(name: string, value: any): boolean; /** Sets the viewpoint. */ setViewpoint(target: __esri.Geometry[], viewpoint?: __esri.Viewpoint): PromiseLike; /** Sets the visibility for the map/layer. */ setVisible(visible: boolean): boolean; /** Shows a popup for a given feature collection */ showPopup(features: __esri.Graphic[]): void; /** * Allows sub classes to convert ids to a different format, * to suit their implementation. * @param id The unique id of a sublayer. */ protected formatSubLayerId(id: any): any; /** Loads the layer if applicable. */ protected loadLayer(): PromiseLike | undefined; /** Loads the map if applicable. */ protected loadMap(): PromiseLike | undefined; /** Loads the view if applicable. */ protected loadView(): PromiseLike | undefined; } export {};