import { S as StyleSwitcherControlOptions, a as StyleSwitcherControl } from './index-CNZofLfG.js'; export { I as IControl, b as StyleItem, c as StyleSwitcherClassNames } from './index-CNZofLfG.js'; type MapInstance = any; interface UseStyleSwitcherOptions extends StyleSwitcherControlOptions { /** Position of the control on the map */ position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; } /** * React hook for using StyleSwitcherControl with any map instance * * @example * ```tsx * import { useEffect, useRef } from 'react'; * import { useStyleSwitcher } from 'map-gl-style-switcher/react'; * import maplibregl from 'maplibre-gl'; * * function MyMapComponent() { * const mapContainer = useRef(null); * const map = useRef(null); * * const styles = [ * { id: 'streets', name: 'Streets', styleUrl: 'mapbox://styles/mapbox/streets-v11' }, * { id: 'satellite', name: 'Satellite', styleUrl: 'mapbox://styles/mapbox/satellite-v9' } * ]; * * useEffect(() => { * if (!mapContainer.current) return; * * map.current = new maplibregl.Map({ * container: mapContainer.current, * style: styles[0].styleUrl, * center: [0, 0], * zoom: 2 * }); * * return () => map.current?.remove(); * }, []); * * useStyleSwitcher(map.current, { * styles, * theme: 'auto', * position: 'top-right' * }); * * return
; * } * ``` */ declare function useStyleSwitcher(map: MapInstance | null, options: UseStyleSwitcherOptions): StyleSwitcherControl | null; export { StyleSwitcherControl, StyleSwitcherControlOptions, useStyleSwitcher }; export type { UseStyleSwitcherOptions };