Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typescript support to the library #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wkasunsampath
Copy link

This PR is to bring typescript support to the library.

But, still there are some areas to be improved.

  1. First issue is with using HTMLImageElement & CanvasRenderingContext2D. These are browser globals. So, it gives an error when running AVA tests. Also, this might give errors in Node Js apps. Can someone please, suggest a method to overcome this.

  2. Also, in index.ts line 67, I have added validation in order to avoid npm build fail due to type mismatch. This error comes because the type of Image (in canvas) does not compatible with the type CanvasImageSource of drawImage method.

I am not very good in JS. So, if someone helps me, I can work on this further to finalize this PR and add TS support to this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant