Skip to content

Commit 2bf76b5

Browse files
HeCorrzbjornson
authored andcommittedMay 5, 2021
export type NodeCanvasRenderingContext2D
1 parent 0b49442 commit 2bf76b5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ project adheres to [Semantic Versioning](http://semver.org/).
1515
* Add Node.js v15 to CI.
1616
* The C++ class method `nBytes()` now returns a size_t. (Because this is a C++
1717
method only, this is not considered a breaking change.)
18+
* Export type NodeCanvasRenderingContext2D so you can pass the current context
19+
to functions (TypeScript).
1820
### Added
1921
* Add support for `inverse()` and `invertSelf()` to `DOMMatrix` (#1648)
2022
* Add support for `context.getTransform()` ([#1769](https://github.com/Automattic/node-canvas/pull/1769))

‎types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class Canvas {
128128
toDataURL(mimeType: 'image/jpeg', quality: number, cb: (err: Error|null, result: string) => void): void
129129
}
130130

131-
declare class NodeCanvasRenderingContext2D extends CanvasRenderingContext2D {
131+
export class NodeCanvasRenderingContext2D extends CanvasRenderingContext2D {
132132
/**
133133
* _Non-standard_. Defaults to 'good'. Affects pattern (gradient, image,
134134
* etc.) rendering quality.

0 commit comments

Comments
 (0)
Please sign in to comment.