Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.1",
"description": "A signature pad implementation in React",
"main": "build/index.js",
"types": "src/index.d.ts",
"scripts": {
"test": "webpack && npm pack",
"start": "webpack-dev-server -d --inline --hot",
Expand Down
22 changes: 22 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// signature_pad's props
// (taken from https://github.com/szimek/signature_pad/blob/e2af461bca7ceb7cc5afb8349930908ca19f2f56/src/signature_pad.ts#L23)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we import signature_pad's types directly from signature_pad? I haven't updated to the beta yet (as it's beta) so that might not be possible until then and this might be fine in the meantime

export interface IOptions {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be IOptions? or SignaturePadOptions? should it be (re-)exported?

dotSize?: number | (() => number);
minWidth?: number;
maxWidth?: number;
minDistance?: number;
backgroundColor?: string;
penColor?: string;
throttle?: number;
velocityFilterWeight?: number;
onBegin?: (event: MouseEvent | Touch) => void;
onEnd?: (event: MouseEvent | Touch) => void;
}

// props specific to the React wrapper
export interface SignatureCanvasProps extends IOptions {
canvasProps: any;
clearOnResize: boolean;
}

export default class SignatureCanvas extends React.Component<SignatureCanvasProps> {}