-
-
Notifications
You must be signed in to change notification settings - Fork 76
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 missing typescript type definitions #689
base: main
Are you sure you want to change the base?
Conversation
* For PDF canvases, adds another page. If width and/or height are omitted, | ||
* the canvas's initial size is used. | ||
*/ | ||
addPage(width?: number, height?: number): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PDF is not supported in this library though 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies I should have clarified this.
The following types were directly copied from skia-canvas
which this project depends on:
GlobalCompositeOperation
CanvasLineCap
CanvasLineJoin
CanvasTextBaseline
CanvasTextAlign
TextMetrics
CanvasFillRule
CanvasRenderingContext2D
CanvasGradient
CanvasPattern
It is correct to be bringing in these types, but as you rightfully point out, this library does not currently implement all features. I was reluctant to start removing type properties / class methods as I'm uncertain which are, and are not, implemented. I'm hoping someone with more experience (i.e. the maintainers) can help out here.
The only modifications I've made are to CanvasRenderingContext2D
:
- To add method
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void
in addition to the existingsetTransform(transform?: DOMMatrix2D): void
- To modify
fill(fillRule?: CanvasFillRule): void
tofill(path?: Path2D, fillRule?: CanvasFillRule): void
These changes now allow my project to build (tsc
) where before it was failing (as described in #659).
This PR closes issue #659