import { MapModel } from "../../model/MapModel"; import { InternalConstructorTag } from "../../utils/InternalConstructorTag"; import type { LayerLoadInfo, LayerLoadState } from "../AbstractLayer"; import { AbstractLayerBase } from "../AbstractLayerBase"; import { ATTACH_TO_MAP, ATTACH_TO_PARENT, DETACH_FROM_MAP, SET_LEGEND } from "../shared/internals"; import { LayerBaseConfig } from "../shared/LayerConfig"; import { SublayerBaseType } from "../shared/SublayerBaseType"; import { SublayersCollection } from "../shared/SublayersCollection"; import { WMSLayer } from "../WMSLayer"; /** * Configuration options to construct the sublayers of a {@link WMSLayer}. * * @group Layers */ export interface WMSSublayerConfig extends LayerBaseConfig { /** * The name of the WMS sublayer in the service's capabilities. * Not mandatory, e.g. for WMS group layer. See [WMS spec](https://www.ogc.org/standard/wms/). */ name?: string; /** Configuration for nested sublayers. */ sublayers?: WMSSublayerConfig[]; } export declare const SET_SUBLAYER_LOAD_INFO: unique symbol; /** * Represents a sublayer of a {@link WMSLayer}. * * @group Layers */ export declare class WMSSublayer extends AbstractLayerBase implements SublayerBaseType { #private; /** * @internal */ constructor(config: WMSSublayerConfig, tag: InternalConstructorTag); get type(): "wms-sublayer"; /** * The name of the WMS sublayer in the service's capabilities. * * Is optional as a WMS group layer in a WMS service does not need to have a name. */ get name(): string | undefined; get layers(): undefined; get sublayers(): SublayersCollection; get parent(): WMSSublayer | WMSLayer; get parentLayer(): WMSLayer; get legend(): string | undefined; get loadState(): LayerLoadState; /** * The error (if any) that prevented this sublayer from loading. */ get loadError(): Error | undefined; get visible(): boolean; /** * Called by the parent layer when it is attached to the map to attach all sublayers. * * @internal */ [ATTACH_TO_MAP](map: MapModel): void; /** @internal */ [DETACH_FROM_MAP](): void; /** * Attaches this sublayer to its parent _layer_ and its immediate parent _layer or sublayer_. * * @internal */ [ATTACH_TO_PARENT](parentLayer: WMSLayer, parent: WMSLayer | WMSSublayer): void; /** * Called by the parent layer to update the legend on load. * * @internal */ [SET_LEGEND](legendUrl: string | undefined): void; /** * Called by the parent layer once the capabilities have been validated. * * @internal */ [SET_SUBLAYER_LOAD_INFO](loadInfo: LayerLoadInfo): void; setVisible(newVisibility: boolean): void; } /** * Constructs a tree of wms sublayers from a nested configuration object. */ export declare function constructSublayers(sublayerConfigs?: WMSSublayerConfig[]): WMSSublayer[];