import type { BaseDatasetManager } from "@metoceanapi/wxtiles-common/managers/BaseDatasetManager"; import type { WxLayerOptions } from "@metoceanapi/wxtiles-common/types"; import { WxLayer as InnerWxLayer } from "@metoceanapi/wxtiles-common/wxlayer/wxlayer"; import L from "leaflet"; /** * **FrameworkParentClass** * * A framework-specific base class for custom layer sources. * * - In **Leaflet**, this class extends `L.GridLayer`, which serves as a parent type for tile-based layers. * - In **Mapbox**, a similar universal parent type does not exist, so this class provides a unified interface * for creating custom sources that integrate seamlessly across frameworks. * * This class acts as a foundation for the {@link WxTileSource} implementation and can be extended * to include framework-specific behavior where required. * * @example * ```ts * const layerOptions: FrameworkOptions = { * id: 'weatherLayer', * opacity: 0.8, * attribution: 'WxTiles', * }; * const customLayer = new FrameworkParentClass(layerOptions); * customLayer.addTo(map); * ``` */ export declare class FrameworkParentClass extends L.GridLayer { /** * **Unique Layer Identifier** * * A required unique identifier for the layer. Useful for managing multiple layers * and tracking them within a map instance. */ id: string; /** * @ignore * An instance of the layer * */ readonly _layer: InnerWxLayer; /** * Creates an instance of the **FrameworkParentClass**. * * @param {FrameworkOptions} options - The framework-specific options for creating a grid-based layer. * @param {string} options.id - A unique identifier for the layer. * @param {number} [options.opacity] - Opacity of the layer (0 - fully transparent, 1 - fully opaque). * @param {string} [options.attribution] - Attribution text for this layer (shown on the map). * @param {boolean} [options.interactive] - Whether the layer responds to mouse events. */ constructor(options: FrameworkOptions, wxLayerOptions: WxLayerOptions); } /** * **FrameworkOptions** * * Options for creating a custom weather layer in Leaflet. * * This interface extends the **L.GridLayerOptions** interface provided by Leaflet, * adding a mandatory `id` field to uniquely identify the layer. * * @extends {L.GridLayerOptions} * * @example * ```ts * function addWeatherLayer(map: MapInstance) { * try { * const options: FrameworkOptions = { * id: 'customWeatherLayer', * opacity: 0.7, * attribution: 'Weather Tiles © 2024', * interactive: true, * }; * * const weatherLayer = new FrameworkParentClass(options); * map.addLayer(weatherLayer); * * console.log('Weather layer added:', weatherLayer); * } catch (error) { * console.error('Error adding weather layer:', error); * } * } * * // Example usage (assuming `map` is defined) * addWeatherLayer(map); * ``` */ export interface FrameworkOptions extends L.GridLayerOptions { /** * **Layer Identifier** * * A unique string used to identify the layer instance. Required for distinguishing * between multiple layers, especially when managing or removing them from the map. */ id: string; }