import { Nullable, ImageDatas } from '../../types'; import { ComputedRef, MaybeRef } from 'vue'; import { Map, StyleImageMetadata } from 'maplibre-gl'; /** * Image creation status enum for better state management */ export declare enum ImageStatus { NotCreated = "not-created", Loading = "loading", Created = "created", Updated = "updated", Error = "error" } interface CreateImageProps { map: MaybeRef>; id: string; image: ImageDatas | string; options?: Partial; debug?: boolean; /** * Force recreation when image dimensions change instead of throwing error. * When true (default), images are always removed and re-added to prevent dimension mismatch errors. * When false, uses the legacy behavior of trying updateImage first and falling back to recreation on error. */ forceRecreateOnDimensionChange?: boolean; } interface CreateImageActions { remove: () => void; loadImage: (imageUrl: string) => Promise; updateImage: (newImage: ImageDatas | string) => Promise; refreshImage: () => Promise; hasImage: () => boolean; imageStatus: ComputedRef; isImageReady: ComputedRef; loadPromise: Promise; } /** * Composable for creating and managing MapLibre GL Images * Provides reactive image management with error handling, performance optimizations, and enhanced API * * **Important:** MapLibre GL requires that updated images have the same dimensions as the previous version. * This composable automatically handles dimension changes by removing and re-adding images when necessary. * * @param props - Configuration options for the image * @returns Enhanced actions and state for the image */ export declare function useCreateImage(props: CreateImageProps): CreateImageActions; export {};