Skip to content

Commit b7009a3

Browse files
committed
add typescript definitions
1 parent 62c3714 commit b7009a3

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0-alpha.1",
44
"description": "A signature pad implementation in React",
55
"main": "build/index.js",
6+
"types": "src/index.d.ts",
67
"scripts": {
78
"test": "webpack && npm pack",
89
"start": "webpack-dev-server -d --inline --hot",

src/index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// signature_pad's props
2+
// (taken from https://github.com/szimek/signature_pad/blob/e2af461bca7ceb7cc5afb8349930908ca19f2f56/src/signature_pad.ts#L23)
3+
export interface IOptions {
4+
dotSize?: number | (() => number);
5+
minWidth?: number;
6+
maxWidth?: number;
7+
minDistance?: number;
8+
backgroundColor?: string;
9+
penColor?: string;
10+
throttle?: number;
11+
velocityFilterWeight?: number;
12+
onBegin?: (event: MouseEvent | Touch) => void;
13+
onEnd?: (event: MouseEvent | Touch) => void;
14+
}
15+
16+
// props specific to the React wrapper
17+
export interface SignatureCanvasProps extends IOptions {
18+
canvasProps: any;
19+
clearOnResize: boolean;
20+
}
21+
22+
export default class SignatureCanvas extends React.Component<SignatureCanvasProps> {}

0 commit comments

Comments
 (0)