feat: Reinitialize frontend with SvelteKit and TypeScript

- Delete old Vite+Svelte frontend
- Initialize new SvelteKit project with TypeScript
- Configure Tailwind CSS v4 + DaisyUI
- Implement JWT authentication with auto-refresh
- Create login page with form validation (Zod)
- Add protected route guards
- Update Docker configuration for single-stage build
- Add E2E tests with Playwright (6/11 passing)
- Fix Svelte 5 reactivity with $state() runes

Known issues:
- 5 E2E tests failing (timing/async issues)
- Token refresh implementation needs debugging
- Validation error display timing
This commit is contained in:
2026-02-17 16:19:59 -05:00
parent 54df6018f5
commit de2d83092e
28274 changed files with 3816354 additions and 90 deletions

57
frontend/node_modules/happy-dom/lib/dom/DOMPoint.d.ts generated vendored Normal file
View File

@@ -0,0 +1,57 @@
import DOMPointReadOnly from './DOMPointReadOnly.js';
/**
* DOM Point.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint
*/
export default class DOMPoint extends DOMPointReadOnly {
/**
* Sets x.
*
* @param value X.
*/
set x(value: number);
/**
* Returns x.
*
* @returns X.
*/
get x(): number;
/**
* Sets y.
*
* @param value Y.
*/
set y(value: number);
/**
* Returns y.
*
* @returns Y.
*/
get y(): number;
/**
* Sets z.
*
* @param value Z.
*/
set z(value: number);
/**
* Returns z.
*
* @returns Z.
*/
get z(): number;
/**
* Sets w.
*
* @param value W.
*/
set w(value: number);
/**
* Returns w.
*
* @returns W.
*/
get w(): number;
}
//# sourceMappingURL=DOMPoint.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMPoint.d.ts","sourceRoot":"","sources":["../../src/dom/DOMPoint.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACrD;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;CACD"}

74
frontend/node_modules/happy-dom/lib/dom/DOMPoint.js generated vendored Normal file
View File

@@ -0,0 +1,74 @@
import DOMPointReadOnly from './DOMPointReadOnly.js';
import * as PropertySymbol from '../PropertySymbol.js';
/**
* DOM Point.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint
*/
export default class DOMPoint extends DOMPointReadOnly {
/**
* Sets x.
*
* @param value X.
*/
set x(value) {
this[PropertySymbol.x] = value;
}
/**
* Returns x.
*
* @returns X.
*/
get x() {
return this[PropertySymbol.x];
}
/**
* Sets y.
*
* @param value Y.
*/
set y(value) {
this[PropertySymbol.y] = value;
}
/**
* Returns y.
*
* @returns Y.
*/
get y() {
return this[PropertySymbol.y];
}
/**
* Sets z.
*
* @param value Z.
*/
set z(value) {
this[PropertySymbol.z] = value;
}
/**
* Returns z.
*
* @returns Z.
*/
get z() {
return this[PropertySymbol.z];
}
/**
* Sets w.
*
* @param value W.
*/
set w(value) {
this[PropertySymbol.w] = value;
}
/**
* Returns w.
*
* @returns W.
*/
get w() {
return this[PropertySymbol.w];
}
}
//# sourceMappingURL=DOMPoint.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMPoint.js","sourceRoot":"","sources":["../../src/dom/DOMPoint.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACrD;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;CACD"}

View File

@@ -0,0 +1,60 @@
import * as PropertySymbol from '../PropertySymbol.js';
import IDOMPointInit from './IDOMPointInit.js';
/**
* DOM Point Readonly.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly
*/
export default class DOMPointReadOnly implements IDOMPointInit {
protected [PropertySymbol.x]: number;
protected [PropertySymbol.y]: number;
protected [PropertySymbol.z]: number;
protected [PropertySymbol.w]: number;
/**
* Constructor.
*
* @param [x] X position.
* @param [y] Y position.
* @param [z] Width.
* @param [w] Height.
*/
constructor(x?: number | null, y?: number | null, z?: number | null, w?: number | null);
/**
* Returns x.
*
* @returns X.
*/
get x(): number;
/**
* Returns y.
*
* @returns Y.
*/
get y(): number;
/**
* Returns z.
*
* @returns Z.
*/
get z(): number;
/**
* Returns w.
*
* @returns W.
*/
get w(): number;
/**
* Returns the JSON representation of the object.
*
* @returns JSON representation.
*/
toJSON(): object;
/**
* Returns a new DOMPointReadOnly object.
*
* @param [otherPoint] Other point.
* @returns Cloned object.
*/
static fromPoint(otherPoint?: IDOMPointInit): DOMPointReadOnly;
}
//# sourceMappingURL=DOMPointReadOnly.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMPointReadOnly.d.ts","sourceRoot":"","sources":["../../src/dom/DOMPointReadOnly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,aAAa;IAC7D,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAK;IACzC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAK;IACzC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAK;IACzC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAK;IAEzC;;;;;;;OAOG;gBACS,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAOtF;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACI,MAAM,IAAI,MAAM;IASvB;;;;;OAKG;WACW,SAAS,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,gBAAgB;CAWrE"}

View File

@@ -0,0 +1,84 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* DOM Point Readonly.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly
*/
export default class DOMPointReadOnly {
[PropertySymbol.x] = 0;
[PropertySymbol.y] = 0;
[PropertySymbol.z] = 0;
[PropertySymbol.w] = 1;
/**
* Constructor.
*
* @param [x] X position.
* @param [y] Y position.
* @param [z] Width.
* @param [w] Height.
*/
constructor(x, y, z, w) {
this[PropertySymbol.x] = x !== undefined && x !== null ? Number(x) : 0;
this[PropertySymbol.y] = y !== undefined && y !== null ? Number(y) : 0;
this[PropertySymbol.z] = z !== undefined && z !== null ? Number(z) : 0;
this[PropertySymbol.w] = w !== undefined && w !== null ? Number(w) : 1;
}
/**
* Returns x.
*
* @returns X.
*/
get x() {
return this[PropertySymbol.x];
}
/**
* Returns y.
*
* @returns Y.
*/
get y() {
return this[PropertySymbol.y];
}
/**
* Returns z.
*
* @returns Z.
*/
get z() {
return this[PropertySymbol.z];
}
/**
* Returns w.
*
* @returns W.
*/
get w() {
return this[PropertySymbol.w];
}
/**
* Returns the JSON representation of the object.
*
* @returns JSON representation.
*/
toJSON() {
return {
x: this.x,
y: this.y,
z: this.z,
w: this.w
};
}
/**
* Returns a new DOMPointReadOnly object.
*
* @param [otherPoint] Other point.
* @returns Cloned object.
*/
static fromPoint(otherPoint) {
if (!otherPoint) {
return new this();
}
return new this(otherPoint.x ?? null, otherPoint.y ?? null, otherPoint.z ?? null, otherPoint.w ?? null);
}
}
//# sourceMappingURL=DOMPointReadOnly.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMPointReadOnly.js","sourceRoot":"","sources":["../../src/dom/DOMPointReadOnly.ts"],"names":[],"mappings":"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AC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACI,MAAM;QACZ,OAAO;YACN,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,CAAC,EAAE,IAAI,CAAC,CAAC;SACT,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,SAAS,CAAC,UAA0B;QACjD,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,OAAO,IAAI,IAAI,EAAE,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,IAAI,CACd,UAAU,CAAC,CAAC,IAAI,IAAI,EACpB,UAAU,CAAC,CAAC,IAAI,IAAI,EACpB,UAAU,CAAC,CAAC,IAAI,IAAI,EACpB,UAAU,CAAC,CAAC,IAAI,IAAI,CACpB,CAAC;IACH,CAAC;CACD"}

65
frontend/node_modules/happy-dom/lib/dom/DOMRect.d.ts generated vendored Normal file
View File

@@ -0,0 +1,65 @@
import DOMRectReadOnly from './DOMRectReadOnly.js';
import IDOMRectInit from './IDOMRectInit.js';
/**
* DOM Rect.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect
*/
export default class DOMRect extends DOMRectReadOnly {
/**
* Sets x.
*
* @param value X.
*/
set x(value: number);
/**
* Returns x.
*
* @returns X.
*/
get x(): number;
/**
* Sets y.
*
* @param value Y.
*/
set y(value: number);
/**
* Returns y.
*
* @returns Y.
*/
get y(): number;
/**
* Sets width.
*
* @param value Width.
*/
set width(value: number);
/**
* Returns width.
*
* @returns Width.
*/
get width(): number;
/**
* Sets height.
*
* @param value Height.
*/
set height(value: number);
/**
* Returns height.
*
* @returns Height.
*/
get height(): number;
/**
* Returns a new DOMRect object.
*
* @param other
* @returns Cloned object.
*/
static fromRect(other: IDOMRectInit): DOMRect;
}
//# sourceMappingURL=DOMRect.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMRect.d.ts","sourceRoot":"","sources":["../../src/dom/DOMRect.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,eAAe;IACnD;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED;;;;OAIG;IACH,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED;;;;OAIG;IACH,IAAW,MAAM,CAAC,KAAK,EAAE,MAAM,EAE9B;IAED;;;;OAIG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;;;OAKG;WACW,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;CAGpD"}

83
frontend/node_modules/happy-dom/lib/dom/DOMRect.js generated vendored Normal file
View File

@@ -0,0 +1,83 @@
import DOMRectReadOnly from './DOMRectReadOnly.js';
import * as PropertySymbol from '../PropertySymbol.js';
/**
* DOM Rect.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRect
*/
export default class DOMRect extends DOMRectReadOnly {
/**
* Sets x.
*
* @param value X.
*/
set x(value) {
this[PropertySymbol.x] = value;
}
/**
* Returns x.
*
* @returns X.
*/
get x() {
return this[PropertySymbol.x];
}
/**
* Sets y.
*
* @param value Y.
*/
set y(value) {
this[PropertySymbol.y] = value;
}
/**
* Returns y.
*
* @returns Y.
*/
get y() {
return this[PropertySymbol.y];
}
/**
* Sets width.
*
* @param value Width.
*/
set width(value) {
this[PropertySymbol.width] = value;
}
/**
* Returns width.
*
* @returns Width.
*/
get width() {
return this[PropertySymbol.width];
}
/**
* Sets height.
*
* @param value Height.
*/
set height(value) {
this[PropertySymbol.height] = value;
}
/**
* Returns height.
*
* @returns Height.
*/
get height() {
return this[PropertySymbol.height];
}
/**
* Returns a new DOMRect object.
*
* @param other
* @returns Cloned object.
*/
static fromRect(other) {
return new DOMRect(other.x, other.y, other.width, other.height);
}
}
//# sourceMappingURL=DOMRect.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMRect.js","sourceRoot":"","sources":["../../src/dom/DOMRect.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,eAAe;IACnD;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC,CAAC,KAAa;QACzB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,IAAW,CAAC;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAa;QAC7B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM,CAAC,KAAa;QAC9B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ,CAAC,KAAmB;QACzC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;CACD"}

View File

@@ -0,0 +1,21 @@
import DOMRect from './DOMRect.js';
/**
* DOM Rect List.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRectList
*/
export default class DOMRectList extends Array<DOMRect> {
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
*/
constructor(illegalConstructorSymbol: symbol);
/**
* Returns item by index.
*
* @param index Index.
*/
item(index: number): DOMRect;
}
//# sourceMappingURL=DOMRectList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMRectList.d.ts","sourceRoot":"","sources":["../../src/dom/DOMRectList.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AAGnC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,KAAK,CAAC,OAAO,CAAC;IACtD;;;;OAIG;gBACS,wBAAwB,EAAE,MAAM;IAW5C;;;;OAIG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAGnC"}

30
frontend/node_modules/happy-dom/lib/dom/DOMRectList.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* DOM Rect List.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRectList
*/
export default class DOMRectList extends Array {
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
*/
constructor(illegalConstructorSymbol) {
super();
// "illegalConstructorSymbol" can be "1" when calling the "splice()" method
if (illegalConstructorSymbol !== 1 &&
illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
}
/**
* Returns item by index.
*
* @param index Index.
*/
item(index) {
return this[index] ?? null;
}
}
//# sourceMappingURL=DOMRectList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMRectList.js","sourceRoot":"","sources":["../../src/dom/DOMRectList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,KAAc;IACtD;;;;OAIG;IACH,YAAY,wBAAgC;QAC3C,KAAK,EAAE,CAAC;QACR,2EAA2E;QAC3E,IACmB,wBAAyB,KAAK,CAAC;YACjD,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAC7D,CAAC;YACF,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CAAC;IACF,CAAC;IAED;;;;OAIG;IACI,IAAI,CAAC,KAAa;QACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC5B,CAAC;CACD"}

View File

@@ -0,0 +1,84 @@
import * as PropertySymbol from '../PropertySymbol.js';
import IDOMRectInit from './IDOMRectInit.js';
/**
* DOM Rect Readonly.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly
*/
export default class DOMRectReadOnly implements IDOMRectInit {
protected [PropertySymbol.x]: number;
protected [PropertySymbol.y]: number;
protected [PropertySymbol.width]: number;
protected [PropertySymbol.height]: number;
/**
* Constructor.
*
* @param [x] X position.
* @param [y] Y position.
* @param [width] Width.
* @param [height] Height.
*/
constructor(x?: number | null, y?: number | null, width?: number | null, height?: number | null);
/**
* Returns x.
*
* @returns X.
*/
get x(): number;
/**
* Returns y.
*
* @returns Y.
*/
get y(): number;
/**
* Returns width.
*
* @returns Width.
*/
get width(): number;
/**
* Returns height.
*
* @returns Height.
*/
get height(): number;
/**
* Returns top.
*
* @returns Top.
*/
get top(): number;
/**
* Returns right.
*
* @returns Right.
*/
get right(): number;
/**
* Returns bottom.
*
* @returns Bottom.
*/
get bottom(): number;
/**
* Returns left.
*
* @returns Left.
*/
get left(): number;
/**
* Returns the JSON representation of the object.
*
* @returns JSON representation.
*/
toJSON(): object;
/**
* Returns a new DOMRectReadOnly object.
*
* @param other
* @returns Cloned object.
*/
static fromRect(other: IDOMRectInit): DOMRectReadOnly;
}
//# sourceMappingURL=DOMRectReadOnly.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMRectReadOnly.d.ts","sourceRoot":"","sources":["../../src/dom/DOMRectReadOnly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,YAAY;IAC3D,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAK;IACzC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAK;IACzC,SAAS,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAK;IAC7C,SAAS,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,CAAK;IAE9C;;;;;;;OAOG;gBACS,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAO/F;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;;;OAIG;IACH,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED;;;;OAIG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;;OAIG;IACH,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED;;;;OAIG;IACH,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED;;;;OAIG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;;OAIG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;;OAIG;IACI,MAAM,IAAI,MAAM;IAavB;;;;;OAKG;WACW,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe;CAG5D"}

View File

@@ -0,0 +1,117 @@
import * as PropertySymbol from '../PropertySymbol.js';
/**
* DOM Rect Readonly.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly
*/
export default class DOMRectReadOnly {
[PropertySymbol.x] = 0;
[PropertySymbol.y] = 0;
[PropertySymbol.width] = 0;
[PropertySymbol.height] = 0;
/**
* Constructor.
*
* @param [x] X position.
* @param [y] Y position.
* @param [width] Width.
* @param [height] Height.
*/
constructor(x, y, width, height) {
this[PropertySymbol.x] = x !== undefined && x !== null ? Number(x) : 0;
this[PropertySymbol.y] = y !== undefined && y !== null ? Number(y) : 0;
this[PropertySymbol.width] = width !== undefined && width !== null ? Number(width) : 0;
this[PropertySymbol.height] = height !== undefined && height !== null ? Number(height) : 0;
}
/**
* Returns x.
*
* @returns X.
*/
get x() {
return this[PropertySymbol.x];
}
/**
* Returns y.
*
* @returns Y.
*/
get y() {
return this[PropertySymbol.y];
}
/**
* Returns width.
*
* @returns Width.
*/
get width() {
return this[PropertySymbol.width];
}
/**
* Returns height.
*
* @returns Height.
*/
get height() {
return this[PropertySymbol.height];
}
/**
* Returns top.
*
* @returns Top.
*/
get top() {
return Math.min(this[PropertySymbol.y], this[PropertySymbol.y] + this[PropertySymbol.height]);
}
/**
* Returns right.
*
* @returns Right.
*/
get right() {
return Math.max(this[PropertySymbol.x], this[PropertySymbol.x] + this[PropertySymbol.width]);
}
/**
* Returns bottom.
*
* @returns Bottom.
*/
get bottom() {
return Math.max(this[PropertySymbol.y], this[PropertySymbol.y] + this[PropertySymbol.height]);
}
/**
* Returns left.
*
* @returns Left.
*/
get left() {
return Math.min(this[PropertySymbol.x], this[PropertySymbol.x] + this[PropertySymbol.width]);
}
/**
* Returns the JSON representation of the object.
*
* @returns JSON representation.
*/
toJSON() {
return {
x: this.x,
y: this.y,
width: this.width,
height: this.height,
top: this.top,
right: this.right,
bottom: this.bottom,
left: this.left
};
}
/**
* Returns a new DOMRectReadOnly object.
*
* @param other
* @returns Cloned object.
*/
static fromRect(other) {
return new DOMRectReadOnly(other.x, other.y, other.width, other.height);
}
}
//# sourceMappingURL=DOMRectReadOnly.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMRectReadOnly.js","sourceRoot":"","sources":["../../src/dom/DOMRectReadOnly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IACzB,CAAC,cAAc,CAAC,CAAC,CAAC,GAAW,CAAC,CAAC;IAC/B,CAAC,cAAc,CAAC,CAAC,CAAC,GAAW,CAAC,CAAC;IAC/B,CAAC,cAAc,CAAC,KAAK,CAAC,GAAW,CAAC,CAAC;IACnC,CAAC,cAAc,CAAC,MAAM,CAAC,GAAW,CAAC,CAAC;IAE9C;;;;;;;OAOG;IACH,YAAY,CAAiB,EAAE,CAAiB,EAAE,KAAqB,EAAE,MAAsB;QAC9F,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAA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AE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACH,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACI,MAAM;QACZ,OAAO;YACN,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,QAAQ,CAAC,KAAmB;QACzC,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzE,CAAC;CACD"}

View File

@@ -0,0 +1,18 @@
import Element from '../nodes/element/Element.js';
/**
* Dataset factory.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
*/
export default class DOMStringMap {
[key: string]: string;
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param element Element.
*/
constructor(illegalConstructorSymbol: symbol, element: Element);
}
//# sourceMappingURL=DOMStringMap.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMStringMap.d.ts","sourceRoot":"","sources":["../../src/dom/DOMStringMap.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,6BAA6B,CAAC;AAIlD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;;;;OAKG;gBACS,wBAAwB,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;CAyE9D"}

View File

@@ -0,0 +1,74 @@
import * as PropertySymbol from '../PropertySymbol.js';
import DOMStringMapUtility from './DOMStringMapUtility.js';
/**
* Dataset factory.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
*/
export default class DOMStringMap {
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param element Element.
*/
constructor(illegalConstructorSymbol, element) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
// Documentation for Proxy:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
return new Proxy(this, {
get(_target, property) {
const attribute = element.getAttribute('data-' + DOMStringMapUtility.camelCaseToKebab(property));
if (attribute !== null) {
return attribute;
}
},
set(_target, property, value) {
element.setAttribute('data-' + DOMStringMapUtility.camelCaseToKebab(property), value);
return true;
},
deleteProperty(_target, property) {
element.removeAttribute('data-' + DOMStringMapUtility.camelCaseToKebab(property));
return true;
},
ownKeys(_target) {
// According to Mozilla we have to update the dataset object (target) to contain the same keys as what we return:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/ownKeys
// "The result List must contain the keys of all non-configurable own properties of the target object."
const keys = [];
for (const items of element[PropertySymbol.attributes][PropertySymbol.itemsByName].values()) {
if (items[0][PropertySymbol.name].startsWith('data-')) {
keys.push(DOMStringMapUtility.kebabToCamelCase(items[0][PropertySymbol.name].replace('data-', '')));
}
}
return keys;
},
has(_target, property) {
return element.hasAttribute('data-' + DOMStringMapUtility.camelCaseToKebab(property));
},
defineProperty(_target, property, descriptor) {
if (descriptor.value === undefined) {
return false;
}
element.setAttribute('data-' + DOMStringMapUtility.camelCaseToKebab(property), descriptor.value);
return true;
},
getOwnPropertyDescriptor(_target, property) {
const attribute = element.getAttribute('data-' + DOMStringMapUtility.camelCaseToKebab(property));
if (!attribute) {
return;
}
return {
value: attribute,
writable: true,
enumerable: true,
configurable: true
};
}
});
}
}
//# sourceMappingURL=DOMStringMap.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMStringMap.js","sourceRoot":"","sources":["../../src/dom/DOMStringMap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAGhC;;;;;OAKG;IACH,YAAY,wBAAgC,EAAE,OAAgB;QAC7D,IAAI,wBAAwB,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACpE,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CAAC;QAED,2BAA2B;QAC3B,yFAAyF;QACzF,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE;YACtB,GAAG,CAAC,OAAO,EAAE,QAAgB;gBAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CACrC,OAAO,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACxD,CAAC;gBACF,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;oBACxB,OAAO,SAAS,CAAC;gBAClB,CAAC;YACF,CAAC;YACD,GAAG,CAAC,OAAO,EAAE,QAAgB,EAAE,KAAa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AmB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EACxD,UAAU,CAAC,KAAK,CAChB,CAAC;gBAEF,OAAO,IAAI,CAAC;YACb,CAAC;YACD,wBAAwB,CAAC,OAAO,EAAE,QAAgB;gBACjD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CACrC,OAAO,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACxD,CAAC;gBACF,IAAI,CAAC,SAAS,EAAE,CAAC;oBAChB,OAAO;gBACR,CAAC;gBACD,OAAO;oBACN,KAAK,EAAE,SAAS;oBAChB,QAAQ,EAAE,IAAI;oBACd,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,IAAI;iBAClB,CAAC;YACH,CAAC;SACD,CAAC,CAAC;IACJ,CAAC;CACD"}

View File

@@ -0,0 +1,23 @@
/**
* DOMStringMap utility.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
*/
export default class DOMStringMapUtility {
/**
* Transforms a kebab cased string to camel case.
*
* @param text Text string.
* @returns Camel cased string.
*/
static kebabToCamelCase(text: string): string;
/**
* Transforms a camel cased string to kebab case.
*
* @param text Text string.
* @returns Kebab cased string.
*/
static camelCaseToKebab(text: string): string;
}
//# sourceMappingURL=DOMStringMapUtility.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMStringMapUtility.d.ts","sourceRoot":"","sources":["../../src/dom/DOMStringMapUtility.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACvC;;;;;OAKG;WACW,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAQpD;;;;;OAKG;WACW,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAKpD"}

View File

@@ -0,0 +1,33 @@
/**
* DOMStringMap utility.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
*/
export default class DOMStringMapUtility {
/**
* Transforms a kebab cased string to camel case.
*
* @param text Text string.
* @returns Camel cased string.
*/
static kebabToCamelCase(text) {
const parts = text.split('-');
for (let i = 0, max = parts.length; i < max; i++) {
parts[i] = i > 0 ? parts[i].charAt(0).toUpperCase() + parts[i].slice(1) : parts[i];
}
return parts.join('');
}
/**
* Transforms a camel cased string to kebab case.
*
* @param text Text string.
* @returns Kebab cased string.
*/
static camelCaseToKebab(text) {
return text
.toString()
.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());
}
}
//# sourceMappingURL=DOMStringMapUtility.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMStringMapUtility.js","sourceRoot":"","sources":["../../src/dom/DOMStringMapUtility.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACvC;;;;;OAKG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAY;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAClD,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAY;QAC1C,OAAO,IAAI;aACT,QAAQ,EAAE;aACV,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACrF,CAAC;CACD"}

View File

@@ -0,0 +1,121 @@
import Element from '../nodes/element/Element.js';
import * as PropertySymbol from '../PropertySymbol.js';
/**
* DOM Token List.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList.
*/
export default class DOMTokenList {
[index: number]: string;
private [PropertySymbol.ownerElement];
private [PropertySymbol.attributeName];
private [PropertySymbol.cache];
private [PropertySymbol.supports];
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param ownerElement Owner element.
* @param attributeName Attribute name.
* @param [supports] Supports.
*/
constructor(illegalConstructorSymbol: symbol, ownerElement: Element, attributeName: string, supports?: string[]);
/**
* Returns length.
*
* @returns Length.
*/
get length(): number;
/**
* Set value.
*
* @param value Value.
*/
set value(value: string);
/**
* Get value.
*/
get value(): string;
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator](): IterableIterator<string>;
/**
* Get ClassName.
*
* @param index Index.
* */
item(index: number | string): string;
/**
* Replace Token.
*
* @param token Token.
* @param newToken NewToken.
*/
replace(token: string, newToken: string): boolean;
/**
* Supports.
*
* @param token Token.
*/
supports(token: string): boolean;
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<string>;
/**
* Returns an iterator, allowing you to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[number, string]>;
/**
* Executes a provided callback function once for each DOMTokenList element.
*
* @param callback
* @param thisArg
*/
forEach(callback: (currentValue: any, currentIndex: any, listObj: any) => void, thisArg?: this): void;
/**
* Returns an iterator, allowing you to go through all keys of the key/value pairs contained in this object.
*
*/
keys(): IterableIterator<number>;
/**
* Adds tokens.
*
* @param tokens Tokens.
*/
add(...tokens: string[]): void;
/**
* Removes tokens.
*
* @param tokens Tokens.
*/
remove(...tokens: string[]): void;
/**
* Check if the list contains a class.
*
* @param className Class name.
* @returns TRUE if it contains.
*/
contains(className: string): boolean;
/**
* Toggle a class name.
*
* @param token A string representing the class name you want to toggle.
* @param [force] If included, turns the toggle into a one way-only operation. If set to `false`, then class name will only be removed, but not added. If set to `true`, then class name will only be added, but not removed.
* @returns A boolean value, `true` or `false`, indicating whether class name is in the list after the call or not.
*/
toggle(token: string, force?: boolean): boolean;
/**
* Returns token list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getTokenList](): string[];
/**
* Returns DOMTokenList value.
*/
toString(): string;
}
//# sourceMappingURL=DOMTokenList.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMTokenList.d.ts","sourceRoot":"","sources":["../../src/dom/DOMTokenList.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,6BAA6B,CAAC;AAClD,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAIvD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAChC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB,OAAO,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAU;IAC/C,OAAO,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAS;IAC/C,OAAO,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAG5B;IACF,OAAO,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAW;IAE5C;;;;;;;OAOG;gBAEF,wBAAwB,EAAE,MAAM,EAChC,YAAY,EAAE,OAAO,EACrB,aAAa,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,EAAE;IA8FpB;;;;OAIG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;;;OAIG;IACH,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED;;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'../utilities/ClassMethodBinder.js';
import * as PropertySymbol from '../PropertySymbol.js';
const ATTRIBUTE_SPLIT_REGEXP = /[\t\f\n\r ]+/;
/**
* DOM Token List.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList.
*/
export default class DOMTokenList {
[PropertySymbol.ownerElement];
[PropertySymbol.attributeName];
[PropertySymbol.cache] = {
items: [],
attributeValue: ''
};
[PropertySymbol.supports];
/**
* Constructor.
*
* @param illegalConstructorSymbol Illegal constructor symbol.
* @param ownerElement Owner element.
* @param attributeName Attribute name.
* @param [supports] Supports.
*/
constructor(illegalConstructorSymbol, ownerElement, attributeName, supports) {
if (illegalConstructorSymbol !== PropertySymbol.illegalConstructor) {
throw new TypeError('Illegal constructor');
}
this[PropertySymbol.ownerElement] = ownerElement;
this[PropertySymbol.attributeName] = attributeName;
this[PropertySymbol.supports] = supports || [];
const methodBinder = new ClassMethodBinder(this, [DOMTokenList]);
return new Proxy(this, {
get: (target, property) => {
if (property === 'length') {
return target[PropertySymbol.getTokenList]().length;
}
if (property in target || typeof property === 'symbol') {
methodBinder.bind(property);
return target[property];
}
const index = Number(property);
if (!isNaN(index)) {
return target[PropertySymbol.getTokenList]()[index];
}
},
set(target, property, newValue) {
methodBinder.bind(property);
if (typeof property === 'symbol') {
target[property] = newValue;
return true;
}
const index = Number(property);
if (isNaN(index)) {
target[property] = newValue;
}
return true;
},
deleteProperty(target, property) {
if (typeof property === 'symbol') {
delete target[property];
return true;
}
const index = Number(property);
if (isNaN(index)) {
delete target[property];
}
return true;
},
ownKeys(target) {
return Object.keys(target[PropertySymbol.getTokenList]());
},
has(target, property) {
if (property in target) {
return true;
}
if (typeof property === 'symbol') {
return false;
}
const index = Number(property);
return !isNaN(index) && index >= 0 && index < target[PropertySymbol.getTokenList]().length;
},
defineProperty(target, property, descriptor) {
methodBinder.preventBinding(property);
if (property in target) {
Object.defineProperty(target, property, descriptor);
return true;
}
return false;
},
getOwnPropertyDescriptor(target, property) {
if (property in target || typeof property === 'symbol') {
return;
}
const index = Number(property);
const items = target[PropertySymbol.getTokenList]();
if (!isNaN(index) && items[index]) {
return {
value: items[index],
writable: false,
enumerable: true,
configurable: true
};
}
}
});
}
/**
* Returns length.
*
* @returns Length.
*/
get length() {
return this[PropertySymbol.getTokenList]().length;
}
/**
* Set value.
*
* @param value Value.
*/
set value(value) {
this[PropertySymbol.ownerElement].setAttribute(this[PropertySymbol.attributeName], value);
}
/**
* Get value.
*/
get value() {
return this[PropertySymbol.ownerElement].getAttribute(this[PropertySymbol.attributeName]);
}
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
[Symbol.iterator]() {
return this[PropertySymbol.getTokenList]().values();
}
/**
* Get ClassName.
*
* @param index Index.
* */
item(index) {
const items = this[PropertySymbol.getTokenList]();
if (typeof index === 'number') {
return items[index] ? items[index] : null;
}
index = Number(index);
index = isNaN(index) ? 0 : index;
return items[index] ? items[index] : null;
}
/**
* Replace Token.
*
* @param token Token.
* @param newToken NewToken.
*/
replace(token, newToken) {
const list = this[PropertySymbol.getTokenList]().slice();
const index = list.indexOf(token);
if (index === -1) {
return false;
}
list[index] = newToken;
this[PropertySymbol.ownerElement].setAttribute(this[PropertySymbol.attributeName], list.join(' '));
return true;
}
/**
* Supports.
*
* @param token Token.
*/
supports(token) {
return this[PropertySymbol.supports].includes(token);
}
/**
* Returns an iterator, allowing you to go through all values of the key/value pairs contained in this object.
*/
values() {
return this[PropertySymbol.getTokenList]().values();
}
/**
* Returns an iterator, allowing you to go through all key/value pairs contained in this object.
*/
entries() {
return this[PropertySymbol.getTokenList]().entries();
}
/**
* Executes a provided callback function once for each DOMTokenList element.
*
* @param callback
* @param thisArg
*/
forEach(callback, thisArg) {
return this[PropertySymbol.getTokenList]().forEach(callback, thisArg);
}
/**
* Returns an iterator, allowing you to go through all keys of the key/value pairs contained in this object.
*
*/
keys() {
return this[PropertySymbol.getTokenList]().keys();
}
/**
* Adds tokens.
*
* @param tokens Tokens.
*/
add(...tokens) {
const list = this[PropertySymbol.getTokenList]().slice();
for (const token of tokens) {
const index = list.indexOf(token);
if (index === -1) {
list.push(token);
}
}
this[PropertySymbol.ownerElement].setAttribute(this[PropertySymbol.attributeName], list.join(' '));
}
/**
* Removes tokens.
*
* @param tokens Tokens.
*/
remove(...tokens) {
const list = this[PropertySymbol.getTokenList]().slice();
for (const token of tokens) {
const index = list.indexOf(token);
if (index !== -1) {
list.splice(index, 1);
}
}
this[PropertySymbol.ownerElement].setAttribute(this[PropertySymbol.attributeName], list.join(' '));
}
/**
* Check if the list contains a class.
*
* @param className Class name.
* @returns TRUE if it contains.
*/
contains(className) {
return this[PropertySymbol.getTokenList]().includes(className);
}
/**
* Toggle a class name.
*
* @param token A string representing the class name you want to toggle.
* @param [force] If included, turns the toggle into a one way-only operation. If set to `false`, then class name will only be removed, but not added. If set to `true`, then class name will only be added, but not removed.
* @returns A boolean value, `true` or `false`, indicating whether class name is in the list after the call or not.
*/
toggle(token, force) {
let shouldAdd;
if (force !== undefined) {
shouldAdd = force;
}
else {
shouldAdd = !this.contains(token);
}
if (shouldAdd) {
this.add(token);
return true;
}
this.remove(token);
return false;
}
/**
* Returns token list from attribute value.
*
* @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
*/
[PropertySymbol.getTokenList]() {
const attributeValue = this[PropertySymbol.ownerElement].getAttribute(this[PropertySymbol.attributeName]) ?? '';
const cache = this[PropertySymbol.cache];
if (cache.attributeValue === attributeValue) {
return cache.items;
}
// It is possible to make this statement shorter by using Array.from() and Set, but this is faster when comparing using a bench test.
const items = [];
const trimmed = attributeValue.trim();
if (trimmed) {
for (const item of trimmed.split(ATTRIBUTE_SPLIT_REGEXP)) {
if (!items.includes(item)) {
items.push(item);
}
}
}
cache.attributeValue = attributeValue;
cache.items = items;
return items;
}
/**
* Returns DOMTokenList value.
*/
toString() {
return this.value || '';
}
}
//# sourceMappingURL=DOMTokenList.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
export default interface IDOMPointInit {
readonly x?: number;
readonly y?: number;
readonly z?: number;
readonly w?: number;
}
//# sourceMappingURL=IDOMPointInit.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMPointInit.d.ts","sourceRoot":"","sources":["../../src/dom/IDOMPointInit.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,aAAa;IACrC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=IDOMPointInit.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMPointInit.js","sourceRoot":"","sources":["../../src/dom/IDOMPointInit.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,7 @@
export default interface IDOMRectInit {
readonly x: number;
readonly y: number;
readonly width: number;
readonly height: number;
}
//# sourceMappingURL=IDOMRectInit.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMRectInit.d.ts","sourceRoot":"","sources":["../../src/dom/IDOMRectInit.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,YAAY;IACpC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=IDOMRectInit.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMRectInit.js","sourceRoot":"","sources":["../../src/dom/IDOMRectInit.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,296 @@
import DOMMatrixReadOnly from './DOMMatrixReadOnly.js';
import IDOMMatrixCompatibleObject from './IDOMMatrixCompatibleObject.js';
import TDOMMatrixInit from './TDOMMatrixInit.js';
/**
* DOM Matrix.
*
* Based on:
* - https://github.com/thednp/dommatrix/tree/master
* - https://github.com/trusktr/geometry-interfaces
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix
*/
export default class DOMMatrix extends DOMMatrixReadOnly {
/**
* Returns the `a` value of the matrix.
*/
get a(): number;
/**
* Sets the `a` value of the matrix.
*/
set a(value: number);
/**
* Returns the `b` value of the matrix.
*/
get b(): number;
/**
* Sets the `b` value of the matrix.
*/
set b(value: number);
/**
* Returns the `c` value of the matrix.
*/
get c(): number;
/**
* Sets the `c` value of the matrix.
*/
set c(value: number);
/**
* Returns the `d` value of the matrix.
*/
get d(): number;
/**
* Sets the `d` value of the matrix.
*/
set d(value: number);
/**
* Returns the `e` value of the matrix.
*/
get e(): number;
/**
* Sets the `e` value of the matrix.
*/
set e(value: number);
/**
* Returns the `f` value of the matrix.
*/
get f(): number;
/**
* Sets the `f` value of the matrix.
*/
set f(value: number);
/**
* Returns the `m11` value of the matrix.
*/
get m11(): number;
/**
* Sets the `m11` value of the matrix.
*/
set m11(value: number);
/**
* Returns the `m12` value of the matrix.
*/
get m12(): number;
/**
* Sets the `m12` value of the matrix.
*/
set m12(value: number);
/**
* Returns the `m13` value of the matrix.
*/
get m13(): number;
/**
* Sets the `m13` value of the matrix.
*/
set m13(value: number);
/**
* Returns the `m14` value of the matrix.
*/
get m14(): number;
/**
* Sets the `m14` value of the matrix.
*/
set m14(value: number);
/**
* Returns the `m21` value of the matrix.
*/
get m21(): number;
/**
* Sets the `m21` value of the matrix.
*/
set m21(value: number);
/**
* Returns the `m22` value of the matrix.
*/
get m22(): number;
/**
* Sets the `m22` value of the matrix.
*/
set m22(value: number);
/**
* Returns the `m23` value of the matrix.
*/
get m23(): number;
/**
* Sets the `m23` value of the matrix.
*/
set m23(value: number);
/**
* Returns the `m24` value of the matrix.
*/
get m24(): number;
/**
* Sets the `m24` value of the matrix.
*/
set m24(value: number);
/**
* Returns the `m31` value of the matrix.
*/
get m31(): number;
/**
* Sets the `m31` value of the matrix.
*/
set m31(value: number);
/**
* Returns the `m32` value of the matrix.
*/
get m32(): number;
/**
* Sets the `m32` value of the matrix.
*/
set m32(value: number);
/**
* Returns the `m33` value of the matrix.
*/
get m33(): number;
/**
* Sets the `m33` value of the matrix.
*/
set m33(value: number);
/**
* Returns the `m34` value of the matrix.
*/
get m34(): number;
/**
* Sets the `m34` value of the matrix.
*/
set m34(value: number);
/**
* Returns the `m41` value of the matrix.
*/
get m41(): number;
/**
* Sets the `m41` value of the matrix.
*/
set m41(value: number);
/**
* Returns the `m42` value of the matrix.
*/
get m42(): number;
/**
* Sets the `m42` value of the matrix.
*/
set m42(value: number);
/**
* Returns the `m43` value of the matrix.
*/
get m43(): number;
/**
* Sets the `m43` value of the matrix.
*/
set m43(value: number);
/**
* Returns the `m44` value of the matrix.
*/
get m44(): number;
/**
* Sets the `m44` value of the matrix.
*/
set m44(value: number);
/**
* The `setMatrixValue` method replaces the existing matrix with one computed in the browser (e.g.`matrix(1,0.25,-0.25,1,0,0)`).
*
* @param source A `DOMMatrix`, `Float32Array`, `Float64Array`, `Array`, or DOMMatrix compatible object to set the matrix values from.
* @returns Self.
*/
setMatrixValue(source?: TDOMMatrixInit): DOMMatrix;
/**
* Sets self to be multiplied by the passed matrix.
*
* @param secondMatrix DOMMatrix
* @returns Self.
*/
multiplySelf(secondMatrix: IDOMMatrixCompatibleObject): DOMMatrix;
/**
* Sets self to multiplied by a translation matrix containing the passed values.
*
* @param [x=0] X component of the translation value.
* @param [y=0] Y component of the translation value.
* @param [z=0] Z component of the translation value.
* @returns Self.
*/
translateSelf(x?: number, y?: number, z?: number): DOMMatrix;
/**
* Sets self to be multiplied by a scale matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @param [scaleZ] Z-Axis scale.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
* @returns Self.
*/
scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
/**
* Sets self to be multiplied by a scale matrix containing the passed values.
*
* @param [scale] The scale factor.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
* @returns Self.
*/
scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
/**
* Sets self to be multiplied by a scale matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @returns Self.
*/
scaleNonUniformSelf(scaleX?: number, scaleY?: number): DOMMatrix;
/**
* Sets self to be multiplied by a rotation matrix with the given axis and `angle`.
*
* @param [x] The X component of the axis vector.
* @param [y] The Y component of the axis vector.
* @param [z] The Z component of the axis vector.
* @param [angle] Angle of rotation about the axis vector, in degrees.
* @returns Self.
*/
rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrixReadOnly;
/**
* Set self to be multiplied by each of 3 rotation matrices about the major axes, first X, then Y, then Z.
*
* @param [x] X component of the rotation, or Z if Y and Z are null.
* @param [y] Y component of the rotation value.
* @param [z] Z component of the rotation value.
* @returns Self.
*/
rotateSelf(x?: number, y?: number, z?: number): DOMMatrixReadOnly;
/**
* Sets self to be multiplied by a skew matrix along the X axis by the given angle.
*
* @param [x] X-Axis skew.
* @param [y] Y-Axis skew.
*/
rotateFromVectorSelf(x?: number, y?: number): DOMMatrixReadOnly;
/**
* Set self to be specified as a skew transformation along X-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns Self.
*/
skewXSelf(angle: number): DOMMatrixReadOnly;
/**
* Set self to be specified as a skew transformation along Y-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns Self.
*/
skewYSelf(angle: number): DOMMatrixReadOnly;
/**
* Set self to be specified as matrix flipped on X-axis.
*/
flipXSelf(): DOMMatrixReadOnly;
/**
* Set self to be specified as matrix flipped on Y-axis.
*/
flipYSelf(): DOMMatrixReadOnly;
/**
* Set self to be specified as matrix inverted.
*/
invertSelf(): DOMMatrixReadOnly;
}
//# sourceMappingURL=DOMMatrix.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DOMMatrix.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-matrix/DOMMatrix.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,0BAA0B,MAAM,iCAAiC,CAAC;AACzE,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,iBAAiB;IACvD;;OAEG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,IAAW,CAAC,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAW,CAAC,CAAC,KAAK,EAAE,MAAM,EAEzB;IAED;;OAEG;IACH,IAAW,GAAG,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,IAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED;;OAE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,GAAG,iBAAiB;IAKnE;;;;;OAKG;IACI,oBAAoB,CAAC,CAAC,SAAI,EAAE,CAAC,SAAI,GAAG,iBAAiB;IAK5D;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAKlD;;;;;OAKG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAKlD;;OAEG;IACI,SAAS,IAAI,iBAAiB;IAKrC;;OAEG;IACI,SAAS,IAAI,iBAAiB;IAKrC;;OAEG;IACI,UAAU,IAAI,iBAAiB;CAItC"}

View File

@@ -0,0 +1,425 @@
import * as PropertySymbol from '../../PropertySymbol.js';
import DOMMatrixReadOnly from './DOMMatrixReadOnly.js';
/**
* DOM Matrix.
*
* Based on:
* - https://github.com/thednp/dommatrix/tree/master
* - https://github.com/trusktr/geometry-interfaces
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix
*/
export default class DOMMatrix extends DOMMatrixReadOnly {
/**
* Returns the `a` value of the matrix.
*/
get a() {
return this[PropertySymbol.m11];
}
/**
* Sets the `a` value of the matrix.
*/
set a(value) {
this[PropertySymbol.m11] = value;
}
/**
* Returns the `b` value of the matrix.
*/
get b() {
return this[PropertySymbol.m12];
}
/**
* Sets the `b` value of the matrix.
*/
set b(value) {
this[PropertySymbol.m12] = value;
}
/**
* Returns the `c` value of the matrix.
*/
get c() {
return this[PropertySymbol.m21];
}
/**
* Sets the `c` value of the matrix.
*/
set c(value) {
this[PropertySymbol.m21] = value;
}
/**
* Returns the `d` value of the matrix.
*/
get d() {
return this[PropertySymbol.m22];
}
/**
* Sets the `d` value of the matrix.
*/
set d(value) {
this[PropertySymbol.m22] = value;
}
/**
* Returns the `e` value of the matrix.
*/
get e() {
return this[PropertySymbol.m41];
}
/**
* Sets the `e` value of the matrix.
*/
set e(value) {
this[PropertySymbol.m41] = value;
}
/**
* Returns the `f` value of the matrix.
*/
get f() {
return this[PropertySymbol.m42];
}
/**
* Sets the `f` value of the matrix.
*/
set f(value) {
this[PropertySymbol.m42] = value;
}
/**
* Returns the `m11` value of the matrix.
*/
get m11() {
return this[PropertySymbol.m11];
}
/**
* Sets the `m11` value of the matrix.
*/
set m11(value) {
this[PropertySymbol.m11] = value;
}
/**
* Returns the `m12` value of the matrix.
*/
get m12() {
return this[PropertySymbol.m12];
}
/**
* Sets the `m12` value of the matrix.
*/
set m12(value) {
this[PropertySymbol.m12] = value;
}
/**
* Returns the `m13` value of the matrix.
*/
get m13() {
return this[PropertySymbol.m13];
}
/**
* Sets the `m13` value of the matrix.
*/
set m13(value) {
this[PropertySymbol.m13] = value;
}
/**
* Returns the `m14` value of the matrix.
*/
get m14() {
return this[PropertySymbol.m14];
}
/**
* Sets the `m14` value of the matrix.
*/
set m14(value) {
this[PropertySymbol.m14] = value;
}
/**
* Returns the `m21` value of the matrix.
*/
get m21() {
return this[PropertySymbol.m21];
}
/**
* Sets the `m21` value of the matrix.
*/
set m21(value) {
this[PropertySymbol.m21] = value;
}
/**
* Returns the `m22` value of the matrix.
*/
get m22() {
return this[PropertySymbol.m22];
}
/**
* Sets the `m22` value of the matrix.
*/
set m22(value) {
this[PropertySymbol.m22] = value;
}
/**
* Returns the `m23` value of the matrix.
*/
get m23() {
return this[PropertySymbol.m23];
}
/**
* Sets the `m23` value of the matrix.
*/
set m23(value) {
this[PropertySymbol.m23] = value;
}
/**
* Returns the `m24` value of the matrix.
*/
get m24() {
return this[PropertySymbol.m24];
}
/**
* Sets the `m24` value of the matrix.
*/
set m24(value) {
this[PropertySymbol.m24] = value;
}
/**
* Returns the `m31` value of the matrix.
*/
get m31() {
return this[PropertySymbol.m31];
}
/**
* Sets the `m31` value of the matrix.
*/
set m31(value) {
this[PropertySymbol.m31] = value;
}
/**
* Returns the `m32` value of the matrix.
*/
get m32() {
return this[PropertySymbol.m32];
}
/**
* Sets the `m32` value of the matrix.
*/
set m32(value) {
this[PropertySymbol.m32] = value;
}
/**
* Returns the `m33` value of the matrix.
*/
get m33() {
return this[PropertySymbol.m33];
}
/**
* Sets the `m33` value of the matrix.
*/
set m33(value) {
this[PropertySymbol.m33] = value;
}
/**
* Returns the `m34` value of the matrix.
*/
get m34() {
return this[PropertySymbol.m34];
}
/**
* Sets the `m34` value of the matrix.
*/
set m34(value) {
this[PropertySymbol.m34] = value;
}
/**
* Returns the `m41` value of the matrix.
*/
get m41() {
return this[PropertySymbol.m41];
}
/**
* Sets the `m41` value of the matrix.
*/
set m41(value) {
this[PropertySymbol.m41] = value;
}
/**
* Returns the `m42` value of the matrix.
*/
get m42() {
return this[PropertySymbol.m42];
}
/**
* Sets the `m42` value of the matrix.
*/
set m42(value) {
this[PropertySymbol.m42] = value;
}
/**
* Returns the `m43` value of the matrix.
*/
get m43() {
return this[PropertySymbol.m43];
}
/**
* Sets the `m43` value of the matrix.
*/
set m43(value) {
this[PropertySymbol.m43] = value;
}
/**
* Returns the `m44` value of the matrix.
*/
get m44() {
return this[PropertySymbol.m44];
}
/**
* Sets the `m44` value of the matrix.
*/
set m44(value) {
this[PropertySymbol.m44] = value;
}
/**
* The `setMatrixValue` method replaces the existing matrix with one computed in the browser (e.g.`matrix(1,0.25,-0.25,1,0,0)`).
*
* @param source A `DOMMatrix`, `Float32Array`, `Float64Array`, `Array`, or DOMMatrix compatible object to set the matrix values from.
* @returns Self.
*/
setMatrixValue(source) {
this[PropertySymbol.setMatrixValue](source);
return this;
}
/**
* Sets self to be multiplied by the passed matrix.
*
* @param secondMatrix DOMMatrix
* @returns Self.
*/
multiplySelf(secondMatrix) {
this[PropertySymbol.multiplySelf](secondMatrix);
return this;
}
/**
* Sets self to multiplied by a translation matrix containing the passed values.
*
* @param [x=0] X component of the translation value.
* @param [y=0] Y component of the translation value.
* @param [z=0] Z component of the translation value.
* @returns Self.
*/
translateSelf(x = 0, y = 0, z = 0) {
this[PropertySymbol.translateSelf](x, y, z);
return this;
}
/**
* Sets self to be multiplied by a scale matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @param [scaleZ] Z-Axis scale.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
* @returns Self.
*/
scaleSelf(scaleX, scaleY, scaleZ = 1, originX = 0, originY = 0, originZ = 0) {
this[PropertySymbol.scaleSelf](scaleX, scaleY, scaleZ, originX, originY, originZ);
return this;
}
/**
* Sets self to be multiplied by a scale matrix containing the passed values.
*
* @param [scale] The scale factor.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
* @returns Self.
*/
scale3dSelf(scale = 1, originX = 0, originY = 0, originZ = 0) {
this[PropertySymbol.scale3dSelf](scale, originX, originY, originZ);
return this;
}
/**
* Sets self to be multiplied by a scale matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @returns Self.
*/
scaleNonUniformSelf(scaleX = 1, scaleY = 1) {
this[PropertySymbol.scaleNonUniformSelf](scaleX, scaleY);
return this;
}
/**
* Sets self to be multiplied by a rotation matrix with the given axis and `angle`.
*
* @param [x] The X component of the axis vector.
* @param [y] The Y component of the axis vector.
* @param [z] The Z component of the axis vector.
* @param [angle] Angle of rotation about the axis vector, in degrees.
* @returns Self.
*/
rotateAxisAngleSelf(x = 0, y = 0, z = 0, angle = 0) {
this[PropertySymbol.rotateAxisAngleSelf](x, y, z, angle);
return this;
}
/**
* Set self to be multiplied by each of 3 rotation matrices about the major axes, first X, then Y, then Z.
*
* @param [x] X component of the rotation, or Z if Y and Z are null.
* @param [y] Y component of the rotation value.
* @param [z] Z component of the rotation value.
* @returns Self.
*/
rotateSelf(x = 0, y, z) {
this[PropertySymbol.rotateSelf](x, y, z);
return this;
}
/**
* Sets self to be multiplied by a skew matrix along the X axis by the given angle.
*
* @param [x] X-Axis skew.
* @param [y] Y-Axis skew.
*/
rotateFromVectorSelf(x = 0, y = 0) {
this[PropertySymbol.rotateFromVectorSelf](x, y);
return this;
}
/**
* Set self to be specified as a skew transformation along X-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns Self.
*/
skewXSelf(angle) {
this[PropertySymbol.skewXSelf](angle);
return this;
}
/**
* Set self to be specified as a skew transformation along Y-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns Self.
*/
skewYSelf(angle) {
this[PropertySymbol.skewYSelf](angle);
return this;
}
/**
* Set self to be specified as matrix flipped on X-axis.
*/
flipXSelf() {
this[PropertySymbol.flipXSelf]();
return this;
}
/**
* Set self to be specified as matrix flipped on Y-axis.
*/
flipYSelf() {
this[PropertySymbol.flipYSelf]();
return this;
}
/**
* Set self to be specified as matrix inverted.
*/
invertSelf() {
this[PropertySymbol.invertSelf]();
return this;
}
}
//# sourceMappingURL=DOMMatrix.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,485 @@
import DOMPoint from '../DOMPoint.js';
import IDOMPointInit from '../IDOMPointInit.js';
import * as PropertySymbol from '../../PropertySymbol.js';
import TDOMMatrixInit from './TDOMMatrixInit.js';
import TDOMMatrix2DArray from './TDOMMatrix2DArray.js';
import TDOMMatrix3DArray from './TDOMMatrix3DArray.js';
import IDOMMatrixJSON from './IDOMMatrixJSON.js';
import IDOMMatrixCompatibleObject from './IDOMMatrixCompatibleObject.js';
/**
* DOM Matrix.
*
* Based on:
* - https://github.com/trusktr/geometry-interfaces
* - https://github.com/thednp/dommatrix/tree/master
* - https://github.com/jarek-foksa/geometry-polyfill/blob/master/geometry-polyfill.js
* - https://github.com/Automattic/node-canvas/blob/master/lib/DOMMatrix.js
*
*
* 3D Matrix:
* _________________________
* | m11 | m21 | m31 | m41 |
* | m12 | m22 | m32 | m42 |
* | m13 | m23 | m33 | m43 |
* | m14 | m24 | m34 | m44 |
* -------------------------̣
*
* 2D Matrix:
* _________________________
* | m11 | m21 | 0 | m41 |
* | m12 | m22 | 0 | m42 |
* | 0 | 0 | 1 | 0 |
* | 0 | 0 | 0 | 1 |
* -------------------------
*
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly
*/
export default class DOMMatrixReadOnly {
#private;
[PropertySymbol.m11]: number;
[PropertySymbol.m12]: number;
[PropertySymbol.m13]: number;
[PropertySymbol.m14]: number;
[PropertySymbol.m21]: number;
[PropertySymbol.m22]: number;
[PropertySymbol.m23]: number;
[PropertySymbol.m24]: number;
[PropertySymbol.m31]: number;
[PropertySymbol.m32]: number;
[PropertySymbol.m33]: number;
[PropertySymbol.m34]: number;
[PropertySymbol.m41]: number;
[PropertySymbol.m42]: number;
[PropertySymbol.m43]: number;
[PropertySymbol.m44]: number;
/**
* Constructor.
*
* @param init Init parameter.
*/
constructor(init?: TDOMMatrixInit);
/**
* Returns the `a` value of the matrix.
*/
get a(): number;
/**
* Returns the `b` value of the matrix.
*/
get b(): number;
/**
* Returns the `c` value of the matrix.
*/
get c(): number;
/**
* Returns the `d` value of the matrix.
*/
get d(): number;
/**
* Returns the `e` value of the matrix.
*/
get e(): number;
/**
* Returns the `f` value of the matrix.
*/
get f(): number;
/**
* Returns the `m11` value of the matrix.
*/
get m11(): number;
/**
* Returns the `m12` value of the matrix.
*/
get m12(): number;
/**
* Returns the `m13` value of the matrix.
*/
get m13(): number;
/**
* Returns the `m14` value of the matrix.
*/
get m14(): number;
/**
* Returns the `m21` value of the matrix.
*/
get m21(): number;
/**
* Returns the `m22` value of the matrix.
*/
get m22(): number;
/**
* Returns the `m23` value of the matrix.
*/
get m23(): number;
/**
* Returns the `m24` value of the matrix.
*/
get m24(): number;
/**
* Returns the `m31` value of the matrix.
*/
get m31(): number;
/**
* Returns the `m32` value of the matrix.
*/
get m32(): number;
/**
* Returns the `m33` value of the matrix.
*/
get m33(): number;
/**
* Returns the `m34` value of the matrix.
*/
get m34(): number;
/**
* Returns the `m41` value of the matrix.
*/
get m41(): number;
/**
* Returns the `m42` value of the matrix.
*/
get m42(): number;
/**
* Returns the `m43` value of the matrix.
*/
get m43(): number;
/**
* Returns the `m44` value of the matrix.
*/
get m44(): number;
/**
* A `Boolean` whose value is `true` if the matrix is the identity matrix.
*
* The identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).
*
* @returns "true" if the matrix is the identity matrix.
*/
get isIdentity(): boolean;
/**
* A `Boolean` flag whose value is `true` if the matrix is a 2D matrix and `false` if the matrix is 3D.
*
* @returns "true" if the matrix is a 2D matrix.
*/
get is2D(): boolean;
/**
* Returns a *Float32Array* containing elements which comprise the matrix.
*
* The method can return either the 16 elements or the 6 elements depending on the value of the `is2D` parameter.
*
* @param [is2D] Set to `true` to return a 2D matrix.
* @returns An *Array* representation of the matrix.
*/
toFloat32Array(is2D?: boolean): Float32Array;
/**
* Returns a *Float64Array* containing elements which comprise the matrix.
*
* The method can return either the 16 elements or the 6 elements depending on the value of the `is2D` parameter.
*
* @param [is2D] Set to `true` to return a 2D matrix.
* @returns An *Array* representation of the matrix
*/
toFloat64Array(is2D?: boolean): Float64Array;
/**
* Returns a string representation of the matrix in `CSS` matrix syntax, using the appropriate `CSS` matrix notation.
*
* Examples:
* - `matrix3d(m11, m12, m13, m14, m21, ...)`
* - `matrix(a, b, c, d, e, f)`
*
* @returns A string representation of the matrix.
*/
toString(): string;
/**
* Returns an Object that can be serialized to a JSON string.
*
* The result can be used as a second parameter for the `fromMatrix` static method to load values into another matrix instance.
*
* @returns An *Object* with matrix values.
*/
toJSON(): IDOMMatrixJSON;
/**
* Returns a new DOMMatrix instance which is the result of this matrix multiplied by the passed matrix.
*
* @param secondMatrix DOMMatrix
* @returns A new DOMMatrix object.
*/
multiply(secondMatrix: IDOMMatrixCompatibleObject): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by a translation matrix containing the passed values.
*
* @param [x=0] X component of the translation value.
* @param [y=0] Y component of the translation value.
* @param [z=0] Z component of the translation value.
* @returns The resulted matrix
*/
translate(x?: number, y?: number, z?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by a scale 2D matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @param [scaleZ] Z-Axis scale.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
* @returns The resulted matrix
*/
scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by a scale 3D matrix containing the passed values.
*
* @param [scale] The scale factor.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
* @returns The resulted matrix
*/
scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by a scale 3D matrix containing the passed values.
*
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @returns The resulted matrix
*/
scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by a rotation matrix with the given axis and `angle`.
*
* @param [x] The X component of the axis vector.
* @param [y] The Y component of the axis vector.
* @param [z] The Z component of the axis vector.
* @param [angle] Angle of rotation about the axis vector, in degrees.
* @returns The resulted matrix
*/
rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by each of 3 rotation matrices about the major axes, first X, then Y, then Z.
*
* @param [x] X component of the rotation, or Z if Y and Z are null.
* @param [y] Y component of the rotation value.
* @param [z] Z component of the rotation value.
* @returns The resulted matrix
*/
rotate(x?: number, y?: number, z?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix post multiplied by a rotation matrix with the angle between the specified vector and (1, 0).
*
* @param [x] X-Axis skew.
* @param [y] Y-Axis skew.
*/
rotateFromVector(x?: number, y?: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance that specifies a skew transformation along X-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns The resulted matrix
*/
skewX(angle: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance that specifies a skew transformation along Y-Axis by the given angle.
*
* @param angle Angle amount in degrees to skew.
* @returns The resulted matrix
*/
skewY(angle: number): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix flipped on X-axis.
*/
flipX(): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix flipped on Y-axis.
*/
flipY(): DOMMatrixReadOnly;
/**
* Returns a new DOMMatrix instance which is this matrix inversed.
*/
inverse(): DOMMatrixReadOnly;
/**
* Returns a new DOMPoint instance with the vector transformed using the matrix.
*
* @param domPoint DOM point compatible object.
* @returns A new DOMPoint object.
*/
transformPoint(domPoint: IDOMPointInit): DOMPoint;
/**
* The `setMatrixValue` method replaces the existing matrix with one computed in the browser (e.g.`matrix(1,0.25,-0.25,1,0,0)`).
*
* @param source A `DOMMatrix`, `Float32Array`, `Float64Array`, `Array`, or DOMMatrix compatible object to set the matrix values from.
*/
[PropertySymbol.setMatrixValue](source?: TDOMMatrixInit): void;
/**
* Applies a multiply operation to the current matrix.
*
* @param matrix Second matrix.
*/
[PropertySymbol.multiplySelf](matrix: IDOMMatrixCompatibleObject): void;
/**
* Applies translate to the matrix.
*
* This method is equivalent to the CSS `translate3d()` function.
*
* @see https://drafts.csswg.org/css-transforms-1/#TranslateDefined
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate3d
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param [x] X-Axis position.
* @param [y] Y-Axis position.
* @param [z] Z-Axis position.
*/
[PropertySymbol.translateSelf](x?: number, y?: number, z?: number): void;
/**
* Applies a scale to the matrix.
*
* This method is equivalent to the CSS `scale()` function.
*
* @see https://drafts.csswg.org/css-transforms-1/#ScaleDefined
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
* @param [scaleZ] Z-Axis scale.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
*/
[PropertySymbol.scaleSelf](scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): void;
/**
* Applies a scale to the matrix.
*
* This method is equivalent to the CSS `scale()` function.
*
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale3d
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param [scale] The scale factor.
* @param [originX] X-Axis scale.
* @param [originY] Y-Axis scale.
* @param [originZ] Z-Axis scale.
*/
[PropertySymbol.scale3dSelf](scale?: number, originX?: number, originY?: number, originZ?: number): void;
/**
* Applies a scale to the matrix.
*
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param [scaleX] X-Axis scale.
* @param [scaleY] Y-Axis scale.
*/
[PropertySymbol.scaleNonUniformSelf](scaleX?: number, scaleY?: number): void;
/**
* Applies a rotation to the matrix.
*
* This method is equivalent to the CSS `rotate3d()` function.
*
* @see https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-rotateaxisangleself
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d
* @param [x] X-Axis vector.
* @param [y] Y-Axis vector.
* @param [z] Z-Axis vector.
* @param [angle] Angle in degrees of the rotation.
*/
[PropertySymbol.rotateAxisAngleSelf](x?: number, y?: number, z?: number, angle?: number): void;
/**
* Applies a rotation to the matrix.
*
* @see http://en.wikipedia.org/wiki/Rotation_matrix
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param [x] X-Axis rotation in degrees.
* @param [y] Y-Axis rotation in degrees.
* @param [z] Z-Axis rotation in degrees.
*/
[PropertySymbol.rotateSelf](x?: number, y?: number, z?: number): void;
/**
* Modifies the matrix by rotating it by the angle between the specified vector and (1, 0).
*
* @param x The X component of the axis vector.
* @param y The Y component of the axis vector.
*/
[PropertySymbol.rotateFromVectorSelf](x?: number, y?: number): void;
/**
* Applies a skew operation to the matrix on the X axis.
*
* This method is equivalent to the CSS `skewX()` function.
*
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewX
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param angle Angle in degrees.
*/
[PropertySymbol.skewXSelf](angle: number): void;
/**
* Applies a skew operation to the matrix on the Y axis.
*
* This method is equivalent to the CSS `skewY()` function.
*
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewY
* @see https://www.w3.org/TR/css-transforms-1/#transform-functions
* @param angle Angle in degrees.
*/
[PropertySymbol.skewYSelf](angle: number): void;
/**
* Applies a flip operation to the matrix on the X axis.
*/
[PropertySymbol.flipXSelf](): void;
/**
* Applies a flip operation to the matrix on the Y axis.
*/
[PropertySymbol.flipYSelf](): void;
/**
* Applies an inversion operation to the matrix.
*/
[PropertySymbol.invertSelf](): void;
/**
* Returns an *Array* containing elements which comprise the matrix.
*
* @param matrix Matrix to convert.
* @param [is2D] If the matrix is 2D.
* @returns Array representation of the matrix.
*/
[PropertySymbol.toArray](is2D?: boolean): TDOMMatrix2DArray | TDOMMatrix3DArray;
/**
* Returns a new `DOMMatrix` instance given an existing matrix.
*
* @param matrix Matrix.
*/
static fromMatrix(matrix: IDOMMatrixCompatibleObject): DOMMatrixReadOnly;
/**
* Returns a new `DOMMatrix` instance given an array of 16/6 floating point values.
*
* @param array An `Array` to feed values from.
* @returns DOMMatrix instance.
*/
static fromFloat32Array(array: Float32Array): DOMMatrixReadOnly;
/**
* Returns a new `DOMMatrix` instance given an array of 16/6 floating point values.
*
* @param array An `Array` to feed values from.
* @returns DOMMatrix instance.
*/
static fromFloat64Array(array: Float64Array): DOMMatrixReadOnly;
/**
* Returns a new `DOMMatrix` instance given an array of 16/6 floating point values.
*
* Conditions:
* - If the array has six values, the result is a 2D matrix.
* - If the array has 16 values, the result is a 3D matrix.
* - Otherwise, a TypeError exception is thrown.
*
* @param array An `Array` to feed values from.
* @returns DOMMatrix instance.
*/
static [PropertySymbol.fromArray](array: any[] | Float32Array | Float64Array): DOMMatrixReadOnly;
/**
* Returns a new `DOMMatrix` instance from a DOM transform string.
*
* @param source valid CSS transform string syntax.
* @returns DOMMatrix instance.
*/
static [PropertySymbol.fromString](source: string): DOMMatrixReadOnly;
/**
* Returns length.
*
* @param length Length to convert.
* @returns Length.
*/
private static [PropertySymbol.getLength];
}
//# sourceMappingURL=DOMMatrixReadOnly.d.ts.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,25 @@
export default interface IDOMMatrixCompatibleObject {
a?: number;
b?: number;
c?: number;
d?: number;
e?: number;
f?: number;
m11?: number;
m12?: number;
m13?: number;
m14?: number;
m21?: number;
m22?: number;
m23?: number;
m24?: number;
m31?: number;
m32?: number;
m33?: number;
m34?: number;
m41?: number;
m42?: number;
m43?: number;
m44?: number;
}
//# sourceMappingURL=IDOMMatrixCompatibleObject.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMMatrixCompatibleObject.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-matrix/IDOMMatrixCompatibleObject.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,0BAA0B;IAClD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACb"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=IDOMMatrixCompatibleObject.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMMatrixCompatibleObject.js","sourceRoot":"","sources":["../../../src/dom/dom-matrix/IDOMMatrixCompatibleObject.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,27 @@
export default interface IDOMMatrixJSON {
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
m11: number;
m12: number;
m13: number;
m14: number;
m21: number;
m22: number;
m23: number;
m24: number;
m31: number;
m32: number;
m33: number;
m34: number;
m41: number;
m42: number;
m43: number;
m44: number;
is2D: boolean;
isIdentity: boolean;
}
//# sourceMappingURL=IDOMMatrixJSON.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMMatrixJSON.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-matrix/IDOMMatrixJSON.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,cAAc;IACtC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACpB"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=IDOMMatrixJSON.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IDOMMatrixJSON.js","sourceRoot":"","sources":["../../../src/dom/dom-matrix/IDOMMatrixJSON.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,4 @@
/** An array of 6 numbers representing a 2D matrix. */
type TDOMMatrix2DArray = [number, number, number, number, number, number];
export default TDOMMatrix2DArray;
//# sourceMappingURL=TDOMMatrix2DArray.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TDOMMatrix2DArray.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-matrix/TDOMMatrix2DArray.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,KAAK,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1E,eAAe,iBAAiB,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=TDOMMatrix2DArray.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TDOMMatrix2DArray.js","sourceRoot":"","sources":["../../../src/dom/dom-matrix/TDOMMatrix2DArray.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,21 @@
/** An array of 16 numbers representing a 3D matrix. */
type TDOMMatrix3DArray = [
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number
];
export default TDOMMatrix3DArray;
//# sourceMappingURL=TDOMMatrix3DArray.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TDOMMatrix3DArray.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-matrix/TDOMMatrix3DArray.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,KAAK,iBAAiB,GAAG;IACxB,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;CACN,CAAC;AACF,eAAe,iBAAiB,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=TDOMMatrix3DArray.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TDOMMatrix3DArray.js","sourceRoot":"","sources":["../../../src/dom/dom-matrix/TDOMMatrix3DArray.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,4 @@
import IDOMMatrixCompatibleObject from './IDOMMatrixCompatibleObject.js';
type TDOMMatrixInit = string | any[] | IDOMMatrixCompatibleObject | Float32Array | Float64Array;
export default TDOMMatrixInit;
//# sourceMappingURL=TDOMMatrixInit.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TDOMMatrixInit.d.ts","sourceRoot":"","sources":["../../../src/dom/dom-matrix/TDOMMatrixInit.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,MAAM,iCAAiC,CAAC;AAEzE,KAAK,cAAc,GAAG,MAAM,GAAG,GAAG,EAAE,GAAG,0BAA0B,GAAG,YAAY,GAAG,YAAY,CAAC;AAChG,eAAe,cAAc,CAAC"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=TDOMMatrixInit.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TDOMMatrixInit.js","sourceRoot":"","sources":["../../../src/dom/dom-matrix/TDOMMatrixInit.ts"],"names":[],"mappings":""}