@types/react-simple-maps
Advanced tools
Comparing version 0.12.2 to 1.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for react-simple-maps 0.12 | ||
// Type definitions for react-simple-maps 1.0 | ||
// Project: https://github.com/zcreativelabs/react-simple-maps#readme | ||
@@ -8,81 +8,95 @@ // Definitions by: Novikov Mihail <https://github.com/thepocp> | ||
import { GeoPath, GeoProjection } from 'd3-geo'; | ||
import { Feature } from 'geojson'; | ||
import * as React from 'react'; | ||
import { GeoProjection } from 'd3-geo'; | ||
export type Point = [number, number]; | ||
export interface MarkerType { | ||
coordinates: Point; | ||
} | ||
export interface Line { | ||
coordinates: { | ||
start: Point; | ||
end: Point; | ||
}; | ||
} | ||
export interface ProjectionConfig { | ||
scale: number; | ||
xOffset: number; | ||
yOffset: number; | ||
rotation: [number, number, number]; | ||
precision: number; | ||
scale?: number; | ||
xOffset?: number; | ||
yOffset?: number; | ||
rotate?: [number, number, number]; | ||
precision?: number; | ||
} | ||
export type ProjectionFunction = (width: number, height: number, config: ProjectionConfig) => GeoProjection; | ||
export interface ComposableMapProps { | ||
export interface ComposableMapProps extends React.SVGAttributes<SVGSVGElement> { | ||
/** | ||
* @default 800 | ||
*/ | ||
width?: number; | ||
/** | ||
* @default 600 | ||
*/ | ||
height?: number; | ||
/** | ||
* @default "geoEqualEarth" | ||
*/ | ||
projection?: string | ProjectionFunction; | ||
projectionConfig?: Partial<ProjectionConfig>; | ||
style?: React.CSSProperties; | ||
defs?: SVGDefsElement; | ||
className?: string; | ||
showCenter?: boolean; | ||
preserveAspectRatio?: string; | ||
viewBox?: string; | ||
/** | ||
* @default {} | ||
*/ | ||
projectionConfig?: ProjectionConfig; | ||
} | ||
export interface ZoomableGlobeProps { | ||
center?: Point; | ||
zoom?: number; | ||
disablePanning?: boolean; | ||
style?: React.CSSProperties; | ||
width?: number; | ||
height?: number; | ||
onMoveStart?: (currentCenter: Point) => void; | ||
onMoveEnd?: (newCenter: Point) => void; | ||
sensitivity?: number; | ||
export interface Position { | ||
x: number; | ||
y: number; | ||
last: Point; | ||
zoom: number; | ||
dragging: boolean; | ||
zooming: boolean; | ||
} | ||
export interface ZoomableGroupProps { | ||
export interface ZoomableGroupProps extends React.SVGAttributes<SVGGElement> { | ||
/** | ||
* @default [0, 0] | ||
*/ | ||
center?: Point; | ||
/** | ||
* @default 1 | ||
*/ | ||
zoom?: number; | ||
/** | ||
* @default 1 | ||
*/ | ||
minZoom?: number; | ||
/** | ||
* @default 5 | ||
*/ | ||
maxZoom?: number; | ||
/** | ||
* @default 0.025 | ||
*/ | ||
zoomSensitivity?: number; | ||
/** | ||
* @default false | ||
*/ | ||
disablePanning?: boolean; | ||
style?: React.CSSProperties; | ||
width?: number; | ||
height?: number; | ||
onMoveStart?: (currentCenter: Point) => void; | ||
onMoveEnd?: (newCenter: Point) => void; | ||
backdrop?: { | ||
x: Point; | ||
y: Point; | ||
}; | ||
/** | ||
* @default false | ||
*/ | ||
disableZooming?: boolean; | ||
onMoveStart?: (event: any, position: Position) => void; | ||
onMoveEnd?: (event: any, position: Position) => void; | ||
onZoomStart?: (event: any, position: Position) => void; | ||
onZoomEnd?: (event: any, position: Position) => void; | ||
} | ||
export interface GeographiesProps { | ||
disableOptimization?: boolean; | ||
geography?: string | { [key: string]: any } | string[]; | ||
children?: (geographies: object[], projection: GeoProjection) => void; | ||
interface GeographiesChildrenArgument { | ||
geographies: object[]; | ||
path: GeoPath; | ||
projection: GeoProjection; | ||
} | ||
export interface GeographyProps { | ||
cacheId?: number | string | null; | ||
precision?: number; | ||
round?: boolean; | ||
export interface GeographiesProps extends React.SVGAttributes<SVGGElement> { | ||
parseGeographies?: (features: Array<Feature<any, any>>) => Array<Feature<any, any>>; | ||
geography?: string | Record<string, any> | string[]; | ||
children?: (data: GeographiesChildrenArgument) => void; | ||
} | ||
export interface GeographyProps | ||
extends Pick<React.SVGProps<SVGPathElement>, Exclude<keyof React.SVGProps<SVGPathElement>, 'style'>> { | ||
geography?: object; | ||
projection?: GeoProjection; | ||
tabable?: boolean; | ||
style?: { | ||
@@ -93,15 +107,13 @@ default?: React.CSSProperties; | ||
}; | ||
onClick?: (geography: object, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseEnter?: (geography: object, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseMove?: (geography: object, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseLeave?: (geography: object, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseDown?: (geography: object, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseUp?: (geography: object, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onFocus?: (geography: object, evt: React.FocusEvent<SVGPathElement>) => void; | ||
onBlur?: (geography: object, evt: React.FocusEvent<SVGPathElement>) => void; | ||
onMouseEnter?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onMouseLeave?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onMouseDown?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onMouseUp?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onFocus?: (event: React.FocusEvent<SVGPathElement>) => void; | ||
onBlur?: (event: React.FocusEvent<SVGPathElement>) => void; | ||
} | ||
export interface MarkerProps { | ||
marker?: MarkerType; | ||
tabable?: boolean; | ||
export interface MarkerProps | ||
extends Pick<React.SVGProps<SVGPathElement>, Exclude<keyof React.SVGProps<SVGPathElement>, 'style'>> { | ||
coordinates?: Point; | ||
style?: { | ||
@@ -112,68 +124,99 @@ default?: React.CSSProperties; | ||
}; | ||
preserveMarkerAspect?: boolean; | ||
onClick?: (marker: MarkerType, evt: React.MouseEvent<SVGGElement>) => void; | ||
onMouseEnter?: (marker: MarkerType, evt: React.MouseEvent<SVGGElement>) => void; | ||
onMouseMove?: (marker: MarkerType, evt: React.MouseEvent<SVGGElement>) => void; | ||
onMouseLeave?: (marker: MarkerType, evt: React.MouseEvent<SVGGElement>) => void; | ||
onMouseDown?: (marker: MarkerType, evt: React.MouseEvent<SVGGElement>) => void; | ||
onMouseUp?: (marker: MarkerType, evt: React.MouseEvent<SVGGElement>) => void; | ||
onFocus?: (marker: MarkerType, evt: React.FocusEvent<SVGGElement>) => void; | ||
onBlur?: (marker: MarkerType, evt: React.FocusEvent<SVGGElement>) => void; | ||
onMouseEnter?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onMouseLeave?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onMouseDown?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onMouseUp?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void; | ||
onFocus?: (event: React.FocusEvent<SVGPathElement>) => void; | ||
onBlur?: (event: React.FocusEvent<SVGPathElement>) => void; | ||
} | ||
export interface AnnotationProps { | ||
export interface AnnotationProps extends React.SVGProps<SVGGElement> { | ||
subject?: Point; | ||
dx?: number; | ||
dy?: number; | ||
zoom?: number; | ||
stroke?: string; | ||
strokeWidth?: number; | ||
style?: React.CSSProperties; | ||
markerEnd?: string; | ||
connectorProps: React.SVGProps<SVGPathElement>; | ||
/** | ||
* @default 30 | ||
*/ | ||
dx?: number | string; | ||
/** | ||
* @default 30 | ||
*/ | ||
dy?: number | string; | ||
/** | ||
* @default 0 | ||
*/ | ||
curve?: number; | ||
} | ||
export interface GraticuleProps { | ||
export interface GraticuleProps extends React.SVGProps<SVGPathElement> { | ||
/** | ||
* @default [10, 10] | ||
*/ | ||
step?: Point; | ||
round?: boolean; | ||
precision?: number; | ||
outline?: boolean; | ||
/** | ||
* @default "currentcolor" | ||
*/ | ||
stroke?: string; | ||
/** | ||
* @default "transparent" | ||
*/ | ||
fill?: string; | ||
style?: React.CSSProperties; | ||
disableOptimization?: boolean; | ||
Globe?: boolean; | ||
} | ||
export interface LineProps { | ||
line?: Line; | ||
tabable?: boolean; | ||
style?: { | ||
default?: React.CSSProperties; | ||
hover?: React.CSSProperties; | ||
pressed?: React.CSSProperties; | ||
}; | ||
preserveMarkerAspect?: boolean; | ||
buildPath?: (start: Point, end: Point, line: Line) => string; | ||
onClick?: (line: Line, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseEnter?: (line: Line, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseMove?: (line: Line, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseLeave?: (line: Line, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseDown?: (line: Line, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onMouseUp?: (line: Line, evt: React.MouseEvent<SVGPathElement>) => void; | ||
onFocus?: (line: Line, evt: React.FocusEvent<SVGPathElement>) => void; | ||
onBlur?: (line: Line, evt: React.FocusEvent<SVGPathElement>) => void; | ||
export interface LineProps | ||
extends Pick<React.SVGProps<SVGPathElement>, Exclude<keyof React.SVGProps<SVGPathElement>, 'from' | 'to'>> { | ||
/** | ||
* @default [0, 0] | ||
*/ | ||
from?: Point; | ||
/** | ||
* @default [0, 0] | ||
*/ | ||
to?: Point; | ||
/** | ||
* @default [[0, 0], [0, 0]] | ||
*/ | ||
coordinates?: Point[]; | ||
/** | ||
* @default "currentcolor" | ||
*/ | ||
stroke?: string; | ||
/** | ||
* @default 3 | ||
*/ | ||
strokeWidth?: number | string; | ||
/** | ||
* @default "transparent" | ||
*/ | ||
fill?: string; | ||
} | ||
export class ComposableMap extends React.Component<ComposableMapProps> {} | ||
export class ZoomableGroup extends React.Component<ZoomableGroupProps> {} | ||
export class ZoomableGlobe extends React.Component<ZoomableGlobeProps> {} | ||
export class Geographies extends React.Component<GeographiesProps> {} | ||
export class Geography extends React.Component<GeographyProps> {} | ||
export class Markers extends React.Component {} | ||
export class Marker extends React.Component<MarkerProps> {} | ||
export class Annotations extends React.Component {} | ||
export class Annotation extends React.Component<AnnotationProps> {} | ||
export class Graticule extends React.Component<GraticuleProps> {} | ||
export class Lines extends React.Component {} | ||
export class Line extends React.Component<LineProps> {} | ||
interface SphereProps extends React.SVGProps<SVGPathElement> { | ||
/** | ||
* @default "rsm-sphere" | ||
*/ | ||
id: string; | ||
/** | ||
* @default "transparent" | ||
*/ | ||
fill: string; | ||
/** | ||
* @default "currentcolor" | ||
*/ | ||
stroke: string; | ||
/** | ||
* @default 0.5 | ||
*/ | ||
strokeWidth: number; | ||
} | ||
declare const ComposableMap: React.FunctionComponent<ComposableMapProps>; | ||
declare const ZoomableGroup: React.FunctionComponent<ZoomableGroupProps>; | ||
declare const Geographies: React.FunctionComponent<GeographiesProps>; | ||
declare const Geography: React.FunctionComponent<GeographyProps>; | ||
declare const Marker: React.FunctionComponent<MarkerProps>; | ||
declare const Annotation: React.FunctionComponent<AnnotationProps>; | ||
declare const Graticule: React.FunctionComponent<GraticuleProps>; | ||
declare const Line: React.FunctionComponent<LineProps>; | ||
declare const Sphere: React.FunctionComponent<SphereProps>; | ||
export { ComposableMap, ZoomableGroup, Geographies, Geography, Marker, Annotation, Graticule, Line, Sphere }; |
{ | ||
"name": "@types/react-simple-maps", | ||
"version": "0.12.2", | ||
"version": "1.0.0", | ||
"description": "TypeScript definitions for react-simple-maps", | ||
@@ -19,6 +19,7 @@ "license": "MIT", | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/react-simple-maps" | ||
}, | ||
@@ -28,6 +29,7 @@ "scripts": {}, | ||
"@types/d3-geo": "*", | ||
"@types/geojson": "*", | ||
"@types/react": "*" | ||
}, | ||
"typesPublisherContentHash": "f7adc69ed1cdec88bf6f004b4c9393f79203e523b2c0990a52bfdbb5f70b32ec", | ||
"typesPublisherContentHash": "d30c859a8162844062604caeff5009dd794f4192ef35effa51be18ee84180ae2", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -5,13 +5,13 @@ # Installation | ||
# Summary | ||
This package contains type definitions for react-simple-maps ( https://github.com/zcreativelabs/react-simple-maps#readme ). | ||
This package contains type definitions for react-simple-maps (https://github.com/zcreativelabs/react-simple-maps#readme). | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-simple-maps | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-simple-maps. | ||
Additional Details | ||
* Last updated: Wed, 30 Jan 2019 23:25:57 GMT | ||
* Dependencies: @types/react, @types/d3-geo | ||
### Additional Details | ||
* Last updated: Fri, 03 Jan 2020 20:51:10 GMT | ||
* Dependencies: [@types/d3-geo](https://npmjs.com/package/@types/d3-geo), [@types/geojson](https://npmjs.com/package/@types/geojson), [@types/react](https://npmjs.com/package/@types/react) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Novikov Mihail <https://github.com/thepocp>, Andrej Mihajlov <https://github.com/pronebird>. | ||
These definitions were written by Novikov Mihail (https://github.com/thepocp), and Andrej Mihajlov (https://github.com/pronebird). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8999
203
1
3
1
+ Added@types/geojson@*