This commit is contained in:
richarjiang
2026-03-13 11:00:01 +08:00
commit fa4c458eda
51 changed files with 8843 additions and 0 deletions

57
types/react-simple-maps.d.ts vendored Normal file
View File

@@ -0,0 +1,57 @@
declare module "react-simple-maps" {
import { ComponentType, ReactNode } from "react";
interface ComposableMapProps {
projection?: string;
projectionConfig?: {
center?: [number, number];
scale?: number;
rotate?: [number, number, number];
};
width?: number;
height?: number;
style?: React.CSSProperties;
children?: ReactNode;
}
interface GeographiesProps {
geography: string | object;
children: (data: {
geographies: Geography[];
}) => ReactNode;
}
interface Geography {
rsmKey: string;
properties: Record<string, unknown>;
}
interface GeographyProps {
geography: Geography;
key?: string;
fill?: string;
stroke?: string;
strokeWidth?: number;
style?: {
default?: React.CSSProperties & { outline?: string };
hover?: React.CSSProperties & { outline?: string };
pressed?: React.CSSProperties & { outline?: string };
};
onClick?: () => void;
onMouseEnter?: () => void;
onMouseLeave?: () => void;
}
interface ZoomableGroupProps {
center?: [number, number];
zoom?: number;
minZoom?: number;
maxZoom?: number;
children?: ReactNode;
}
export const ComposableMap: ComponentType<ComposableMapProps>;
export const Geographies: ComponentType<GeographiesProps>;
export const Geography: ComponentType<GeographyProps>;
export const ZoomableGroup: ComponentType<ZoomableGroupProps>;
}