import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode, CSSProperties } from 'react'; import { DistrictDataMap, Province } from './data.mjs'; export { DISTRICTS, DISTRICT_NAMES, DISTRICT_PROVINCE, DistrictData, DistrictPath, PROVINCES, PROVINCE_COLORS, PROVINCE_NAMES, ProvinceInfo } from './data.mjs'; type TooltipPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "follow-cursor"; interface NepalMapProps { /** Data to visualize on the map. Keys are district names. */ data?: DistrictDataMap; /** Color mode for districts without explicit color in data */ colorMode?: "province" | "flat" | "data"; /** Base fill color when colorMode is "flat" (default: "#e2e8f0") */ baseColor?: string; /** Stroke color for district borders (default: "#94a3b8") */ strokeColor?: string; /** Stroke width for district borders (default: 0.5) */ strokeWidth?: number; /** Hovered district stroke color (default: "#FFD600") */ hoverColor?: string; /** Background color of the map container (default: "transparent") */ backgroundColor?: string; /** Show district name labels on the map (default: true) */ showLabels?: boolean; /** Font size for district labels (default: 9) */ labelFontSize?: number; /** Label color (default: "rgba(255,255,255,0.9)") */ labelColor?: string; /** Show a tooltip on hover (default: true) */ showTooltip?: boolean; /** Tooltip position (default: "top-right") */ tooltipPosition?: TooltipPosition; /** Custom tooltip renderer. Receives district name and data. */ renderTooltip?: (districtName: string, data?: DistrictDataMap[string]) => ReactNode; /** Format function for the default tooltip's `value` field */ valueFormatter?: (value: number) => string; /** Called when a district is clicked */ onDistrictClick?: (districtName: string, data?: DistrictDataMap[string]) => void; /** Called when mouse enters a district */ onDistrictHover?: (districtName: string | null) => void; /** Province to highlight (dims all others) */ selectedProvince?: Province | null; /** * Programmatically highlight specific districts (e.g. search results). * Highlighted districts get a glow and stronger stroke. */ highlightedDistricts?: string[]; /** Color used for highlighted districts' stroke (default: "#FFD600") */ highlightColor?: string; /** Override province colors */ provinceColors?: Partial>; /** Custom short names for districts (e.g. { Kathmandu: "KTM" }) */ shortNames?: Record; /** CSS class for the root container */ className?: string; /** Inline styles for the root container */ style?: CSSProperties; /** Max height of the SVG (default: "560px") */ maxHeight?: string; /** viewBox for the SVG (default: "0 0 1200 800") */ viewBox?: string; /** Color scale function for data mode. Receives value, returns fill color. */ colorScale?: (value: number) => string; /** Accessible label for the map (default: "Interactive map of Nepal") */ ariaLabel?: string; /** Dim opacity for non-selected provinces (default: 0.2) */ dimOpacity?: number; /** Animation duration in ms for transitions (default: 200, set 0 to disable) */ transitionDuration?: number; /** Disable all interactions (hover, click, keyboard) — view-only mode (default: false) */ disabled?: boolean; } declare function NepalMap({ data, colorMode, baseColor, strokeColor, strokeWidth, hoverColor, backgroundColor, showLabels, labelFontSize, labelColor, showTooltip, tooltipPosition, renderTooltip, valueFormatter, onDistrictClick, onDistrictHover, selectedProvince, highlightedDistricts, highlightColor, provinceColors, shortNames, className, style, maxHeight, viewBox, colorScale, ariaLabel, dimOpacity, transitionDuration, disabled, }: NepalMapProps): react_jsx_runtime.JSX.Element; interface LegendItem { /** Color swatch */ color: string; /** Label text */ label: string; /** Optional value to display */ value?: string | number; } interface NepalMapLegendProps { /** Legend mode */ mode?: "province" | "custom"; /** Custom legend items (used when mode is "custom") */ items?: LegendItem[]; /** Layout direction (default: "horizontal") */ direction?: "horizontal" | "vertical"; /** Swatch shape (default: "circle") */ swatchShape?: "circle" | "square"; /** Swatch size in px (default: 12) */ swatchSize?: number; /** Font size for labels (default: 12) */ fontSize?: number; /** Label color (default: "#64748b") */ labelColor?: string; /** Currently selected province (highlights matching item) */ selectedProvince?: Province | null; /** Called when a province legend item is clicked */ onProvinceClick?: (province: Province) => void; /** CSS class for the container */ className?: string; /** Inline styles for the container */ style?: CSSProperties; /** Custom render for each legend item */ renderItem?: (item: LegendItem, index: number) => ReactNode; } declare function NepalMapLegend({ mode, items: customItems, direction, swatchShape, swatchSize, fontSize, labelColor, selectedProvince, onProvinceClick, className, style, renderItem, }: NepalMapLegendProps): react_jsx_runtime.JSX.Element; /** * Get all district names belonging to a province. */ declare function getDistrictsByProvince(province: Province): string[]; /** * Get the province a district belongs to. * Returns undefined if the district name is not found. */ declare function getProvinceByDistrict(districtName: string): Province | undefined; /** * Get summary stats from a DistrictDataMap. * Useful for building legends and info panels. */ declare function getDataStats(data: DistrictDataMap): { min: number; max: number; count: number; total: number; average: number; }; /** * Generate a linear color scale function between two colors. * Returns a function that maps a value in [min, max] to a hex color. * * @example * const scale = createColorScale(0, 100, "#22c55e", "#dc2626"); * scale(50); // midpoint color */ declare function createColorScale(min: number, max: number, fromColor: string, toColor: string): (value: number) => string; /** * Generate a multi-stop color scale. * Stops are evenly distributed between min and max. * * @example * const scale = createMultiColorScale(0, 100, ["#22c55e", "#eab308", "#dc2626"]); * scale(25); // between green and yellow * scale(75); // between yellow and red */ declare function createMultiColorScale(min: number, max: number, colors: string[]): (value: number) => string; /** * Get the total number of districts. */ declare function getTotalDistricts(): number; /** * Get province-wise summary from data. */ declare function getProvinceSummary(data: DistrictDataMap): Array<{ province: Province; color: string; totalDistricts: number; coveredDistricts: number; totalValue: number; }>; export { DistrictDataMap, type LegendItem, NepalMap, NepalMapLegend, type NepalMapLegendProps, type NepalMapProps, Province, type TooltipPosition, createColorScale, createMultiColorScale, getDataStats, getDistrictsByProvince, getProvinceByDistrict, getProvinceSummary, getTotalDistricts };