import * as React from 'react' import { Dimensions, Box } from '@nivo/core' import { PartialTheme } from '@nivo/theming' import { LegendProps } from '@nivo/legends' declare module '@nivo/geo' { /////////////////////////////////////////////////////////////////////////// // Common /////////////////////////////////////////////////////////////////////////// export type GeoProjectionType = | 'azimuthalEqualArea' | 'azimuthalEquidistant' | 'gnomonic' | 'orthographic' | 'stereographic' | 'equalEarth' | 'equirectangular' | 'mercator' | 'transverseMercator' | 'naturalEarth1' type FeatureAccessor = (feature: F) => T interface CommonProps { features: any[] margin?: Partial projectionType?: GeoProjectionType projectionScale?: number projectionTranslation?: [number, number] projectionRotation?: [number, number, number] enableGraticule?: boolean graticuleLineWidth?: number graticuleLineColor?: string isInteractive?: boolean theme?: PartialTheme } /////////////////////////////////////////////////////////////////////////// // GeoMap /////////////////////////////////////////////////////////////////////////// export type GeoMapTooltip = React.FunctionComponent<{ feature: any }> export type GeoMapEventHandler = (feature: any, event: React.MouseEvent) => void interface GeoMapCommonProps extends CommonProps { fillColor?: string | FeatureAccessor borderWidth?: number | FeatureAccessor borderColor?: string | FeatureAccessor onMouseEnter?: GeoMapEventHandler onMouseMove?: GeoMapEventHandler onMouseLeave?: GeoMapEventHandler onClick?: GeoMapEventHandler tooltip?: GeoMapTooltip } export interface GeoMapProps extends GeoMapCommonProps { role?: string } export interface GeoMapCanvasProps extends GeoMapCommonProps { pixelRatio?: number } export class GeoMap extends React.Component {} export class ResponsiveGeoMap extends React.Component {} export class GeoMapCanvas extends React.Component {} export class ResponsiveGeoMapCanvas extends React.Component {} /////////////////////////////////////////////////////////////////////////// // Choropleth /////////////////////////////////////////////////////////////////////////// export interface ChoroplethBoundFeature { label: string value: number formattedValue: 'string | number' color: string data: any } export type ChoroplethEventHandler = ( feature: ChoroplethBoundFeature, event: React.MouseEvent ) => void export type ChoroplethTooltip = React.FunctionComponent<{ feature: ChoroplethBoundFeature }> type DatumMatcher = (...args: any[]) => boolean interface ChoroplethCommonProps extends CommonProps { data: any[] domain: number[] match?: string | DatumMatcher label?: string | FeatureAccessor value?: string | FeatureAccessor valueFormat?: string | FeatureAccessor colors?: string | string[] | FeatureAccessor unknownColor?: string fillColor?: string | FeatureAccessor borderWidth?: number | FeatureAccessor borderColor?: string | FeatureAccessor tooltip?: ChoroplethTooltip legends?: LegendProps[] onMouseEnter?: ChoroplethEventHandler onMouseMove?: ChoroplethEventHandler onMouseLeave?: ChoroplethEventHandler onClick?: ChoroplethEventHandler } export interface ChoroplethProps extends ChoroplethCommonProps { role?: string } export interface ChoroplethCanvasProps extends ChoroplethCommonProps { pixelRatio?: number } export class Choropleth extends React.Component {} export class ResponsiveChoropleth extends React.Component {} export class ChoroplethCanvas extends React.Component {} export class ResponsiveChoroplethCanvas extends React.Component {} }