forked from blackjk3/react-signature-pad
-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(refactor/types): re-write src/index.js in TypeScript
- make heavy use of the multiple iterations on types in others' PRs, my own iterations on that, and then @types/react-signature-canvas - credit where credit is due! - refactor init logic a bit to get around `| null` everywhere - kinda hacky but better than ifs or ! (non-nullable) everywhere - use ! for canvas.getContext('2d') calls for same reason - c.f. microsoft/TypeScript#19229 - refactor naming everywhere to src/index.tsx - configure tsconfig -- no need for allowJs anymore, but jsx needs to be set as TS is actually reading it now - configure jest -- ts-jest needed to read TSX files (deps): add DT typings for prop-types, react, and signature_pad (deps): add a declaration file for trim-canvas as it doesn't have types built-in yet (TODO for me!) - use typings/ to hold external declarations
- Loading branch information
Showing
8 changed files
with
68 additions
and
21 deletions.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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,3 @@ | ||
declare module 'trim-canvas' { | ||
export default function trimCanvas (canvas: HTMLCanvasElement): HTMLCanvasElement | ||
} |