import * as react from 'react'; import react__default, { SVGProps, ReactNode, CSSProperties, Ref } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { GeoProjection, GeoPath } from 'd3-geo'; import { FeatureCollection, Feature, Geometry } from 'geojson'; import { Topology } from 'topojson-specification'; type ErrorBoundaryFallback = (error: Error, retry: () => void) => ReactNode; type Longitude = number & { __brand: 'longitude'; }; type Latitude = number & { __brand: 'latitude'; }; type Coordinates = [Longitude, Latitude]; type ScaleExtent = [number, number] & { __brand: 'scaleExtent'; }; type TranslateExtent = [Coordinates, Coordinates] & { __brand: 'translateExtent'; }; type RotationAngles = [number, number, number] & { __brand: 'rotationAngles'; }; type Parallels = [number, number] & { __brand: 'parallels'; }; type GraticuleStep = [number, number] & { __brand: 'graticuleStep'; }; declare const createLongitude: (value: number) => Longitude; declare const createLatitude: (value: number) => Latitude; declare const createCoordinates: (lon: number, lat: number) => Coordinates; declare const createScaleExtent: (min: number, max: number) => ScaleExtent; declare const createTranslateExtent: (topLeft: Coordinates, bottomRight: Coordinates) => TranslateExtent; declare const createParallels: (p1: number, p2: number) => Parallels; declare const createGraticuleStep: (x: number, y: number) => GraticuleStep; declare const createZoomConfig: (minZoom: number, maxZoom: number) => { minZoom: number; maxZoom: number; scaleExtent: ScaleExtent; enableZoom: boolean; }; declare const createPanConfig: (bounds: [Coordinates, Coordinates]) => { translateExtent: TranslateExtent; enablePan: boolean; }; declare const createZoomPanConfig: (minZoom: number, maxZoom: number, bounds: [Coordinates, Coordinates]) => { translateExtent: TranslateExtent; enablePan: boolean; minZoom: number; maxZoom: number; scaleExtent: ScaleExtent; enableZoom: boolean; }; type StyleVariant = 'default' | 'hover' | 'pressed' | 'focused'; type ConditionalStyle = { [K in StyleVariant]?: T; }; type GeographyPropsWithErrorHandling = T extends true ? { errorBoundary: true; onGeographyError: (error: Error) => void; fallback: ErrorBoundaryFallback; } : { errorBoundary?: false; onGeographyError?: (error: Error) => void; fallback?: never; }; type ZoomBehaviorProps = T extends true ? { enableZoom: true; minZoom: number; maxZoom: number; scaleExtent: ScaleExtent; } : { enableZoom?: false; minZoom?: never; maxZoom?: never; scaleExtent?: never; }; type PanBehaviorProps = T extends true ? { enablePan: true; translateExtent: TranslateExtent; } : { enablePan?: false; translateExtent?: never; }; type ProjectionConfigConditional = T extends 'geoAlbers' ? ProjectionConfig & Required> : T extends 'geoConicEqualArea' | 'geoConicConformal' ? ProjectionConfig & Required> : ProjectionConfig; type GeographyError = Error & { type: 'GEOGRAPHY_LOAD_ERROR' | 'GEOGRAPHY_PARSE_ERROR' | 'PROJECTION_ERROR' | 'VALIDATION_ERROR' | 'SECURITY_ERROR' | 'CONFIGURATION_ERROR' | 'CONTEXT_ERROR'; geography?: string; details?: Record; timestamp?: string; }; type ProjectionName = `geo${Capitalize}`; interface ProjectionConfig { center?: Coordinates; rotate?: RotationAngles; scale?: number; parallels?: Parallels; } interface MapContextType { width: number; height: number; projection: GeoProjection; path: GeoPath; } interface ZoomPanContextType { x: number; y: number; k: number; transformString: string; } interface ComposableMapProps

extends SVGProps { width?: number; height?: number; projection?: ProjectionName | P | GeoProjection; projectionConfig?: ProjectionConfigConditional

; className?: string; children?: ReactNode; onGeographyError?: (error: Error) => void; fallback?: ReactNode; debug?: boolean; metadata?: M extends true ? Required<{ title: string; description: string; keywords: string[]; author?: string; canonicalUrl?: string; }> : { title?: string; description?: string; keywords?: string[]; author?: string; canonicalUrl?: string; }; } type GeographiesProps = Omit, 'children' | 'onError'> & GeographyPropsWithErrorHandling & { geography: string | Topology | FeatureCollection; children: (props: { geographies: Feature[]; outline: string; borders: string; path: GeoPath; projection: GeoProjection; }) => ReactNode; parseGeographies?: (geographies: Feature[]) => Feature[]; className?: string; }; interface GeographyEventData { geography: Feature; centroid: Coordinates | null; bounds: [Coordinates, Coordinates] | null; coordinates: Coordinates | null; } interface GeographyProps extends Omit, 'style' | 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseDown' | 'onMouseUp' | 'onFocus' | 'onBlur'> { geography: Feature; onClick?: (event: React.MouseEvent, data?: GeographyEventData) => void; onMouseEnter?: (event: React.MouseEvent, data?: GeographyEventData) => void; onMouseLeave?: (event: React.MouseEvent, data?: GeographyEventData) => void; onMouseDown?: (event: React.MouseEvent, data?: GeographyEventData) => void; onMouseUp?: (event: React.MouseEvent, data?: GeographyEventData) => void; onFocus?: (event: React.FocusEvent, data?: GeographyEventData) => void; onBlur?: (event: React.FocusEvent, data?: GeographyEventData) => void; style?: ConditionalStyle; className?: string; } type ZoomableGroupProps = SVGProps & ZoomBehaviorProps & PanBehaviorProps

& { center?: Coordinates; zoom?: number; filterZoomEvent?: (event: Event) => boolean; onMoveStart?: (position: Position, event: Event) => void; onMove?: (position: Position, event: Event) => void; onMoveEnd?: (position: Position, event: Event) => void; className?: string; children?: ReactNode; }; interface SimpleZoomableGroupProps extends SVGProps { center?: Coordinates; zoom?: number; minZoom?: number; maxZoom?: number; translateExtent?: TranslateExtent; scaleExtent?: ScaleExtent; enableZoom?: boolean; enablePan?: boolean; filterZoomEvent?: (event: Event) => boolean; onMoveStart?: (position: Position, event: Event) => void; onMove?: (position: Position, event: Event) => void; onMoveEnd?: (position: Position, event: Event) => void; className?: string; children?: ReactNode; } type ZoomableGroupPropsUnion = ZoomableGroupProps | ZoomableGroupProps | ZoomableGroupProps | ZoomableGroupProps | SimpleZoomableGroupProps; interface MarkerProps extends Omit, 'style'> { coordinates: Coordinates; onMouseEnter?: (event: React.MouseEvent) => void; onMouseLeave?: (event: React.MouseEvent) => void; onMouseDown?: (event: React.MouseEvent) => void; onMouseUp?: (event: React.MouseEvent) => void; onFocus?: (event: React.FocusEvent) => void; onBlur?: (event: React.FocusEvent) => void; style?: ConditionalStyle; className?: string; children?: ReactNode; } interface LineProps extends Omit, 'from' | 'to'> { from: Coordinates; to: Coordinates; coordinates?: Coordinates[]; className?: string; } interface AnnotationProps extends SVGProps { subject: Coordinates; dx?: number; dy?: number; curve?: number; connectorProps?: SVGProps; className?: string; children?: ReactNode; } interface GraticuleProps extends SVGProps { step?: GraticuleStep; className?: string; } interface SphereProps extends SVGProps { id?: string; className?: string; } interface UseGeographiesProps { geography: string | Topology | FeatureCollection; parseGeographies?: (geographies: Feature[]) => Feature[]; } interface PreparedFeature extends Feature { svgPath: string; rsmKey: string; } interface GeographyData { geographies: PreparedFeature[]; outline: string; borders: string; isLoading: boolean; error: GeographyError | Error | null; center?: Coordinates; /** Re-runs the fetch for string `geography` URLs (no-op for object geographies). */ refetch?: () => void; } interface ZoomPanState { x: number; y: number; k: number; } interface Position { coordinates: Coordinates; zoom: number; } declare function ComposableMap({ width, height, projection, projectionConfig, className, debug, children, ref, ...restProps }: Omit & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace ComposableMap { var displayName: string; } declare const _default$6: react.MemoExoticComponent; /** * Predefined metadata configurations for common map types */ declare const mapMetadataPresets: { worldMap: { title: string; description: string; keywords: string[]; author: string; ogTitle: string; ogDescription: string; twitterTitle: string; twitterDescription: string; jsonLd: { '@context': string; '@type': string; name: string; description: string; mapType: string; }; }; countryMap: (countryName: string) => { title: string; description: string; keywords: string[]; author: string; ogTitle: string; ogDescription: string; twitterTitle: string; twitterDescription: string; jsonLd: { '@context': string; '@type': string; name: string; description: string; mapType: string; about: { '@type': string; name: string; }; }; }; cityMap: (cityName: string, countryName?: string) => { title: string; description: string; keywords: string[]; author: string; ogTitle: string; ogDescription: string; twitterTitle: string; twitterDescription: string; jsonLd: { '@context': string; '@type': string; name: string; description: string; mapType: string; about: { containedInPlace?: { '@type': string; name: string; }; '@type': string; name: string; }; }; }; dataVisualization: (dataType: string) => { title: string; description: string; keywords: string[]; author: string; ogTitle: string; ogDescription: string; twitterTitle: string; twitterDescription: string; jsonLd: { '@context': string; '@type': string; name: string; description: string; distribution: { '@type': string; encodingFormat: string; }; }; }; }; interface MapWithMetadataProps extends ComposableMapProps { metadata: Required>; enableSEO?: boolean; enableOpenGraph?: boolean; enableTwitterCards?: boolean; enableJsonLd?: boolean; preset?: keyof typeof mapMetadataPresets; } declare function MapWithMetadata({ metadata, enableSEO, enableOpenGraph, enableTwitterCards, enableJsonLd, preset, children, ...mapProps }: MapWithMetadataProps): react_jsx_runtime.JSX.Element; declare namespace MapWithMetadata { var displayName: string; } declare const _default$5: react.MemoExoticComponent; declare function Geographies({ geography, children, parseGeographies, className, errorBoundary, onGeographyError, fallback, ref, ...restProps }: GeographiesProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace Geographies { var displayName: string; } declare const _default$4: react.MemoExoticComponent; declare function Geography({ geography, onClick, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onFocus, onBlur, style, className, ref, ...restProps }: GeographyProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace Geography { var displayName: string; } declare const _default$3: react.MemoExoticComponent; declare function Graticule({ fill, stroke, step, className, ref, ...restProps }: GraticuleProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace Graticule { var displayName: string; } declare const _default$2: react.MemoExoticComponent; declare function ZoomableGroup(props: ZoomableGroupPropsUnion & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace ZoomableGroup { var displayName: string; } declare function Sphere({ id, fill, stroke, strokeWidth, className, ref, ...restProps }: SphereProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace Sphere { var displayName: string; } declare const _default$1: react.MemoExoticComponent; declare function Marker({ coordinates, children, onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onFocus, onBlur, style, className, ref, ...restProps }: MarkerProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element | null; declare namespace Marker { var displayName: string; } declare const _default: react.MemoExoticComponent; declare function Line({ from, to, coordinates, stroke, strokeWidth, fill, className, ref, ...restProps }: LineProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element; declare namespace Line { var displayName: string; } declare function Annotation({ subject, children, connectorProps, dx, dy, curve, className, ref, ...restProps }: AnnotationProps & { ref?: Ref; }): react_jsx_runtime.JSX.Element | null; declare namespace Annotation { var displayName: string; } declare const MapContext: react__default.Context; interface MapProviderProps { width: number; height: number; projection?: string | GeoProjection; projectionConfig?: ProjectionConfig; children: ReactNode; } declare const MapProvider: react__default.FC; declare const useMapContext: () => MapContextType; declare const ZoomPanContext: react__default.Context; interface ZoomPanProviderProps { value?: ZoomPanContextType; children: ReactNode; } declare const ZoomPanProvider: react__default.FC; declare const useZoomPanContext: () => ZoomPanContextType; declare function useGeographies({ geography, parseGeographies, }: UseGeographiesProps): GeographyData; interface UseZoomPanHookProps { center: Coordinates; filterZoomEvent?: (event: Event) => boolean; onMoveStart?: (position: Position, event: Event) => void; onMoveEnd?: (position: Position, event: Event) => void; onMove?: (position: Position, event: Event) => void; translateExtent?: TranslateExtent; scaleExtent?: ScaleExtent; zoom?: number; } interface UseZoomPanReturn { mapRef: React.RefObject; position: { x: number; y: number; k: number; dragging?: Event | undefined; }; transformString: string; isPending: boolean; } declare function useZoomPan({ center, filterZoomEvent, onMoveStart, onMoveEnd, onMove, translateExtent, scaleExtent, zoom, }: UseZoomPanHookProps): UseZoomPanReturn; interface GeographyErrorBoundaryProps { children: ReactNode; fallback?: (error: Error, retry: () => void) => ReactNode; onError?: (error: Error) => void; } declare function GeographyErrorBoundary({ children, fallback, onError, }: GeographyErrorBoundaryProps): react_jsx_runtime.JSX.Element; /** * Calculates the centroid (center point) of a geographic feature * @param geography - GeoJSON feature * @returns Centroid coordinates or null if calculation fails */ declare function getGeographyCentroid(geography: Feature): Coordinates | null; /** * Calculates the bounding box of a geographic feature * @param geography - GeoJSON feature * @returns Bounding box as [southwest, northeast] coordinates or null if calculation fails */ declare function getGeographyBounds(geography: Feature): [Coordinates, Coordinates] | null; declare function getGeographyCoordinates(geography: Feature): Coordinates | null; /** * Gets the best available coordinate representation for a geography * Tries centroid first, falls back to first coordinate * @param geography - GeoJSON feature * @returns Best available coordinates or null */ declare function getBestGeographyCoordinates(geography: Feature): Coordinates | null; /** * Type guard to check if coordinates are valid * @param coords - Coordinates to validate * @returns True if coordinates are valid */ declare function isValidCoordinates(coords: unknown): coords is Coordinates; export { Annotation, _default$6 as ComposableMap, _default$4 as Geographies, _default$3 as Geography, GeographyErrorBoundary, _default$2 as Graticule, Line, MapContext, MapProvider, _default$5 as MapWithMetadata, _default as Marker, _default$1 as Sphere, ZoomPanContext, ZoomPanProvider, ZoomableGroup, createCoordinates, createGraticuleStep, createLatitude, createLongitude, createPanConfig, createParallels, createScaleExtent, createTranslateExtent, createZoomConfig, createZoomPanConfig, getBestGeographyCoordinates, getGeographyBounds, getGeographyCentroid, getGeographyCoordinates, isValidCoordinates, useGeographies, useMapContext, useZoomPan, useZoomPanContext }; export type { AnnotationProps, ComposableMapProps, Coordinates, GeographiesProps, GeographyData, GeographyEventData, GeographyProps, GraticuleProps, Latitude, LineProps, Longitude, MapContextType, MapWithMetadataProps, MarkerProps, Position, PreparedFeature, ProjectionConfig, SimpleZoomableGroupProps, SphereProps, UseGeographiesProps, ZoomPanContextType, ZoomPanState, ZoomableGroupProps, ZoomableGroupPropsUnion };