import { CreateBaseLayerActions, LayerTypes, Nullable } from '../../types'; import { FilterSpecification, LayerSpecification, Map, SourceSpecification } from 'maplibre-gl'; import { ComputedRef, MaybeRef } from 'vue'; /** * Layer creation status enum for better state management */ export declare enum LayerStatus { NotCreated = "not-created", Creating = "creating", Created = "created", Error = "error" } export interface CreateBaseLayerProps { map: MaybeRef>; id?: string; source: MaybeRef; type: LayerTypes; beforeId?: string; filter?: FilterSpecification; layout?: Layer['layout']; paint?: Layer['paint']; maxzoom?: number; minzoom?: number; metadata?: object; sourceLayer?: string; debug?: boolean; register?: (actions: CreateBaseLayerActions, map: Map) => void; } export interface EnhancedLayerActions extends CreateBaseLayerActions { layerStatus: ComputedRef; isLayerReady: ComputedRef; refreshLayer: () => void; updateLayer: (updates: { filter?: FilterSpecification; minzoom?: number; maxzoom?: number; paint?: Record; layout?: Record; }) => void; } /** * Composable for creating and managing MapLibre GL Layers * Provides reactive layer management with error handling, performance optimizations, and enhanced API * * @param cfg - Configuration options for the layer * @returns Enhanced actions and state for the layer */ export declare function useCreateLayer(cfg: CreateBaseLayerProps): EnhancedLayerActions;