-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(voronoi): add TypeScript definitions
- Loading branch information
Raphaël Benitte
authored and
Raphaël Benitte
committed
Mar 26, 2019
1 parent
c16ae70
commit b98f65a
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import * as React from 'react' | ||
import { Dimensions, Box, Theme } from '@nivo/core' | ||
|
||
declare module '@nivo/voronoi' { | ||
export interface VoronoiDatum { | ||
id: string | number | ||
x: number | ||
y: number | ||
} | ||
|
||
export type VoronoiDomain = [number, number] | ||
|
||
export type VoronoiCustomLayer = (...args: any[]) => React.ReactNode | ||
|
||
export interface VoronoiProps { | ||
data: VoronoiDatum[] | ||
|
||
xDomain?: VoronoiDomain | ||
yDomain?: VoronoiDomain | ||
|
||
layers?: Array<'links' | 'cells' | 'points' | 'bounds' | VoronoiCustomLayer> | ||
|
||
theme?: Theme | ||
|
||
margin?: Box | ||
|
||
enableLinks?: boolean | ||
linkLineWidth?: number | ||
linkLineColor?: string | ||
|
||
enableCells?: boolean | ||
cellLineWidth?: number | ||
cellLineColor?: string | ||
|
||
enablePoints?: boolean | ||
pointSize?: number | ||
pointColor?: string | ||
} | ||
|
||
export class Voronoi extends React.Component<VoronoiProps & Dimensions> {} | ||
export class ResponsiveVoroinoi extends React.Component<VoronoiProps> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters