Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 10 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /