Skip to content

Commit

Permalink
Fix setupJestCanvasMock type declaration (#108)
Browse files Browse the repository at this point in the history
* Fix setupJestCanvasMock type declaration

The declaration for setupJestCanvasMock included {}, so have changed to return type void instead.
This fixes error TS1183: An implementation cannot be declared in ambient contexts

* Add hrd543 to contributors

Following instructions in the contrbuting.md file, I have added myself to the contributors list

---------

Co-authored-by: hustcc <i@hust.cc>
  • Loading branch information
hrd543 and hustcc committed May 18, 2023
1 parent 8eb2382 commit 94162b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ canvas.toDataURL.mockReturnValueOnce(
- [@lekha](https://github.com/lekha)
- [@yonatankra](https://github.com/yonatankra)
- [@LitoMore](https://github.com/LitoMore)
- [@hrd543](https://github.com/hrd543)
- [@danielrentz](https://github.com/danielrentz)

## License
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function setupJestCanvasMock(window?: Window) {}
export function setupJestCanvasMock(window?: Window): void

export interface CanvasRenderingContext2DEvent {
/**
Expand Down

0 comments on commit 94162b7

Please sign in to comment.