Skip to content

Commit 1817109

Browse files
committed
add missing DOMMatrixInit and DOMPointInit types
this was accidentally relying on people importing ambient DOM declarations
1 parent 8346512 commit 1817109

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1010
### Changed
1111
### Added
1212
### Fixed
13+
* Fixed accidental depenency on ambient DOM types
1314

1415

1516
3.0.0

index.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,16 @@ export class JPEGStream extends Readable {}
395395
/** This class must not be constructed directly; use `canvas.createPDFStream()`. */
396396
export class PDFStream extends Readable {}
397397

398+
// TODO: this is wrong. See matrixTransform in lib/DOMMatrix.js
399+
type DOMMatrixInit = DOMMatrix | string | number[];
400+
401+
interface DOMPointInit {
402+
w?: number;
403+
x?: number;
404+
y?: number;
405+
z?: number;
406+
}
407+
398408
export class DOMPoint {
399409
w: number;
400410
x: number;

lib/DOMMatrix.js

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class DOMPoint {
1919
}
2020

2121
matrixTransform(init) {
22+
// TODO: this next line is wrong. matrixTransform is supposed to only take
23+
// an object with the DOMMatrix properties called DOMMatrixInit
2224
const m = init instanceof DOMMatrix ? init : new DOMMatrix(init)
2325
return m.transformPoint(this)
2426
}

0 commit comments

Comments
 (0)