import * as React from 'react'; import React__default from 'react'; import GeoJSON from 'geojson'; declare const ISO_CODES: readonly ["FJ", "TZ", "EH", "CA", "US", "KZ", "UZ", "PG", "ID", "AR", "CL", "CD", "SO", "KE", "SD", "TD", "HT", "DO", "RU", "BS", "FK", "NO", "GL", "TL", "ZA", "LS", "MX", "UY", "BR", "BO", "PE", "CO", "PA", "CR", "NI", "HN", "SV", "GT", "BZ", "VE", "GY", "SR", "FR", "EC", "PR", "JM", "CU", "ZW", "BW", "NA", "SN", "ML", "MR", "BJ", "NE", "NG", "CM", "TG", "GH", "CI", "GN", "GW", "LR", "SL", "BF", "CF", "CG", "GA", "GQ", "ZM", "MW", "MZ", "SZ", "AO", "BI", "IL", "LB", "MG", "PS", "GM", "TN", "DZ", "JO", "AE", "QA", "KW", "IQ", "OM", "VU", "KH", "TH", "LA", "MM", "VN", "KP", "KR", "MN", "IN", "BD", "BT", "NP", "PK", "AF", "TJ", "KG", "TM", "IR", "SY", "AM", "SE", "BY", "UA", "PL", "AT", "HU", "MD", "RO", "LT", "LV", "EE", "DE", "BG", "GR", "TR", "AL", "HR", "CH", "LU", "BE", "NL", "PT", "ES", "IE", "NC", "SB", "NZ", "AU", "LK", "CN", "TW", "IT", "DK", "GB", "IS", "AZ", "GE", "PH", "MY", "BN", "SI", "FI", "SK", "CZ", "ER", "JP", "PY", "YE", "SA", "CY", "MA", "EG", "LY", "ET", "DJ", "UG", "RW", "BA", "MK", "RS", "ME", "XK", "TT", "SS"]; type ISOCode = (typeof ISO_CODES)[number] | Lowercase<(typeof ISO_CODES)[number]>; type SizeOption = "sm" | "md" | "lg" | "xl" | "xxl"; /** Map projection. `"mercator"` is the default. */ type ProjectionOption = "mercator" | "equalEarth"; /** * Built-in colour theme. `"default"` keeps the original look; `"atlas"` is a * classic atlas style with blue water and light land. */ type MapTheme = "default" | "atlas"; /** * The SVG layers of the map, in paint order (first is drawn at the back). * Each layer is a direct child `` of the map's `` with * `data-map-layer=""` and `data-map-layer-order=""`. The order * numbers only describe relative paint order; later releases may insert * layers between them. */ declare const mapRenderingLayers: readonly ["ocean", "countries", "disputed-territories", "labels", "country-labels", "pins"]; type MapRenderingLayerId = (typeof mapRenderingLayers)[number]; declare const mapRenderingLayerOrder: Record; /** * The pan and zoom of the map. `scale` is the zoom level (1 shows the whole * map) and `translate` is the offset of the map in SVG pixels. */ interface ZoomState { scale: number; translate: [number, number]; } /** Options for the `zoom` prop. Every field is optional. */ interface ZoomOptions { /** Set to `false` to turn zoom off while keeping the options object. */ enabled?: boolean; /** Zoom level on first render. Default `1`. */ initialScale?: number; /** Lowest zoom level. Default `1`. */ minScale?: number; /** Highest zoom level. Default `8`. */ maxScale?: number; /** Zoom per step (button, key or double-click). Default `2`. */ zoomFactor?: number; /** Show the zoom in / zoom out / reset buttons. Default `true`. */ showControls?: boolean; /** Show country names that fit inside their country. Default `true`. */ showCountryLabels?: boolean; /** Country label size at zoom level 1, in pixels. Default `12`. */ countryLabelMinFontSize?: number; /** Largest country label size, in pixels. Default `20`. */ countryLabelMaxFontSize?: number; /** How fast labels grow as you zoom in (exponent). Default `0.35`. */ countryLabelZoomGrowthRate?: number; /** Show the `pins` prop's pins. Default `true`. */ showPins?: boolean; /** * Load the detailed (Natural Earth 10m) country borders when zoomed in to * `detailedGeometryMinScale` or more. They load once, on first use, as a * separate file. Default `true`. */ detailedGeometry?: boolean; /** Zoom level at which the detailed borders are drawn. Default `2`. */ detailedGeometryMinScale?: number; /** * Zoom level at which `detailLevel="regions"` loads and draws regions. * Default `4`. */ regionDetailMinScale?: number; } /** `"regions"` draws a `detailProvider`'s regions when zoomed in. */ type DetailLevel = "countries" | "regions"; type DetailStatus = "idle" | "loading" | "ready" | "unavailable" | "failed"; type RegionCoverageStatus = "complete" | "partial" | "experimental"; /** * One region (state, province, ...) of a country. The geometry is GeoJSON in * `[longitude, latitude]` degrees, like the bundled countries, and the map * projects it with the current `projection`. Rings follow d3's winding: the * exterior ring is clockwise. */ interface RegionFeature { /** Stable id, written to the path's `data-region-id`. */ id: string; countryCode: ISOCode; name: string; geometry: GeoJSON.Polygon | GeoJSON.MultiPolygon; } /** The regions of one country, as returned by a `DetailProvider`. */ interface RegionCollection { countryCode: ISOCode; countryName?: string; coverageStatus?: RegionCoverageStatus; regions: readonly RegionFeature[]; /** Where the region data comes from, for attribution. */ sourceSummary?: string; sourceUrl?: string; } /** The state of the region layer, or of one country's regions. */ interface DetailProviderResult { status: DetailStatus; layer: "regions"; countryCode?: ISOCode; coverageStatus?: RegionCoverageStatus; /** Set when `status` is `"ready"`. */ collection?: RegionCollection; warning?: string; } /** * Supplies region geometry for `detailLevel="regions"`. The map asks for the * countries in view once it is zoomed in to `regionDetailMinScale`, at most * once per country for a given provider. */ interface DetailProvider { supports: (countryCode: ISOCode) => boolean; loadRegions: (countryCode: ISOCode) => Promise; } /** A marker drawn at a longitude / latitude with a caption. */ interface MapPin { /** Stable key. Defaults to the caption and index. */ id?: string; /** `[longitude, latitude]` in degrees. Invalid coordinates are skipped. */ coordinates: readonly [number, number]; caption: string; /** Written to the pin's `data-country-code` attribute. */ countryCode?: ISOCode; /** Written to the pin's `data-map-pin` attribute. Default `"pin"`. */ kind?: string; /** * When pins overlap, the one with the higher priority is kept. Defaults to * the order of the `pins` array (earlier pins win). */ priority?: number; } /** A country label that fits inside its country, in map coordinates. */ interface CountryLabelCandidate { countryCode: ISOCode; countryName: string; label: string; x: number; y: number; width: number; height: number; availableWidth: number; availableHeight: number; priority: number; } interface DataItem { country: ISOCode; value: T; } type Data = DataItem[]; type DisputeTier = "tier-1"; type DisputeStatus = "disputed" | "partially-recognized" | "non-self-governing" | "politically-sensitive"; type DisputeReviewStatus = "active" | "deferred" | "maintainer-review-required"; type DisputeBorderStyle = "solid" | "dashed" | "unchanged"; type DisputeLabelStrategy = "single" | "dual" | "segment" | "metadata-only"; interface DisputeDisplayGuidance { borderStyle: DisputeBorderStyle; labelStrategy: DisputeLabelStrategy; tooltipLabel: string; defaultDescription: string; } interface DisputeClassification { id: string; name: string; tier: DisputeTier; status: DisputeStatus; recognizedSovereign?: string | undefined; controllingPower?: string | undefined; disputeParties: readonly string[]; territories: readonly string[]; sourceRationale: string; /** The dispute's standing in United Nations resolutions and processes. */ unStanding: string; display: DisputeDisplayGuidance; reviewStatus: DisputeReviewStatus; } /** Context for one disputed-territory shape drawn by the overlay. */ interface DisputedTerritoryContext { /** Territory id, e.g. `"crimea"` or `"aksai-chin"`. */ territoryId: string; territoryName: string; /** * Natural Earth administration note, e.g. * "Admin. by Russia; Claimed by Ukraine". Empty when none. */ administration: string; dispute: DisputeClassification; } interface CountryContext { countryCode: ISOCode; countryName: string; countryValue?: T | undefined; color: string; minValue: number; maxValue: number; prefix: string; suffix: string; dispute?: DisputeClassification | undefined; } interface Props { data: DataItem[]; title?: string; valuePrefix?: string; valueSuffix?: string; color?: string; strokeOpacity?: number; backgroundColor?: string; tooltipBgColor?: string; tooltipTextColor?: string; rtl?: boolean; /** * - number: exact pixel width * - "responsive": fill the available container width * - "sm" | "md" | "lg" | "xl" | "xxl": preset cap, shrinks if smaller */ size?: SizeOption | "responsive" | number; /** * Map projection. `"mercator"` (default) or `"equalEarth"`, an equal-area * projection that shows countries at their true relative size. */ projection?: ProjectionOption; /** * Colour theme. `"default"` (the original look) or `"atlas"`: blue water * (`#A0D7EB`), slate borders (`#607d86`), light land (`#F4F2F2`) for * countries without data, and borders that stay one pixel wide. Colour * props you pass (`backgroundColor`, `borderColor`, `styleFunction`, ...) * override the theme. */ theme?: MapTheme; frame?: boolean; /** Optional class for the wrapper div (for CSP or custom layout). */ containerClassName?: string; /** Optional class for each region path (for CSP or custom styling). */ regionClassName?: string; frameColor?: string; borderColor?: string; richInteraction?: boolean; /** * Opt-in zoom and pan: buttons, drag to pan, double-click, keyboard, and * ctrl / ⌘ + wheel (or trackpad pinch). Also draws country labels. * `true` uses the defaults; pass an object to change them. */ zoom?: boolean | ZoomOptions; /** Called with the new state each time the zoom or pan changes. */ onZoomChange?: (state: ZoomState) => void; /** * `"regions"` draws the regions of the countries in view, from * `detailProvider`, as a dashed overlay once zoomed in to * `zoom.regionDetailMinScale` (default 4). Needs `zoom`. Default * `"countries"`. */ detailLevel?: DetailLevel; /** Where region geometry comes from, for `detailLevel="regions"`. */ detailProvider?: DetailProvider; /** * Called when region loading starts, finishes or fails for a country, and * with `"idle"` when regions are hidden again. Called from the load, not * from an effect, so a parent that stores the status can't cause a loop. */ onDetailStatusChange?: (status: DetailProviderResult) => void; /** Markers drawn at longitude / latitude. Shown with or without zoom. */ pins?: readonly MapPin[]; /** Fill colour of the pin markers. Default `"#b91c1c"`. */ pinColor?: string; /** Colour of the pin captions. Default `"#1f2937"`. */ pinTextColor?: string; /** Pin outline and caption halo colour. Default `"#fff"`. */ pinOutlineColor?: string; /** Colour of the country labels shown with zoom. Default `"#222"`. */ labelColor?: string; /** Optional halo drawn behind the country labels. Default: none. */ labelHaloColor?: string; /** * Draw the disputed territories (Crimea, Kashmir areas, West Bank, Gaza, * Western Sahara, Kosovo, Taiwan) as an overlay above the countries. * Off by default. */ showDisputedTerritories?: boolean; /** Fill and border colour of the disputed-territory overlay. */ disputedTerritoryColor?: string; disputedTerritoryTooltipFunction?: (context: DisputedTerritoryContext) => string; onDisputedTerritoryClick?: (context: DisputedTerritoryContext & { event: React__default.MouseEvent; }) => void; styleFunction?: (context: CountryContext) => React__default.CSSProperties; onClickFunction?: (context: CountryContext & { event: React__default.MouseEvent; }) => void; tooltipTextFunction?: (context: CountryContext) => string; hrefFunction?: (context: CountryContext) => React__default.ComponentProps<"a"> | string | undefined; textLabelFunction?: (width: number) => ({ label: string; } & React__default.ComponentProps<"text">)[]; } declare const disputedTerritories: { readonly crimea: { readonly id: "crimea"; readonly name: "Crimea"; readonly tier: "tier-1"; readonly status: "disputed"; readonly recognizedSovereign: "Ukraine"; readonly controllingPower: "Russia"; readonly disputeParties: readonly ["Ukraine", "Russia"]; readonly territories: readonly ["Crimea"]; readonly sourceRationale: "United Nations General Assembly Resolution 68/262 affirms Ukraine's territorial integrity and treats Crimea's status as disputed."; readonly unStanding: "UN General Assembly resolution 68/262 (2014) affirms Ukraine's territorial integrity within its internationally recognized borders and calls on states not to recognize any alteration of the status of Crimea."; readonly display: { readonly borderStyle: "dashed"; readonly labelStrategy: "metadata-only"; readonly tooltipLabel: "Crimea: disputed territory"; readonly defaultDescription: "Recognized baseline is Ukraine; current control is recorded separately."; }; readonly reviewStatus: "active"; }; readonly "palestinian-territories": { readonly id: "palestinian-territories"; readonly name: "Palestinian Territories"; readonly tier: "tier-1"; readonly status: "partially-recognized"; readonly disputeParties: readonly ["Israel", "Palestine"]; readonly territories: readonly ["West Bank", "Gaza"]; readonly sourceRationale: "The Palestinian Territories are widely treated as a recognition-sensitive case in United Nations processes and international diplomacy."; readonly unStanding: "UN General Assembly resolution 67/19 (2012) accorded Palestine non-member observer State status. UN resolutions, including Security Council resolution 2334 (2016), refer to the West Bank, including East Jerusalem, and Gaza as occupied Palestinian territory."; readonly display: { readonly borderStyle: "dashed"; readonly labelStrategy: "segment"; readonly tooltipLabel: "Palestinian Territories: disputed or partially recognized"; readonly defaultDescription: "West Bank and Gaza should be distinguishable where the map scale supports it."; }; readonly reviewStatus: "active"; }; readonly taiwan: { readonly id: "taiwan"; readonly name: "Taiwan"; readonly tier: "tier-1"; readonly status: "politically-sensitive"; readonly controllingPower: "Taiwan"; readonly disputeParties: readonly ["China", "Taiwan"]; readonly territories: readonly ["Taiwan"]; readonly sourceRationale: "Taiwan is separately governed while its international status remains politically sensitive and contested."; readonly unStanding: "UN General Assembly resolution 2758 (1971) recognized the representatives of the People's Republic of China as the only lawful representatives of China to the United Nations. Taiwan is not a UN member."; readonly display: { readonly borderStyle: "unchanged"; readonly labelStrategy: "metadata-only"; readonly tooltipLabel: "Taiwan: separately controlled, politically sensitive"; readonly defaultDescription: "Treat Taiwan as separately controlled without implying universal recognition."; }; readonly reviewStatus: "active"; }; readonly kashmir: { readonly id: "kashmir"; readonly name: "Kashmir"; readonly tier: "tier-1"; readonly status: "disputed"; readonly disputeParties: readonly ["India", "Pakistan", "China"]; readonly territories: readonly ["Jammu and Kashmir", "Azad Kashmir", "Gilgit-Baltistan", "Aksai Chin", "Siachen Glacier"]; readonly sourceRationale: "Kashmir is a longstanding dispute involving India, Pakistan, and China, with United Nations involvement and divided control lines."; readonly unStanding: "On the UN Security Council agenda as the India-Pakistan question since 1948 (resolution 47). The UN Military Observer Group in India and Pakistan (UNMOGIP) observes the ceasefire line."; readonly display: { readonly borderStyle: "dashed"; readonly labelStrategy: "segment"; readonly tooltipLabel: "Kashmir: disputed region"; readonly defaultDescription: "Represent control segments where the map scale and geometry support them."; }; readonly reviewStatus: "active"; }; readonly "western-sahara": { readonly id: "western-sahara"; readonly name: "Western Sahara"; readonly tier: "tier-1"; readonly status: "non-self-governing"; readonly disputeParties: readonly ["Morocco", "Sahrawi Arab Democratic Republic"]; readonly territories: readonly ["Western Sahara"]; readonly sourceRationale: "Western Sahara is listed through the United Nations decolonization framework as a non-self-governing territory."; readonly unStanding: "Listed by the United Nations as a Non-Self-Governing Territory. The UN Mission for the Referendum in Western Sahara (MINURSO) was established by Security Council resolution 690 (1991)."; readonly display: { readonly borderStyle: "dashed"; readonly labelStrategy: "single"; readonly tooltipLabel: "Western Sahara: disputed or non-self-governing territory"; readonly defaultDescription: "Avoid representing Western Sahara as ordinary undisputed Moroccan territory."; }; readonly reviewStatus: "active"; }; readonly kosovo: { readonly id: "kosovo"; readonly name: "Kosovo"; readonly tier: "tier-1"; readonly status: "partially-recognized"; readonly disputeParties: readonly ["Kosovo", "Serbia"]; readonly territories: readonly ["Kosovo"]; readonly sourceRationale: "Kosovo is partially recognized internationally and remains diplomatically disputed by Serbia."; readonly unStanding: "UN Security Council resolution 1244 (1999) remains in force. Kosovo is not a UN member. The International Court of Justice advisory opinion of 2010 found that its declaration of independence did not violate international law."; readonly display: { readonly borderStyle: "dashed"; readonly labelStrategy: "single"; readonly tooltipLabel: "Kosovo: partially recognized state"; readonly defaultDescription: "Treat Kosovo as partially recognized rather than forcing a single universal recognition model."; }; readonly reviewStatus: "active"; }; }; type DisputeId = keyof typeof disputedTerritories; declare const disputeIds: DisputeId[]; declare const disputesByCountryCode: Partial, DisputeId>>; declare function getDisputeById(id: DisputeId): (typeof disputedTerritories)[DisputeId]; declare function getDisputeByCountryCode(countryCode: ISOCode): DisputeClassification | undefined; interface DisputedTerritoryArea { /** Territory id, e.g. `"crimea"` or `"aksai-chin"`. */ id: string; name: string; disputeId: DisputeId; /** Natural Earth administration note. Empty when none. */ administration: string; } /** The territory shapes drawn by `showDisputedTerritories`, in render order. */ declare const disputedTerritoryAreas: DisputedTerritoryArea[]; /** Every projection the `projection` prop accepts, default first. */ declare const projectionOptions: readonly ProjectionOption[]; declare const mapThemeOptions: readonly MapTheme[]; /** Region detail is off or hidden. */ declare function createIdleDetailResult(): DetailProviderResult; /** The provider has no regions for this country. */ declare function createUnavailableDetailResult(countryCode?: ISOCode, warning?: string): DetailProviderResult; /** Loading this country's regions failed. */ declare function createFailedDetailResult(countryCode?: ISOCode, warning?: string): DetailProviderResult; /** A country's regions, ready to draw. */ declare function createReadyDetailResult(collection: RegionCollection): DetailProviderResult; declare function isReadyDetailResult(result: DetailProviderResult): result is DetailProviderResult & { collection: RegionCollection; }; /** * Starts loading the detailed country borders that the map draws when * zoomed in, for example on hover over a map, so the first zoom past * `detailedGeometryMinScale` shows them straight away. */ declare function preloadDetailedCountryGeometry(): Promise; declare function WorldMap(props: Props): React.ReactElement; declare const regions: { name: string; code: string; }[]; export { WorldMap, createFailedDetailResult, createIdleDetailResult, createReadyDetailResult, createUnavailableDetailResult, WorldMap as default, disputeIds, disputedTerritories, disputedTerritoryAreas, disputesByCountryCode, getDisputeByCountryCode, getDisputeById, isReadyDetailResult, mapRenderingLayerOrder, mapRenderingLayers, mapThemeOptions, preloadDetailedCountryGeometry, projectionOptions, regions }; export type { CountryContext, CountryLabelCandidate, Data, DataItem, DetailLevel, DetailProvider, DetailProviderResult, DetailStatus, DisputeBorderStyle, DisputeClassification, DisputeDisplayGuidance, DisputeId, DisputeLabelStrategy, DisputeReviewStatus, DisputeStatus, DisputeTier, DisputedTerritoryArea, DisputedTerritoryContext, ISOCode, MapPin, MapRenderingLayerId, MapTheme, ProjectionOption, Props, RegionCollection, RegionCoverageStatus, RegionFeature, SizeOption, ZoomOptions, ZoomState };