59 lines
1.9 KiB
TypeScript
59 lines
1.9 KiB
TypeScript
declare module 'react-simple-maps' {
|
|
import { ComponentType, ReactNode, CSSProperties } from 'react';
|
|
|
|
export interface ComposableMapProps {
|
|
projection?: string;
|
|
projectionConfig?: {
|
|
scale?: number;
|
|
center?: [number, number];
|
|
rotate?: [number, number, number];
|
|
};
|
|
width?: number;
|
|
height?: number;
|
|
style?: CSSProperties;
|
|
children?: ReactNode;
|
|
}
|
|
|
|
export interface GeographiesProps {
|
|
geography: string | object;
|
|
children: (data: { geographies: any[] }) => ReactNode;
|
|
}
|
|
|
|
export interface GeographyProps {
|
|
geography: any;
|
|
style?: {
|
|
default?: CSSProperties;
|
|
hover?: CSSProperties;
|
|
pressed?: CSSProperties;
|
|
};
|
|
fill?: string;
|
|
stroke?: string;
|
|
strokeWidth?: number;
|
|
onClick?: (event: React.MouseEvent) => void;
|
|
onMouseEnter?: (event: React.MouseEvent) => void;
|
|
onMouseLeave?: (event: React.MouseEvent) => void;
|
|
}
|
|
|
|
export interface ZoomableGroupProps {
|
|
center?: [number, number];
|
|
zoom?: number;
|
|
minZoom?: number;
|
|
maxZoom?: number;
|
|
translateExtent?: [[number, number], [number, number]];
|
|
onMoveStart?: (event: any) => void;
|
|
onMove?: (event: any) => void;
|
|
onMoveEnd?: (event: any) => void;
|
|
children?: ReactNode;
|
|
}
|
|
|
|
export const ComposableMap: ComponentType<ComposableMapProps>;
|
|
export const Geographies: ComponentType<GeographiesProps>;
|
|
export const Geography: ComponentType<GeographyProps>;
|
|
export const ZoomableGroup: ComponentType<ZoomableGroupProps>;
|
|
export const Marker: ComponentType<any>;
|
|
export const Line: ComponentType<any>;
|
|
export const Annotation: ComponentType<any>;
|
|
export const Graticule: ComponentType<any>;
|
|
export const Sphere: ComponentType<any>;
|
|
}
|