@thednp/dommatrix 3.0.6 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +16 -2
- package/CHANGELOG.md +43 -0
- package/README.md +16 -2
- package/dist/dommatrix.cjs +305 -110
- package/dist/dommatrix.cjs.map +1 -1
- package/dist/dommatrix.d.ts +39 -4
- package/dist/dommatrix.js +305 -110
- package/dist/dommatrix.js.map +1 -1
- package/dist/dommatrix.mjs +305 -110
- package/dist/dommatrix.mjs.map +1 -1
- package/package.json +4 -1
package/dist/dommatrix.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dommatrix.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {\n CSSMatrixInput,\n JSONMatrix,\n Matrix,\n Matrix3d,\n PointTuple,\n} from \"./types.ts\";\nexport type {\n CSSMatrixInput,\n JSONMatrix,\n Matrix,\n Matrix3d,\n PointTuple,\n} from \"./types.ts\";\n\n/** A model for JSONMatrix */\nconst JSON_MATRIX: JSONMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: 0,\n f: 0,\n m11: 1,\n m12: 0,\n m13: 0,\n m14: 0,\n m21: 0,\n m22: 1,\n m23: 0,\n m24: 0,\n m31: 0,\n m32: 0,\n m33: 1,\n m34: 0,\n m41: 0,\n m42: 0,\n m43: 0,\n m44: 1,\n is2D: true,\n isIdentity: true,\n};\n\n// CSSMatrix Static methods\n// * `fromArray` is a more simple implementation, should also accept Float[32/64]Array;\n// * `fromMatrix` load values from another CSSMatrix/DOMMatrix instance or JSON object;\n// * `fromString` parses and loads values from any valid CSS transform string (TransformList).\n// * `isCompatibleArray` Checks if an array is compatible with CSSMatrix.\n// * `isCompatibleObject` Checks if an object is compatible with CSSMatrix.\n\n/** Checks if an array is compatible with CSSMatrix */\nconst isCompatibleArray = (\n array?: unknown,\n): array is Matrix | Matrix3d | Float32Array | Float64Array => {\n return (\n (array instanceof Float64Array ||\n array instanceof Float32Array ||\n (Array.isArray(array) && array.every((x) => typeof x === \"number\"))) &&\n [6, 16].some((x) => array.length === x)\n );\n};\n\n/** Checks if an object is compatible with CSSMatrix */\nconst isCompatibleObject = (\n object?: unknown,\n): object is CSSMatrix | DOMMatrix | JSONMatrix => {\n return (\n (typeof DOMMatrix !== \"undefined\" && object instanceof DOMMatrix) ||\n object instanceof CSSMatrix ||\n (typeof object === \"object\" &&\n Object.keys(JSON_MATRIX).every((k) => object && k in object))\n );\n};\n\n/**\n * Creates a new mutable `CSSMatrix` instance given an array of 16/6 floating point values.\n * This static method invalidates arrays that contain non-number elements.\n *\n * If the array has six values, the result is a 2D matrix; if the array has 16 values,\n * the result is a 3D matrix. Otherwise, a TypeError exception is thrown.\n *\n * @param array an `Array` to feed values from.\n * @return the resulted matrix.\n */\nconst fromArray = (\n array: number[] | Float32Array | Float64Array,\n): CSSMatrix => {\n const m = new CSSMatrix();\n const a = Array.from(array);\n\n if (!isCompatibleArray(a)) {\n throw TypeError(\n `CSSMatrix: \"${a.join(\",\")}\" must be an array with 6/16 numbers.`,\n );\n }\n // istanbul ignore else @preserve\n if (a.length === 16) {\n const [\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n ] = a;\n\n m.m11 = m11;\n m.a = m11;\n\n m.m21 = m21;\n m.c = m21;\n\n m.m31 = m31;\n\n m.m41 = m41;\n m.e = m41;\n\n m.m12 = m12;\n m.b = m12;\n\n m.m22 = m22;\n m.d = m22;\n\n m.m32 = m32;\n\n m.m42 = m42;\n m.f = m42;\n\n m.m13 = m13;\n m.m23 = m23;\n m.m33 = m33;\n m.m43 = m43;\n m.m14 = m14;\n m.m24 = m24;\n m.m34 = m34;\n m.m44 = m44;\n } else if (a.length === 6) {\n const [M11, M12, M21, M22, M41, M42] = a;\n\n m.m11 = M11;\n m.a = M11;\n\n m.m12 = M12;\n m.b = M12;\n\n m.m21 = M21;\n m.c = M21;\n\n m.m22 = M22;\n m.d = M22;\n\n m.m41 = M41;\n m.e = M41;\n\n m.m42 = M42;\n m.f = M42;\n }\n return m;\n};\n\n/**\n * Creates a new mutable `CSSMatrix` instance given an existing matrix or a\n * `DOMMatrix` instance which provides the values for its properties.\n *\n * @param m the source matrix to feed values from.\n * @return the resulted matrix.\n */\nconst fromMatrix = (m: CSSMatrix | DOMMatrix | JSONMatrix): CSSMatrix => {\n if (isCompatibleObject(m)) {\n return fromArray([\n m.m11,\n m.m12,\n m.m13,\n m.m14,\n m.m21,\n m.m22,\n m.m23,\n m.m24,\n m.m31,\n m.m32,\n m.m33,\n m.m34,\n m.m41,\n m.m42,\n m.m43,\n m.m44,\n ]);\n }\n throw TypeError(\n `CSSMatrix: \"${\n JSON.stringify(\n m,\n )\n }\" is not a DOMMatrix / CSSMatrix / JSON compatible object.`,\n );\n};\n\n/**\n * Creates a new mutable `CSSMatrix` given any valid CSS transform string,\n * or what we call `TransformList`:\n *\n * * `matrix(a, b, c, d, e, f)` - valid matrix() transform function\n * * `matrix3d(m11, m12, m13, ...m44)` - valid matrix3d() transform function\n * * `translate(tx, ty) rotateX(alpha)` - any valid transform function(s)\n *\n * @copyright thednp © 2021\n *\n * @param source valid CSS transform string syntax.\n * @return the resulted matrix.\n */\nconst fromString = (source: string): CSSMatrix => {\n if (typeof source !== \"string\") {\n throw TypeError(`CSSMatrix: \"${JSON.stringify(source)}\" is not a string.`);\n }\n const str = String(source).replace(/\\s/g, \"\");\n const m = new CSSMatrix();\n const invalidStringError = `CSSMatrix: invalid transform string \"${source}\"`;\n\n // const px = ['perspective'];\n // const length = ['translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];\n // const deg = ['rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'skew', 'skewX', 'skewY'];\n // const abs = ['scale', 'scale3d', 'matrix', 'matrix3d'];\n // const transformFunctions = px.concat(length, deg, abs);\n\n str\n .split(\")\")\n .filter((f) => f)\n .forEach((tf) => {\n const [prop, value] = tf.split(\"(\");\n\n // invalidate empty string\n if (!value) throw TypeError(invalidStringError);\n\n const components = value\n .split(\",\")\n .map((n) =>\n n.includes(\"rad\") ? parseFloat(n) * (180 / Math.PI) : parseFloat(n)\n );\n\n const [x, y, z, a] = components;\n const xyz = [x, y, z];\n const xyza = [x, y, z, a];\n\n // single number value expected\n if (prop === \"perspective\" && x && [y, z].every((n) => n === undefined)) {\n m.m34 = -1 / x;\n // 6/16 number values expected\n } else if (\n prop.includes(\"matrix\") &&\n [6, 16].includes(components.length) &&\n components.every((n) => !Number.isNaN(+n))\n ) {\n const values = components.map((n) => (Math.abs(n) < 1e-6 ? 0 : n));\n m.multiplySelf(fromArray(values as Matrix | Matrix3d));\n // 3 values expected\n } else if (\n prop === \"translate3d\" &&\n xyz.every((n) => !Number.isNaN(+n))\n ) {\n m.translateSelf(x, y, z);\n // single/double number value(s) expected\n } else if (prop === \"translate\" && x && z === undefined) {\n m.translateSelf(x, y || 0, 0);\n // all 4 values expected\n } else if (\n prop === \"rotate3d\" &&\n xyza.every((n) => !Number.isNaN(+n)) &&\n a\n ) {\n m.rotateAxisAngleSelf(x, y, z, a);\n // single value expected\n } else if (\n prop === \"rotate\" &&\n x &&\n [y, z].every((n) => n === undefined)\n ) {\n m.rotateSelf(0, 0, x);\n // 3 values expected\n } else if (\n prop === \"scale3d\" &&\n xyz.every((n) => !Number.isNaN(+n)) &&\n xyz.some((n) => n !== 1)\n ) {\n m.scaleSelf(x, y, z);\n // single value expected\n } else if (\n // prop === \"scale\" && !Number.isNaN(x) && x !== 1 && z === undefined\n // prop === \"scale\" && !Number.isNaN(x) && [x, y].some((n) => n !== 1) &&\n prop === \"scale\" &&\n !Number.isNaN(x) &&\n (x !== 1 || y !== 1) &&\n z === undefined\n ) {\n const nosy = Number.isNaN(+y);\n const sy = nosy ? x : y;\n m.scaleSelf(x, sy, 1);\n // single/double value expected\n } else if (\n prop === \"skew\" &&\n (x || (!Number.isNaN(x) && y)) &&\n z === undefined\n ) {\n m.skewSelf(x, y || 0);\n } else if (\n [\"translate\", \"rotate\", \"scale\", \"skew\"].some((p) =>\n prop.includes(p)\n ) &&\n /[XYZ]/.test(prop) &&\n x &&\n [y, z].every((n) => n === undefined) // a single value expected\n ) {\n if (\"skewX\" === prop || \"skewY\" === prop) {\n const method = \"skewX\" === prop ? \"skewXSelf\" : \"skewYSelf\";\n m[method](x);\n } else {\n const fn = prop.replace(/[XYZ]/, \"\") as\n | \"scale\"\n | \"translate\"\n | \"rotate\";\n const axis = prop.replace(fn, \"\");\n const idx = [\"X\", \"Y\", \"Z\"].indexOf(axis);\n const def = fn === \"scale\" ? 1 : 0;\n const method = (fn + \"Self\") as\n | \"scaleSelf\"\n | \"translateSelf\"\n | \"rotateSelf\";\n const axeValues: [number, number, number] = [\n idx === 0 ? x : def,\n idx === 1 ? x : def,\n idx === 2 ? x : def,\n ];\n m[method](...axeValues);\n }\n } else {\n throw TypeError(invalidStringError);\n }\n });\n\n return m;\n};\n\n/**\n * Returns an *Array* containing elements which comprise the matrix.\n * The method can return either the 16 elements or the 6 elements\n * depending on the value of the `is2D` parameter.\n *\n * @param m the source matrix to feed values from.\n * @param is2D *Array* representation of the matrix\n * @return an *Array* representation of the matrix\n */\nconst toArray = (\n m: CSSMatrix | DOMMatrix | JSONMatrix,\n is2D?: boolean,\n): Matrix | Matrix3d => {\n if (is2D) {\n return [m.a, m.b, m.c, m.d, m.e, m.f];\n }\n return [\n m.m11,\n m.m12,\n m.m13,\n m.m14,\n m.m21,\n m.m22,\n m.m23,\n m.m24,\n m.m31,\n m.m32,\n m.m33,\n m.m34,\n m.m41,\n m.m42,\n m.m43,\n m.m44,\n ];\n};\n\n// Transform Functions\n// https://www.w3.org/TR/css-transforms-1/#transform-functions\n\n/**\n * Creates a new `CSSMatrix` for the translation matrix and returns it.\n * This method is equivalent to the CSS `translate3d()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate3d\n *\n * @param x the `x-axis` position.\n * @param y the `y-axis` position.\n * @param z the `z-axis` position.\n * @return the resulted matrix.\n */\nconst Translate = (x: number, y: number, z: number): CSSMatrix => {\n const m = new CSSMatrix();\n m.m41 = x;\n m.e = x;\n m.m42 = y;\n m.f = y;\n m.m43 = z;\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the rotation matrix and returns it.\n *\n * http://en.wikipedia.org/wiki/Rotation_matrix\n *\n * @param rx the `x-axis` rotation.\n * @param ry the `y-axis` rotation.\n * @param rz the `z-axis` rotation.\n * @return the resulted matrix.\n */\nconst Rotate = (rx: number, ry: number, rz: number): CSSMatrix => {\n const m = new CSSMatrix();\n const degToRad = Math.PI / 180;\n const radX = rx * degToRad;\n const radY = ry * degToRad;\n const radZ = rz * degToRad;\n\n // minus sin() because of right-handed system\n const cosx = Math.cos(radX);\n const sinx = -Math.sin(radX);\n const cosy = Math.cos(radY);\n const siny = -Math.sin(radY);\n const cosz = Math.cos(radZ);\n const sinz = -Math.sin(radZ);\n\n const m11 = cosy * cosz;\n const m12 = -cosy * sinz;\n\n m.m11 = m11;\n m.a = m11;\n\n m.m12 = m12;\n m.b = m12;\n\n m.m13 = siny;\n\n const m21 = sinx * siny * cosz + cosx * sinz;\n m.m21 = m21;\n m.c = m21;\n\n const m22 = cosx * cosz - sinx * siny * sinz;\n m.m22 = m22;\n m.d = m22;\n\n m.m23 = -sinx * cosy;\n\n m.m31 = sinx * sinz - cosx * siny * cosz;\n m.m32 = sinx * cosz + cosx * siny * sinz;\n m.m33 = cosx * cosy;\n\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the rotation matrix and returns it.\n * This method is equivalent to the CSS `rotate3d()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d\n *\n * @param x the `x-axis` vector length.\n * @param y the `y-axis` vector length.\n * @param z the `z-axis` vector length.\n * @param alpha the value in degrees of the rotation.\n * @return the resulted matrix.\n */\nconst RotateAxisAngle = (\n x: number = 0,\n y: number = 0,\n z: number = 0,\n alpha: number = 0,\n): CSSMatrix => {\n const m = new CSSMatrix();\n const length = Math.sqrt(x * x + y * y + z * z);\n\n // if somehow we get to here, make sure we don't fail\n if (length === 0) {\n return m;\n }\n\n const X = x / length;\n const Y = y / length;\n const Z = z / length;\n\n const angle = alpha * (Math.PI / 360);\n const sinA = Math.sin(angle);\n const cosA = Math.cos(angle);\n const sinA2 = sinA * sinA;\n const x2 = X * X;\n const y2 = Y * Y;\n const z2 = Z * Z;\n\n const m11 = 1 - 2 * (y2 + z2) * sinA2;\n m.m11 = m11;\n m.a = m11;\n\n const m12 = 2 * (X * Y * sinA2 + Z * sinA * cosA);\n m.m12 = m12;\n m.b = m12;\n\n m.m13 = 2 * (X * Z * sinA2 - Y * sinA * cosA);\n\n const m21 = 2 * (Y * X * sinA2 - Z * sinA * cosA);\n m.m21 = m21;\n m.c = m21;\n\n const m22 = 1 - 2 * (z2 + x2) * sinA2;\n m.m22 = m22;\n m.d = m22;\n\n m.m23 = 2 * (Y * Z * sinA2 + X * sinA * cosA);\n m.m31 = 2 * (Z * X * sinA2 + Y * sinA * cosA);\n m.m32 = 2 * (Z * Y * sinA2 - X * sinA * cosA);\n m.m33 = 1 - 2 * (x2 + y2) * sinA2;\n\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the scale matrix and returns it.\n * This method is equivalent to the CSS `scale3d()` function, except it doesn't\n * accept {x, y, z} transform origin parameters.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale3d\n *\n * @param x the `x-axis` scale.\n * @param y the `y-axis` scale.\n * @param z the `z-axis` scale.\n * @return the resulted matrix.\n */\nconst Scale = (x: number, y: number, z: number): CSSMatrix => {\n const m = new CSSMatrix();\n m.m11 = x;\n m.a = x;\n\n m.m22 = y;\n m.d = y;\n\n m.m33 = z;\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the shear of both the `x-axis` and`y-axis`\n * matrix and returns it. This method is equivalent to the CSS `skew()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skew\n *\n * @param angleX the X-angle in degrees.\n * @param angleY the Y-angle in degrees.\n * @return the resulted matrix.\n */\nconst Skew = (angleX: number, angleY: number): CSSMatrix => {\n const m = new CSSMatrix();\n if (angleX) {\n const radX = (angleX * Math.PI) / 180;\n const tX = Math.tan(radX);\n m.m21 = tX;\n m.c = tX;\n }\n if (angleY) {\n const radY = (angleY * Math.PI) / 180;\n const tY = Math.tan(radY);\n m.m12 = tY;\n m.b = tY;\n }\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the shear of the `x-axis` rotation matrix and\n * returns it. This method is equivalent to the CSS `skewX()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewX\n *\n * @param angle the angle in degrees.\n * @return the resulted matrix.\n */\nconst SkewX = (angle: number): CSSMatrix => {\n return Skew(angle, 0);\n};\n\n/**\n * Creates a new `CSSMatrix` for the shear of the `y-axis` rotation matrix and\n * returns it. This method is equivalent to the CSS `skewY()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewY\n *\n * @param angle the angle in degrees.\n * @return the resulted matrix.\n */\nconst SkewY = (angle: number): CSSMatrix => {\n return Skew(0, angle);\n};\n\n/**\n * Creates a new `CSSMatrix` resulted from the multiplication of two matrixes\n * and returns it. Both matrixes are not changed.\n *\n * @param m1 the first matrix.\n * @param m2 the second matrix.\n * @return the resulted matrix.\n */\nconst Multiply = (\n m1: CSSMatrix | DOMMatrix | JSONMatrix,\n m2: CSSMatrix | DOMMatrix | JSONMatrix,\n): CSSMatrix => {\n const m11 = m2.m11 * m1.m11 + m2.m12 * m1.m21 + m2.m13 * m1.m31 +\n m2.m14 * m1.m41;\n const m12 = m2.m11 * m1.m12 + m2.m12 * m1.m22 + m2.m13 * m1.m32 +\n m2.m14 * m1.m42;\n const m13 = m2.m11 * m1.m13 + m2.m12 * m1.m23 + m2.m13 * m1.m33 +\n m2.m14 * m1.m43;\n const m14 = m2.m11 * m1.m14 + m2.m12 * m1.m24 + m2.m13 * m1.m34 +\n m2.m14 * m1.m44;\n\n const m21 = m2.m21 * m1.m11 + m2.m22 * m1.m21 + m2.m23 * m1.m31 +\n m2.m24 * m1.m41;\n const m22 = m2.m21 * m1.m12 + m2.m22 * m1.m22 + m2.m23 * m1.m32 +\n m2.m24 * m1.m42;\n const m23 = m2.m21 * m1.m13 + m2.m22 * m1.m23 + m2.m23 * m1.m33 +\n m2.m24 * m1.m43;\n const m24 = m2.m21 * m1.m14 + m2.m22 * m1.m24 + m2.m23 * m1.m34 +\n m2.m24 * m1.m44;\n\n const m31 = m2.m31 * m1.m11 + m2.m32 * m1.m21 + m2.m33 * m1.m31 +\n m2.m34 * m1.m41;\n const m32 = m2.m31 * m1.m12 + m2.m32 * m1.m22 + m2.m33 * m1.m32 +\n m2.m34 * m1.m42;\n const m33 = m2.m31 * m1.m13 + m2.m32 * m1.m23 + m2.m33 * m1.m33 +\n m2.m34 * m1.m43;\n const m34 = m2.m31 * m1.m14 + m2.m32 * m1.m24 + m2.m33 * m1.m34 +\n m2.m34 * m1.m44;\n\n const m41 = m2.m41 * m1.m11 + m2.m42 * m1.m21 + m2.m43 * m1.m31 +\n m2.m44 * m1.m41;\n const m42 = m2.m41 * m1.m12 + m2.m42 * m1.m22 + m2.m43 * m1.m32 +\n m2.m44 * m1.m42;\n const m43 = m2.m41 * m1.m13 + m2.m42 * m1.m23 + m2.m43 * m1.m33 +\n m2.m44 * m1.m43;\n const m44 = m2.m41 * m1.m14 + m2.m42 * m1.m24 + m2.m43 * m1.m34 +\n m2.m44 * m1.m44;\n\n return fromArray([\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n ]);\n};\n\n/**\n * Creates and returns a new `DOMMatrix` compatible instance\n * with equivalent instance methods.\n *\n * @class CSSMatrix\n *\n * @author thednp <https://github.com/thednp>\n * @link homepage <https://thednp.github.io/dommatrix/>\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix\n */\nexport default class CSSMatrix {\n /** The first element of the first row, alias of `a`. */\n declare m11: number;\n /** The second element of the first row, alias of `b`. */\n declare m12: number;\n /** The third element of the first row. */\n declare m13: number;\n /** The fourth element of the first row. */\n declare m14: number;\n /** The first element of the second row, alias of `c`. */\n declare m21: number;\n /** The second element of the second row, alias of `d`. */\n declare m22: number;\n /** The third element of the second row. */\n declare m23: number;\n /** The fourth element of the second row. */\n declare m24: number;\n /** The first element of the third row. */\n declare m31: number;\n /** The second element of the third row. */\n declare m32: number;\n /** The third element of the third row. */\n declare m33: number;\n /** The fourth element of the third row. */\n declare m34: number;\n /** The first element of the fourth row, alias of `e`. */\n declare m41: number;\n /** The second element of the fourth row, alias of `f`. */\n declare m42: number;\n /** The third element of the fourth row. */\n declare m43: number;\n /** The fourth element of the fourth row. */\n declare m44: number;\n /** The first element of the first row, alias of `m11`. */\n declare a: number;\n /** The second element of the first row, alias of `m12`. */\n declare b: number;\n /** The first element of the second row, alias of `m21`. */\n declare c: number;\n /** The second element of the second row, alias of `m22`. */\n declare d: number;\n /** The first element of the fourth row, alias of `m41`. */\n declare e: number;\n /** The second element of the fourth row, alias of `m42`. */\n declare f: number;\n /** Returns a new translation matrix. See the `Translate` helper. */\n static Translate = Translate;\n /** Returns a new rotation matrix. See the `Rotate` helper. */\n static Rotate = Rotate;\n /** Returns a new rotation matrix about a vector. See the `RotateAxisAngle` helper. */\n static RotateAxisAngle = RotateAxisAngle;\n /** Returns a new scale matrix. See the `Scale` helper. */\n static Scale = Scale;\n /** Returns a new skew-X matrix. See the `SkewX` helper. */\n static SkewX = SkewX;\n /** Returns a new skew-Y matrix. See the `SkewY` helper. */\n static SkewY = SkewY;\n /** Returns a new skew matrix. See the `Skew` helper. */\n static Skew = Skew;\n /** Returns the multiplication of two matrices. See the `Multiply` helper. */\n static Multiply = Multiply;\n /** Creates a new matrix from an array of 6/16 numbers. See the `fromArray` helper. */\n static fromArray = fromArray;\n /** Creates a new matrix from an existing matrix or a JSON object. See the `fromMatrix` helper. */\n static fromMatrix = fromMatrix;\n /** Creates a new matrix from a CSS transform string. See the `fromString` helper. */\n static fromString = fromString;\n /** Returns an *Array* of 6/16 values from a compatible matrix. See the `toArray` helper. */\n static toArray = toArray;\n /** Checks if a value is a compatible 6/16 number array. See the `isCompatibleArray` helper. */\n static isCompatibleArray = isCompatibleArray;\n /** Checks if a value is a `CSSMatrix` / `DOMMatrix` / `JSONMatrix` object. See the `isCompatibleObject` helper. */\n static isCompatibleObject = isCompatibleObject;\n\n /**\n * @constructor\n * @param init accepts all parameter configurations:\n * * valid CSS transform string,\n * * CSSMatrix/DOMMatrix instance,\n * * a 6/16 elements *Array*.\n */\n constructor(init?: CSSMatrixInput) {\n // array 6\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.e = 0;\n this.f = 0;\n // array 16\n this.m11 = 1;\n this.m12 = 0;\n this.m13 = 0;\n this.m14 = 0;\n this.m21 = 0;\n this.m22 = 1;\n this.m23 = 0;\n this.m24 = 0;\n this.m31 = 0;\n this.m32 = 0;\n this.m33 = 1;\n this.m34 = 0;\n this.m41 = 0;\n this.m42 = 0;\n this.m43 = 0;\n this.m44 = 1;\n\n if (init) {\n return this.setMatrixValue(init);\n }\n return this;\n }\n\n /**\n * A `Boolean` whose value is `true` if the matrix is the identity matrix. The identity\n * matrix is one in which every value is 0 except those on the main diagonal from top-left\n * to bottom-right corner (in other words, where the offsets in each direction are equal).\n *\n * @return the current property value\n */\n get isIdentity(): boolean {\n return (\n this.m11 === 1 &&\n this.m12 === 0 &&\n this.m13 === 0 &&\n this.m14 === 0 &&\n this.m21 === 0 &&\n this.m22 === 1 &&\n this.m23 === 0 &&\n this.m24 === 0 &&\n this.m31 === 0 &&\n this.m32 === 0 &&\n this.m33 === 1 &&\n this.m34 === 0 &&\n this.m41 === 0 &&\n this.m42 === 0 &&\n this.m43 === 0 &&\n this.m44 === 1\n );\n }\n\n /**\n * A `Boolean` flag whose value is `true` if the matrix was initialized as a 2D matrix\n * and `false` if the matrix is 3D.\n *\n * @return the current property value\n */\n get is2D(): boolean {\n return (\n this.m31 === 0 &&\n this.m32 === 0 &&\n this.m33 === 1 &&\n this.m34 === 0 &&\n this.m43 === 0 &&\n this.m44 === 1\n );\n }\n\n /**\n * The `setMatrixValue` method replaces the existing matrix with one computed\n * in the browser. EG: `matrix(1,0.25,-0.25,1,0,0)`\n *\n * The method accepts any *Array* values, the result of\n * `DOMMatrix` instance method `toFloat64Array()` / `toFloat32Array()` calls\n * or `CSSMatrix` instance method `toArray()`.\n *\n * This method expects valid *matrix()* / *matrix3d()* string values, as well\n * as other transform functions like *translateX(10px)*.\n *\n * @param source\n * @return the matrix instance\n */\n setMatrixValue(source?: CSSMatrixInput): CSSMatrix {\n // CSS transform string source - TransformList first\n if (typeof source === \"string\" && source.length && source !== \"none\") {\n return fromString(source);\n }\n\n // [Array | Float[32/64]Array] come next\n if (\n Array.isArray(source) ||\n source instanceof Float64Array ||\n source instanceof Float32Array\n ) {\n return fromArray(source);\n }\n\n // new CSSMatrix(CSSMatrix | DOMMatrix | JSONMatrix) last\n if (typeof source === \"object\") {\n return fromMatrix(source);\n }\n\n return this;\n }\n\n /**\n * Returns a *Float32Array* containing elements which comprise the matrix.\n * The method can return either the 16 elements or the 6 elements\n * depending on the value of the `is2D` parameter.\n *\n * @param is2D *Array* representation of the matrix\n * @return an *Array* representation of the matrix\n */\n toFloat32Array(is2D?: boolean): Float32Array {\n return Float32Array.from(toArray(this, is2D));\n }\n\n /**\n * Returns a *Float64Array* containing elements which comprise the matrix.\n * The method can return either the 16 elements or the 6 elements\n * depending on the value of the `is2D` parameter.\n *\n * @param is2D *Array* representation of the matrix\n * @return an *Array* representation of the matrix\n */\n toFloat64Array(is2D?: boolean): Float64Array {\n return Float64Array.from(toArray(this, is2D));\n }\n\n /**\n * Creates and returns a string representation of the matrix in `CSS` matrix syntax,\n * using the appropriate `CSS` matrix notation.\n *\n * matrix3d *matrix3d(m11, m12, m13, m14, m21, ...)*\n * matrix *matrix(a, b, c, d, e, f)*\n *\n * @return a string representation of the matrix\n */\n toString(): string {\n const { is2D } = this;\n const values = this.toFloat64Array(is2D).join(\", \");\n const type = is2D ? \"matrix\" : \"matrix3d\";\n return `${type}(${values})`;\n }\n\n /**\n * Returns a JSON representation of the `CSSMatrix` instance, a standard *Object*\n * that includes `{a,b,c,d,e,f}` and `{m11,m12,m13,..m44}` properties as well\n * as the `is2D` & `isIdentity` properties.\n *\n * The result can also be used as a second parameter for the `fromMatrix` static method\n * to load values into another matrix instance.\n *\n * @return an *Object* with all matrix values.\n */\n toJSON(): JSONMatrix {\n const { is2D, isIdentity } = this;\n return { ...this, is2D, isIdentity };\n }\n\n /**\n * The Multiply method returns a new CSSMatrix which is the result of this\n * matrix multiplied by the passed matrix, with the passed matrix to the right.\n * This matrix is not modified.\n *\n * @param m2 CSSMatrix\n * @return The resulted matrix.\n */\n multiply(m2: CSSMatrix | DOMMatrix | JSONMatrix): CSSMatrix {\n return Multiply(this, m2);\n }\n\n /**\n * The translate method returns a new matrix which is this matrix post\n * multiplied by a translation matrix containing the passed values. If the z\n * component is undefined, a 0 value is used in its place. This matrix is not\n * modified.\n *\n * @param x X component of the translation value.\n * @param y Y component of the translation value.\n * @param z Z component of the translation value.\n * @return The resulted matrix\n */\n translate(x: number, y?: number, z?: number): CSSMatrix {\n return this.multiply(Translate(x, y ?? 0, z ?? 0));\n }\n\n /**\n * The scale method returns a new matrix which is this matrix post multiplied by\n * a scale matrix containing the passed values. If the z component is undefined,\n * a 1 value is used in its place. If the y component is undefined, the x\n * component value is used in its place. This matrix is not modified.\n *\n * @param x The X component of the scale value.\n * @param y The Y component of the scale value.\n * @param z The Z component of the scale value.\n * @return The resulted matrix\n */\n scale(x: number, y?: number, z?: number): CSSMatrix {\n return this.multiply(Scale(x, y ?? x, z ?? 1));\n }\n\n /**\n * The rotate method returns a new matrix which is this matrix post multiplied\n * by each of 3 rotation matrices about the major axes, first X, then Y, then Z.\n * If the y and z components are undefined, the x value is used to rotate the\n * object about the z axis, as though the vector (0,0,x) were passed. All\n * rotation values are in degrees. This matrix is not modified.\n *\n * @param rx The X component of the rotation, or Z if Y and Z are null.\n * @param ry The (optional) Y component of the rotation value.\n * @param rz The (optional) Z component of the rotation value.\n * @return The resulted matrix\n */\n rotate(rx: number, ry?: number, rz?: number): CSSMatrix {\n let RX = rx;\n let RY = ry || 0;\n let RZ = rz || 0;\n\n if (\n typeof rx === \"number\" &&\n typeof ry === \"undefined\" &&\n typeof rz === \"undefined\"\n ) {\n RZ = RX;\n RX = 0;\n RY = 0;\n }\n\n return this.multiply(Rotate(RX, RY, RZ));\n }\n\n /**\n * The rotateAxisAngle method returns a new matrix which is this matrix post\n * multiplied by a rotation matrix with the given axis and `angle`. The right-hand\n * rule is used to determine the direction of rotation. All rotation values are\n * in degrees. This matrix is not modified.\n *\n * @param x The X component of the axis vector.\n * @param y The Y component of the axis vector.\n * @param z The Z component of the axis vector.\n * @param angle The angle of rotation about the axis vector, in degrees.\n * @return The resulted matrix\n */\n rotateAxisAngle(\n x: number = 0,\n y: number = 0,\n z: number = 0,\n angle: number = 0,\n ): CSSMatrix {\n if ([x, y, z, angle].some((n) => !Number.isFinite(n))) {\n throw new TypeError(\"CSSMatrix: expecting 4 values\");\n }\n\n // Early return if zero-length vector\n const length = Math.sqrt(x * x + y * y + z * z);\n if (length === 0) {\n return fromMatrix(this); // Return copy of this\n }\n\n return this.multiply(RotateAxisAngle(x, y, z, angle));\n }\n\n /**\n * Specifies a skew transformation along the `x-axis` by the given angle.\n * This matrix is not modified.\n *\n * @param angle The angle amount in degrees to skew.\n * @return The resulted matrix\n */\n skewX(angle: number): CSSMatrix {\n return this.multiply(SkewX(angle));\n }\n\n /**\n * Specifies a skew transformation along the `y-axis` by the given angle.\n * This matrix is not modified.\n *\n * @param angle The angle amount in degrees to skew.\n * @return The resulted matrix\n */\n skewY(angle: number): CSSMatrix {\n return this.multiply(SkewY(angle));\n }\n\n /**\n * Specifies a skew transformation along both the `x-axis` and `y-axis`.\n * This matrix is not modified.\n *\n * @param angleX The X-angle amount in degrees to skew.\n * @param angleY The angle amount in degrees to skew.\n * @return The resulted matrix\n */\n skew(angleX: number, angleY: number): CSSMatrix {\n return this.multiply(Skew(angleX, angleY));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with another matrix.\n * This is the mutable version of multiply().\n *\n * @param m2 The matrix to multiply with\n * @return this matrix (modified)\n */\n multiplySelf(m2: CSSMatrix | DOMMatrix | JSONMatrix): this {\n const result = Multiply(this, m2);\n Object.assign(this, result);\n return this;\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a translation matrix.\n * This is the mutable version of translate().\n *\n * @param x X component of the translation value.\n * @param y Y component of the translation value.\n * @param z Z component of the translation value.\n * @return this matrix (modified)\n */\n translateSelf(x: number, y?: number, z?: number): this {\n return this.multiplySelf(Translate(x, y ?? 0, z ?? 0));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a scale matrix.\n * This is the mutable version of scale().\n *\n * @param x The X component of the scale value.\n * @param y The Y component of the scale value.\n * @param z The Z component of the scale value.\n * @return this matrix (modified)\n */\n scaleSelf(x: number, y?: number, z?: number): this {\n return this.multiplySelf(Scale(x, y ?? x, z ?? 1));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a rotation matrix.\n * This is the mutable version of rotate().\n *\n * @param rx The X component of the rotation, or Z if Y and Z are null.\n * @param ry The (optional) Y component of the rotation value.\n * @param rz The (optional) Z component of the rotation value.\n * @return this matrix (modified)\n */\n rotateSelf(rx: number, ry?: number, rz?: number): this {\n let RX = rx;\n let RY = ry || 0;\n let RZ = rz || 0;\n\n if (\n typeof rx === \"number\" &&\n typeof ry === \"undefined\" &&\n typeof rz === \"undefined\"\n ) {\n RZ = RX;\n RX = 0;\n RY = 0;\n }\n\n return this.multiplySelf(Rotate(RX, RY, RZ));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a rotation matrix\n * with the given axis and angle.\n * This is the mutable version of rotateAxisAngle().\n *\n * @param x The X component of the axis vector.\n * @param y The Y component of the axis vector.\n * @param z The Z component of the axis vector.\n * @param angle The angle of rotation about the axis vector, in degrees.\n * @return this matrix (modified)\n */\n rotateAxisAngleSelf(\n x: number = 0,\n y: number = 0,\n z: number = 0,\n angle: number = 0,\n ): this {\n if ([x, y, z, angle].some((n) => !Number.isFinite(n))) {\n throw new TypeError(\"CSSMatrix: expecting 4 values\");\n }\n\n // Early return if zero-length vector\n const length = Math.sqrt(x * x + y * y + z * z);\n if (length === 0) {\n return this;\n }\n return this.multiplySelf(RotateAxisAngle(x, y, z, angle));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a skewX matrix.\n * This is the mutable version of skewX().\n *\n * @param angle The angle amount in degrees to skew.\n * @return this matrix (modified)\n */\n skewXSelf(angle: number): this {\n return this.multiplySelf(SkewX(angle));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a skewY matrix.\n * This is the mutable version of skewY().\n *\n * @param angle The angle amount in degrees to skew.\n * @return this matrix (modified)\n */\n skewYSelf(angle: number): this {\n return this.multiplySelf(SkewY(angle));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a skew matrix.\n * This is the mutable version of skew().\n *\n * @param angleX The X-angle amount in degrees to skew.\n * @param angleY The Y-angle amount in degrees to skew.\n * @return this matrix (modified)\n */\n skewSelf(angleX: number, angleY: number): this {\n return this.multiplySelf(Skew(angleX, angleY));\n }\n\n /**\n * Transforms a specified vector using the matrix, returning a new\n * {x,y,z,w} Tuple *Object* comprising the transformed vector.\n * Neither the matrix nor the original vector are altered.\n *\n * The method is equivalent with `transformPoint()` method\n * of the `DOMMatrix` constructor.\n *\n * @param t Tuple with `{x,y,z,w}` components\n * @return the resulting Tuple\n */\n transformPoint(t: PointTuple | DOMPoint): PointTuple | DOMPoint {\n const x = this.m11 * t.x + this.m21 * t.y + this.m31 * t.z + this.m41 * t.w;\n const y = this.m12 * t.x + this.m22 * t.y + this.m32 * t.z + this.m42 * t.w;\n const z = this.m13 * t.x + this.m23 * t.y + this.m33 * t.z + this.m43 * t.w;\n const w = this.m14 * t.x + this.m24 * t.y + this.m34 * t.z + this.m44 * t.w;\n\n return typeof DOMPoint !== \"undefined\" && t instanceof DOMPoint\n ? new DOMPoint(x, y, z, w)\n : {\n x,\n y,\n z,\n w,\n };\n }\n}\n"],"mappings":";;AAgBA,MAAM,cAA0B;CAC9B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,YAAY;AACd;;AAUA,MAAM,qBACJ,UAC6D;CAC7D,QACG,iBAAiB,gBAChB,iBAAiB,gBAChB,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,MAAM,OAAO,MAAM,QAAQ,MACnE,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,MAAM,MAAM,WAAW,CAAC;AAE1C;;AAGA,MAAM,sBACJ,WACiD;CACjD,OACG,OAAO,cAAc,eAAe,kBAAkB,aACvD,kBAAkB,aACjB,OAAO,WAAW,YACjB,OAAO,KAAK,WAAW,CAAC,CAAC,OAAO,MAAM,UAAU,KAAK,MAAM;AAEjE;;;;;;;;;;;AAYA,MAAM,aACJ,UACc;CACd,MAAM,IAAI,IAAI,UAAU;CACxB,MAAM,IAAI,MAAM,KAAK,KAAK;CAE1B,IAAI,CAAC,kBAAkB,CAAC,GACtB,MAAM,UACJ,eAAe,EAAE,KAAK,GAAG,EAAE,sCAC7B;;CAGF,IAAI,EAAE,WAAW,IAAI;EACnB,MAAM,CACJ,KACA,KACA,KACA,KACA,KACA,KACA,K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KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE;EAE1E,OAAO,OAAO,aAAa,eAAe,aAAa,WACnD,IAAI,SAAS,GAAG,GAAG,GAAG,CAAC,IACvB;GACA;GACA;GACA;GACA;EACF;CACJ;AACF"}
|
|
1
|
+
{"version":3,"file":"dommatrix.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {\n CSSMatrixInput,\n JSONMatrix,\n Matrix,\n Matrix3d,\n PointTuple,\n} from \"./types.ts\";\nexport type {\n CSSMatrixInput,\n JSONMatrix,\n Matrix,\n Matrix3d,\n PointTuple,\n} from \"./types.ts\";\n\n/** A model for JSONMatrix */\nconst JSON_MATRIX: JSONMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: 0,\n f: 0,\n m11: 1,\n m12: 0,\n m13: 0,\n m14: 0,\n m21: 0,\n m22: 1,\n m23: 0,\n m24: 0,\n m31: 0,\n m32: 0,\n m33: 1,\n m34: 0,\n m41: 0,\n m42: 0,\n m43: 0,\n m44: 1,\n is2D: true,\n isIdentity: true,\n};\n\n/** The property names of a JSONMatrix, used for compatibility checks */\nconst JSON_KEYS = Object.keys(JSON_MATRIX);\n\n// CSSMatrix Static methods\n// * `fromArray` is a more simple implementation, should also accept Float[32/64]Array;\n// * `fromMatrix` load values from another CSSMatrix/DOMMatrix instance or JSON object;\n// * `fromString` parses and loads values from any valid CSS transform string (TransformList).\n// * `isCompatibleArray` Checks if an array is compatible with CSSMatrix.\n// * `isCompatibleObject` Checks if an object is compatible with CSSMatrix.\n\n/** Checks if an array is compatible with CSSMatrix */\nconst isCompatibleArray = (\n array?: unknown,\n): array is Matrix | Matrix3d | Float32Array | Float64Array => {\n return (\n (array instanceof Float64Array ||\n array instanceof Float32Array ||\n (Array.isArray(array) && array.every((x) => typeof x === \"number\"))) &&\n [6, 16].some((x) => array.length === x)\n );\n};\n\n/** Checks if an object is compatible with CSSMatrix */\nconst isCompatibleObject = (\n object?: unknown,\n): object is CSSMatrix | DOMMatrix | JSONMatrix => {\n return (\n (typeof DOMMatrix !== \"undefined\" && object instanceof DOMMatrix) ||\n object instanceof CSSMatrix ||\n (typeof object === \"object\" &&\n JSON_KEYS.every((k) => object && k in object))\n );\n};\n\n/**\n * Creates a new mutable `CSSMatrix` instance given an array of 16/6 floating point values.\n * This static method invalidates arrays that contain non-number elements.\n *\n * If the array has six values, the result is a 2D matrix; if the array has 16 values,\n * the result is a 3D matrix. Otherwise, a TypeError exception is thrown.\n *\n * @param array an `Array` to feed values from.\n * @param target an optional matrix instance to write the values into; when omitted\n * a new matrix is returned. Used internally by `setMatrixValue` to mutate in place.\n * @return the resulted matrix.\n */\nconst fromArray = (\n array: number[] | Float32Array | Float64Array,\n target?: CSSMatrix,\n): CSSMatrix => {\n if (!isCompatibleArray(array)) {\n throw TypeError(\n `CSSMatrix: \"${\n Array.from(array).join(\",\")\n }\" must be an array with 6/16 numbers.`,\n );\n }\n // istanbul ignore else @preserve\n if (array.length === 16) {\n const [\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n ] = array;\n return writeValues(\n target ?? new CSSMatrix(),\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n );\n }\n const [M11, M12, M21, M22, M41, M42] = array as Matrix;\n return writeValues(\n target ?? new CSSMatrix(),\n M11,\n M12,\n 0,\n 0,\n M21,\n M22,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n M41,\n M42,\n 0,\n 1,\n );\n};\n\n/**\n * Internal helper that writes the 16 values of a matrix into a given `CSSMatrix`\n * instance. This is the single place where all 22 aliases (`a`-`f` and `m11`-`m44`)\n * are written, so every write path keeps the instance monomorphic.\n *\n * @param target the matrix instance to write the values into.\n * @param m11 the `m11` value.\n * @param m12 the `m12` value.\n * @param m13 the `m13` value.\n * @param m14 the `m14` value.\n * @param m21 the `m21` value.\n * @param m22 the `m22` value.\n * @param m23 the `m23` value.\n * @param m24 the `m24` value.\n * @param m31 the `m31` value.\n * @param m32 the `m32` value.\n * @param m33 the `m33` value.\n * @param m34 the `m34` value.\n * @param m41 the `m41` value.\n * @param m42 the `m42` value.\n * @param m43 the `m43` value.\n * @param m44 the `m44` value.\n * @return the target matrix.\n */\nconst writeValues = (\n target: CSSMatrix,\n m11: number,\n m12: number,\n m13: number,\n m14: number,\n m21: number,\n m22: number,\n m23: number,\n m24: number,\n m31: number,\n m32: number,\n m33: number,\n m34: number,\n m41: number,\n m42: number,\n m43: number,\n m44: number,\n): CSSMatrix => {\n target.m11 = m11;\n target.a = m11;\n\n target.m21 = m21;\n target.c = m21;\n\n target.m31 = m31;\n\n target.m41 = m41;\n target.e = m41;\n\n target.m12 = m12;\n target.b = m12;\n\n target.m22 = m22;\n target.d = m22;\n\n target.m32 = m32;\n\n target.m42 = m42;\n target.f = m42;\n\n target.m13 = m13;\n target.m23 = m23;\n target.m33 = m33;\n target.m43 = m43;\n target.m14 = m14;\n target.m24 = m24;\n target.m34 = m34;\n target.m44 = m44;\n\n return target;\n};\n\n/**\n * Creates a new mutable `CSSMatrix` instance given the 16 values of the matrix.\n * This internal helper skips the validation and intermediate array steps of\n * `fromArray` and is used by the fast paths of the library.\n *\n * @param m11 the `m11` value.\n * @param m12 the `m12` value.\n * @param m13 the `m13` value.\n * @param m14 the `m14` value.\n * @param m21 the `m21` value.\n * @param m22 the `m22` value.\n * @param m23 the `m23` value.\n * @param m24 the `m24` value.\n * @param m31 the `m31` value.\n * @param m32 the `m32` value.\n * @param m33 the `m33` value.\n * @param m34 the `m34` value.\n * @param m41 the `m41` value.\n * @param m42 the `m42` value.\n * @param m43 the `m43` value.\n * @param m44 the `m44` value.\n * @return the resulted matrix.\n */\nconst fromValues = (\n m11: number,\n m12: number,\n m13: number,\n m14: number,\n m21: number,\n m22: number,\n m23: number,\n m24: number,\n m31: number,\n m32: number,\n m33: number,\n m34: number,\n m41: number,\n m42: number,\n m43: number,\n m44: number,\n): CSSMatrix => {\n return writeValues(\n new CSSMatrix(),\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n );\n};\n\n/**\n * Creates a new mutable `CSSMatrix` instance given an existing matrix or a\n * `DOMMatrix` instance which provides the values for its properties.\n *\n * @param m the source matrix to feed values from.\n * @param target an optional matrix instance to write the values into; when omitted\n * a new matrix is returned. Used internally by `setMatrixValue` to mutate in place.\n * @return the resulted matrix.\n */\nconst fromMatrix = (\n m: CSSMatrix | DOMMatrix | JSONMatrix,\n target?: CSSMatrix,\n): CSSMatrix => {\n if (isCompatibleObject(m)) {\n return writeValues(\n target ?? new CSSMatrix(),\n m.m11,\n m.m12,\n m.m13,\n m.m14,\n m.m21,\n m.m22,\n m.m23,\n m.m24,\n m.m31,\n m.m32,\n m.m33,\n m.m34,\n m.m41,\n m.m42,\n m.m43,\n m.m44,\n );\n }\n throw TypeError(\n `CSSMatrix: \"${\n JSON.stringify(\n m,\n )\n }\" is not a DOMMatrix / CSSMatrix / JSON compatible object.`,\n );\n};\n\n/**\n * Creates a new mutable `CSSMatrix` given any valid CSS transform string,\n * or what we call `TransformList`:\n *\n * * `matrix(a, b, c, d, e, f)` - valid matrix() transform function\n * * `matrix3d(m11, m12, m13, ...m44)` - valid matrix3d() transform function\n * * `translate(tx, ty) rotateX(alpha)` - any valid transform function(s)\n *\n * @copyright thednp © 2021\n *\n * @param source valid CSS transform string syntax.\n * @return the resulted matrix.\n */\nconst fromString = (source: string): CSSMatrix => {\n if (typeof source !== \"string\") {\n throw TypeError(`CSSMatrix: \"${JSON.stringify(source)}\" is not a string.`);\n }\n const str = String(source).replace(/\\s/g, \"\");\n const m = new CSSMatrix();\n const invalidStringError = `CSSMatrix: invalid transform string \"${source}\"`;\n\n // const px = ['perspective'];\n // const length = ['translate', 'translate3d', 'translateX', 'translateY', 'translateZ'];\n // const deg = ['rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'skew', 'skewX', 'skewY'];\n // const abs = ['scale', 'scale3d', 'matrix', 'matrix3d'];\n // const transformFunctions = px.concat(length, deg, abs);\n\n const transformFn = /([\\w-]+)\\(([^)]*)\\)/g;\n let consumed = 0;\n let match: RegExpExecArray | null;\n while ((match = transformFn.exec(str))) {\n const prop = match[1];\n const value = match[2];\n consumed += match[0].length;\n\n // invalidate empty string\n if (!value) throw TypeError(invalidStringError);\n\n const components = value\n .split(\",\")\n .map((n) =>\n n.includes(\"rad\") ? parseFloat(n) * (180 / Math.PI) : parseFloat(n)\n );\n\n const [x, y, z, a] = components;\n const xyz = [x, y, z];\n const xyza = [x, y, z, a];\n\n // single number value expected\n if (prop === \"perspective\" && x && [y, z].every((n) => n === undefined)) {\n m.m34 = -1 / x;\n // 6/16 number values expected\n } else if (\n prop.includes(\"matrix\") &&\n [6, 16].includes(components.length) &&\n components.every((n) => !Number.isNaN(+n))\n ) {\n const values = components.map((n) => (Math.abs(n) < 1e-6 ? 0 : n));\n m.multiplySelf(fromArray(values as Matrix | Matrix3d));\n // 3 values expected\n } else if (\n prop === \"translate3d\" &&\n xyz.every((n) => !Number.isNaN(+n))\n ) {\n m.translateSelf(x, y, z);\n // single/double number value(s) expected\n } else if (prop === \"translate\" && x && z === undefined) {\n m.translateSelf(x, y || 0, 0);\n // all 4 values expected\n } else if (\n prop === \"rotate3d\" &&\n xyza.every((n) => !Number.isNaN(+n)) &&\n a\n ) {\n m.rotateAxisAngleSelf(x, y, z, a);\n // single value expected\n } else if (\n prop === \"rotate\" &&\n x &&\n [y, z].every((n) => n === undefined)\n ) {\n m.rotateSelf(0, 0, x);\n // 3 values expected\n } else if (\n prop === \"scale3d\" &&\n xyz.every((n) => !Number.isNaN(+n)) &&\n xyz.some((n) => n !== 1)\n ) {\n m.scaleSelf(x, y, z);\n // single value expected\n } else if (\n // prop === \"scale\" && !Number.isNaN(x) && x !== 1 && z === undefined\n // prop === \"scale\" && !Number.isNaN(x) && [x, y].some((n) => n !== 1) &&\n prop === \"scale\" &&\n !Number.isNaN(x) &&\n (x !== 1 || y !== 1) &&\n z === undefined\n ) {\n const nosy = Number.isNaN(+y);\n const sy = nosy ? x : y;\n m.scaleSelf(x, sy, 1);\n // single/double value expected\n } else if (\n prop === \"skew\" &&\n (x || (!Number.isNaN(x) && y)) &&\n z === undefined\n ) {\n m.skewSelf(x, y || 0);\n } else if (\n [\"translate\", \"rotate\", \"scale\", \"skew\"].some((p) => prop.includes(p)) &&\n /[XYZ]/.test(prop) &&\n x &&\n [y, z].every((n) => n === undefined) // a single value expected\n ) {\n if (\"skewX\" === prop || \"skewY\" === prop) {\n const method = \"skewX\" === prop ? \"skewXSelf\" : \"skewYSelf\";\n m[method](x);\n } else {\n const fn = prop.replace(/[XYZ]/, \"\") as\n | \"scale\"\n | \"translate\"\n | \"rotate\";\n const axis = prop.replace(fn, \"\");\n const idx = [\"X\", \"Y\", \"Z\"].indexOf(axis);\n const def = fn === \"scale\" ? 1 : 0;\n const method = (fn + \"Self\") as\n | \"scaleSelf\"\n | \"translateSelf\"\n | \"rotateSelf\";\n const axeValues: [number, number, number] = [\n idx === 0 ? x : def,\n idx === 1 ? x : def,\n idx === 2 ? x : def,\n ];\n m[method](...axeValues);\n }\n } else {\n throw TypeError(invalidStringError);\n }\n }\n\n if (consumed !== str.length) {\n throw TypeError(invalidStringError);\n }\n\n return m;\n};\n\n/**\n * Returns an *Array* containing elements which comprise the matrix.\n * The method can return either the 16 elements or the 6 elements\n * depending on the value of the `is2D` parameter.\n *\n * @param m the source matrix to feed values from.\n * @param is2D *Array* representation of the matrix\n * @return an *Array* representation of the matrix\n */\nconst toArray = (\n m: CSSMatrix | DOMMatrix | JSONMatrix,\n is2D?: boolean,\n): Matrix | Matrix3d => {\n if (is2D) {\n return [m.a, m.b, m.c, m.d, m.e, m.f];\n }\n return [\n m.m11,\n m.m12,\n m.m13,\n m.m14,\n m.m21,\n m.m22,\n m.m23,\n m.m24,\n m.m31,\n m.m32,\n m.m33,\n m.m34,\n m.m41,\n m.m42,\n m.m43,\n m.m44,\n ];\n};\n\n// Transform Functions\n// https://www.w3.org/TR/css-transforms-1/#transform-functions\n\n/**\n * Creates a new `CSSMatrix` for the translation matrix and returns it.\n * This method is equivalent to the CSS `translate3d()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate3d\n *\n * @param x the `x-axis` position.\n * @param y the `y-axis` position.\n * @param z the `z-axis` position.\n * @return the resulted matrix.\n */\nconst Translate = (x: number, y: number, z: number): CSSMatrix => {\n const m = new CSSMatrix();\n m.m41 = x;\n m.e = x;\n m.m42 = y;\n m.f = y;\n m.m43 = z;\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the rotation matrix and returns it.\n *\n * http://en.wikipedia.org/wiki/Rotation_matrix\n *\n * @param rx the `x-axis` rotation.\n * @param ry the `y-axis` rotation.\n * @param rz the `z-axis` rotation.\n * @return the resulted matrix.\n */\nconst Rotate = (rx: number, ry: number, rz: number): CSSMatrix => {\n const m = new CSSMatrix();\n const degToRad = Math.PI / 180;\n const radX = rx * degToRad;\n const radY = ry * degToRad;\n const radZ = rz * degToRad;\n\n // minus sin() because of right-handed system\n const cosx = Math.cos(radX);\n const sinx = -Math.sin(radX);\n const cosy = Math.cos(radY);\n const siny = -Math.sin(radY);\n const cosz = Math.cos(radZ);\n const sinz = -Math.sin(radZ);\n\n const m11 = cosy * cosz;\n const m12 = -cosy * sinz;\n\n m.m11 = m11;\n m.a = m11;\n\n m.m12 = m12;\n m.b = m12;\n\n m.m13 = siny;\n\n const m21 = sinx * siny * cosz + cosx * sinz;\n m.m21 = m21;\n m.c = m21;\n\n const m22 = cosx * cosz - sinx * siny * sinz;\n m.m22 = m22;\n m.d = m22;\n\n m.m23 = -sinx * cosy;\n\n m.m31 = sinx * sinz - cosx * siny * cosz;\n m.m32 = sinx * cosz + cosx * siny * sinz;\n m.m33 = cosx * cosy;\n\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the rotation matrix and returns it.\n * This method is equivalent to the CSS `rotate3d()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d\n *\n * @param x the `x-axis` vector length.\n * @param y the `y-axis` vector length.\n * @param z the `z-axis` vector length.\n * @param alpha the value in degrees of the rotation.\n * @return the resulted matrix.\n */\nconst RotateAxisAngle = (\n x: number = 0,\n y: number = 0,\n z: number = 0,\n alpha: number = 0,\n): CSSMatrix => {\n const m = new CSSMatrix();\n const length = Math.sqrt(x * x + y * y + z * z);\n\n // if somehow we get to here, make sure we don't fail\n if (length === 0) {\n return m;\n }\n\n const X = x / length;\n const Y = y / length;\n const Z = z / length;\n\n const angle = alpha * (Math.PI / 360);\n const sinA = Math.sin(angle);\n const cosA = Math.cos(angle);\n const sinA2 = sinA * sinA;\n const x2 = X * X;\n const y2 = Y * Y;\n const z2 = Z * Z;\n\n const m11 = 1 - 2 * (y2 + z2) * sinA2;\n m.m11 = m11;\n m.a = m11;\n\n const m12 = 2 * (X * Y * sinA2 + Z * sinA * cosA);\n m.m12 = m12;\n m.b = m12;\n\n m.m13 = 2 * (X * Z * sinA2 - Y * sinA * cosA);\n\n const m21 = 2 * (Y * X * sinA2 - Z * sinA * cosA);\n m.m21 = m21;\n m.c = m21;\n\n const m22 = 1 - 2 * (z2 + x2) * sinA2;\n m.m22 = m22;\n m.d = m22;\n\n m.m23 = 2 * (Y * Z * sinA2 + X * sinA * cosA);\n m.m31 = 2 * (Z * X * sinA2 + Y * sinA * cosA);\n m.m32 = 2 * (Z * Y * sinA2 - X * sinA * cosA);\n m.m33 = 1 - 2 * (x2 + y2) * sinA2;\n\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the scale matrix and returns it.\n * This method is equivalent to the CSS `scale3d()` function, except it doesn't\n * accept {x, y, z} transform origin parameters.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale3d\n *\n * @param x the `x-axis` scale.\n * @param y the `y-axis` scale.\n * @param z the `z-axis` scale.\n * @return the resulted matrix.\n */\nconst Scale = (x: number, y: number, z: number): CSSMatrix => {\n const m = new CSSMatrix();\n m.m11 = x;\n m.a = x;\n\n m.m22 = y;\n m.d = y;\n\n m.m33 = z;\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the shear of both the `x-axis` and`y-axis`\n * matrix and returns it. This method is equivalent to the CSS `skew()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skew\n *\n * @param angleX the X-angle in degrees.\n * @param angleY the Y-angle in degrees.\n * @return the resulted matrix.\n */\nconst Skew = (angleX: number, angleY: number): CSSMatrix => {\n const m = new CSSMatrix();\n if (angleX) {\n const radX = (angleX * Math.PI) / 180;\n const tX = Math.tan(radX);\n m.m21 = tX;\n m.c = tX;\n }\n if (angleY) {\n const radY = (angleY * Math.PI) / 180;\n const tY = Math.tan(radY);\n m.m12 = tY;\n m.b = tY;\n }\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` for the shear of the `x-axis` rotation matrix and\n * returns it. This method is equivalent to the CSS `skewX()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewX\n *\n * @param angle the angle in degrees.\n * @return the resulted matrix.\n */\nconst SkewX = (angle: number): CSSMatrix => {\n return Skew(angle, 0);\n};\n\n/**\n * Creates a new `CSSMatrix` for the shear of the `y-axis` rotation matrix and\n * returns it. This method is equivalent to the CSS `skewY()` function.\n *\n * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewY\n *\n * @param angle the angle in degrees.\n * @return the resulted matrix.\n */\nconst SkewY = (angle: number): CSSMatrix => {\n return Skew(0, angle);\n};\n\n/**\n * Computes the multiplication of two matrixes and stores the result into the\n * third matrix argument, which is also returned. Both source matrixes are\n * not changed.\n *\n * @param m1 the first matrix.\n * @param m2 the second matrix.\n * @param m the matrix to store the result into.\n * @return the resulted matrix.\n */\nconst multiplyInto = (\n m1: CSSMatrix | DOMMatrix | JSONMatrix,\n m2: CSSMatrix | DOMMatrix | JSONMatrix,\n m: CSSMatrix,\n): CSSMatrix => {\n const m11 = m2.m11 * m1.m11 + m2.m12 * m1.m21 + m2.m13 * m1.m31 +\n m2.m14 * m1.m41;\n const m12 = m2.m11 * m1.m12 + m2.m12 * m1.m22 + m2.m13 * m1.m32 +\n m2.m14 * m1.m42;\n const m13 = m2.m11 * m1.m13 + m2.m12 * m1.m23 + m2.m13 * m1.m33 +\n m2.m14 * m1.m43;\n const m14 = m2.m11 * m1.m14 + m2.m12 * m1.m24 + m2.m13 * m1.m34 +\n m2.m14 * m1.m44;\n\n const m21 = m2.m21 * m1.m11 + m2.m22 * m1.m21 + m2.m23 * m1.m31 +\n m2.m24 * m1.m41;\n const m22 = m2.m21 * m1.m12 + m2.m22 * m1.m22 + m2.m23 * m1.m32 +\n m2.m24 * m1.m42;\n const m23 = m2.m21 * m1.m13 + m2.m22 * m1.m23 + m2.m23 * m1.m33 +\n m2.m24 * m1.m43;\n const m24 = m2.m21 * m1.m14 + m2.m22 * m1.m24 + m2.m23 * m1.m34 +\n m2.m24 * m1.m44;\n\n const m31 = m2.m31 * m1.m11 + m2.m32 * m1.m21 + m2.m33 * m1.m31 +\n m2.m34 * m1.m41;\n const m32 = m2.m31 * m1.m12 + m2.m32 * m1.m22 + m2.m33 * m1.m32 +\n m2.m34 * m1.m42;\n const m33 = m2.m31 * m1.m13 + m2.m32 * m1.m23 + m2.m33 * m1.m33 +\n m2.m34 * m1.m43;\n const m34 = m2.m31 * m1.m14 + m2.m32 * m1.m24 + m2.m33 * m1.m34 +\n m2.m34 * m1.m44;\n\n const m41 = m2.m41 * m1.m11 + m2.m42 * m1.m21 + m2.m43 * m1.m31 +\n m2.m44 * m1.m41;\n const m42 = m2.m41 * m1.m12 + m2.m42 * m1.m22 + m2.m43 * m1.m32 +\n m2.m44 * m1.m42;\n const m43 = m2.m41 * m1.m13 + m2.m42 * m1.m23 + m2.m43 * m1.m33 +\n m2.m44 * m1.m43;\n const m44 = m2.m41 * m1.m14 + m2.m42 * m1.m24 + m2.m43 * m1.m34 +\n m2.m44 * m1.m44;\n\n m.m11 = m11;\n m.a = m11;\n\n m.m21 = m21;\n m.c = m21;\n\n m.m31 = m31;\n\n m.m41 = m41;\n m.e = m41;\n\n m.m12 = m12;\n m.b = m12;\n\n m.m22 = m22;\n m.d = m22;\n\n m.m32 = m32;\n\n m.m42 = m42;\n m.f = m42;\n\n m.m13 = m13;\n m.m23 = m23;\n m.m33 = m33;\n m.m43 = m43;\n m.m14 = m14;\n m.m24 = m24;\n m.m34 = m34;\n m.m44 = m44;\n\n return m;\n};\n\n/**\n * Creates a new `CSSMatrix` resulted from the multiplication of two matrixes\n * and returns it. Both matrixes are not changed.\n *\n * @param m1 the first matrix.\n * @param m2 the second matrix.\n * @return the resulted matrix.\n */\nconst Multiply = (\n m1: CSSMatrix | DOMMatrix | JSONMatrix,\n m2: CSSMatrix | DOMMatrix | JSONMatrix,\n): CSSMatrix => {\n return multiplyInto(m1, m2, new CSSMatrix());\n};\n\n/**\n * Creates and returns a new `DOMMatrix` compatible instance\n * with equivalent instance methods.\n *\n * @class CSSMatrix\n *\n * @author thednp <https://github.com/thednp>\n * @link homepage <https://thednp.github.io/dommatrix/>\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix\n */\nexport default class CSSMatrix {\n /** The first element of the first row, alias of `a`. */\n declare m11: number;\n /** The second element of the first row, alias of `b`. */\n declare m12: number;\n /** The third element of the first row. */\n declare m13: number;\n /** The fourth element of the first row. */\n declare m14: number;\n /** The first element of the second row, alias of `c`. */\n declare m21: number;\n /** The second element of the second row, alias of `d`. */\n declare m22: number;\n /** The third element of the second row. */\n declare m23: number;\n /** The fourth element of the second row. */\n declare m24: number;\n /** The first element of the third row. */\n declare m31: number;\n /** The second element of the third row. */\n declare m32: number;\n /** The third element of the third row. */\n declare m33: number;\n /** The fourth element of the third row. */\n declare m34: number;\n /** The first element of the fourth row, alias of `e`. */\n declare m41: number;\n /** The second element of the fourth row, alias of `f`. */\n declare m42: number;\n /** The third element of the fourth row. */\n declare m43: number;\n /** The fourth element of the fourth row. */\n declare m44: number;\n /** The first element of the first row, alias of `m11`. */\n declare a: number;\n /** The second element of the first row, alias of `m12`. */\n declare b: number;\n /** The first element of the second row, alias of `m21`. */\n declare c: number;\n /** The second element of the second row, alias of `m22`. */\n declare d: number;\n /** The first element of the fourth row, alias of `m41`. */\n declare e: number;\n /** The second element of the fourth row, alias of `m42`. */\n declare f: number;\n /** Returns a new translation matrix. See the `Translate` helper. */\n static Translate = Translate;\n /** Returns a new rotation matrix. See the `Rotate` helper. */\n static Rotate = Rotate;\n /** Returns a new rotation matrix about a vector. See the `RotateAxisAngle` helper. */\n static RotateAxisAngle = RotateAxisAngle;\n /** Returns a new scale matrix. See the `Scale` helper. */\n static Scale = Scale;\n /** Returns a new skew-X matrix. See the `SkewX` helper. */\n static SkewX = SkewX;\n /** Returns a new skew-Y matrix. See the `SkewY` helper. */\n static SkewY = SkewY;\n /** Returns a new skew matrix. See the `Skew` helper. */\n static Skew = Skew;\n /** Returns the multiplication of two matrices. See the `Multiply` helper. */\n static Multiply = Multiply;\n /** Creates a new matrix from an array of 6/16 numbers. See the `fromArray` helper. */\n static fromArray = fromArray;\n /** Creates a new matrix from an existing matrix or a JSON object. See the `fromMatrix` helper. */\n static fromMatrix = fromMatrix;\n /** Creates a new matrix from a CSS transform string. See the `fromString` helper. */\n static fromString = fromString;\n /** Returns an *Array* of 6/16 values from a compatible matrix. See the `toArray` helper. */\n static toArray = toArray;\n /** Checks if a value is a compatible 6/16 number array. See the `isCompatibleArray` helper. */\n static isCompatibleArray = isCompatibleArray;\n /** Checks if a value is a `CSSMatrix` / `DOMMatrix` / `JSONMatrix` object. See the `isCompatibleObject` helper. */\n static isCompatibleObject = isCompatibleObject;\n\n /**\n * @constructor\n * @param init accepts all parameter configurations:\n * * valid CSS transform string,\n * * CSSMatrix/DOMMatrix instance,\n * * a 6/16 elements *Array*.\n */\n constructor(init?: CSSMatrixInput) {\n if (init) {\n if (typeof init === \"string\" && init.length && init !== \"none\") {\n return fromString(init);\n }\n if (\n Array.isArray(init) ||\n init instanceof Float64Array ||\n init instanceof Float32Array\n ) {\n return fromArray(init);\n }\n if (typeof init === \"object\") {\n return fromMatrix(init);\n }\n }\n // array 6\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.e = 0;\n this.f = 0;\n // array 16\n this.m11 = 1;\n this.m12 = 0;\n this.m13 = 0;\n this.m14 = 0;\n this.m21 = 0;\n this.m22 = 1;\n this.m23 = 0;\n this.m24 = 0;\n this.m31 = 0;\n this.m32 = 0;\n this.m33 = 1;\n this.m34 = 0;\n this.m41 = 0;\n this.m42 = 0;\n this.m43 = 0;\n this.m44 = 1;\n\n return this;\n }\n\n /**\n * A `Boolean` whose value is `true` if the matrix is the identity matrix. The identity\n * matrix is one in which every value is 0 except those on the main diagonal from top-left\n * to bottom-right corner (in other words, where the offsets in each direction are equal).\n *\n * @return the current property value\n */\n get isIdentity(): boolean {\n return (\n this.m11 === 1 &&\n this.m12 === 0 &&\n this.m13 === 0 &&\n this.m14 === 0 &&\n this.m21 === 0 &&\n this.m22 === 1 &&\n this.m23 === 0 &&\n this.m24 === 0 &&\n this.m31 === 0 &&\n this.m32 === 0 &&\n this.m33 === 1 &&\n this.m34 === 0 &&\n this.m41 === 0 &&\n this.m42 === 0 &&\n this.m43 === 0 &&\n this.m44 === 1\n );\n }\n\n /**\n * A `Boolean` flag whose value is `true` if the matrix was initialized as a 2D matrix\n * and `false` if the matrix is 3D.\n *\n * @return the current property value\n */\n get is2D(): boolean {\n return (\n this.m31 === 0 &&\n this.m32 === 0 &&\n this.m33 === 1 &&\n this.m34 === 0 &&\n this.m43 === 0 &&\n this.m44 === 1\n );\n }\n\n /**\n * The `setMatrixValue` method replaces the existing matrix with one computed\n * in the browser. EG: `matrix(1,0.25,-0.25,1,0,0)`\n *\n * The method accepts any *Array* values, the result of\n * `DOMMatrix` instance method `toFloat64Array()` / `toFloat32Array()` calls\n * or `CSSMatrix` instance method `toArray()`.\n *\n * This method expects valid *matrix()* / *matrix3d()* string values, as well\n * as other transform functions like *translateX(10px)*.\n *\n * The matrix is mutated in place (the same instance is returned), matching\n * the behavior of the native `DOMMatrix.setMatrixValue()`.\n *\n * @param source\n * @return the current matrix instance\n */\n setMatrixValue(source?: CSSMatrixInput): CSSMatrix {\n // CSS transform string source - TransformList first\n if (typeof source === \"string\" && source.length && source !== \"none\") {\n const m = fromString(source);\n return writeValues(\n this,\n m.m11,\n m.m12,\n m.m13,\n m.m14,\n m.m21,\n m.m22,\n m.m23,\n m.m24,\n m.m31,\n m.m32,\n m.m33,\n m.m34,\n m.m41,\n m.m42,\n m.m43,\n m.m44,\n );\n }\n\n // [Array | Float[32/64]Array] come next\n if (\n Array.isArray(source) ||\n source instanceof Float64Array ||\n source instanceof Float32Array\n ) {\n return fromArray(source, this);\n }\n\n // new CSSMatrix(CSSMatrix | DOMMatrix | JSONMatrix) last\n if (typeof source === \"object\") {\n return fromMatrix(source, this);\n }\n\n return this;\n }\n\n /**\n * Returns a *Float32Array* containing elements which comprise the matrix.\n * The method can return either the 16 elements or the 6 elements\n * depending on the value of the `is2D` parameter.\n *\n * @param is2D *Array* representation of the matrix\n * @return an *Array* representation of the matrix\n */\n toFloat32Array(is2D?: boolean): Float32Array {\n return is2D\n ? new Float32Array([this.a, this.b, this.c, this.d, this.e, this.f])\n : new Float32Array([\n this.m11,\n this.m12,\n this.m13,\n this.m14,\n this.m21,\n this.m22,\n this.m23,\n this.m24,\n this.m31,\n this.m32,\n this.m33,\n this.m34,\n this.m41,\n this.m42,\n this.m43,\n this.m44,\n ]);\n }\n\n /**\n * Returns a *Float64Array* containing elements which comprise the matrix.\n * The method can return either the 16 elements or the 6 elements\n * depending on the value of the `is2D` parameter.\n *\n * @param is2D *Array* representation of the matrix\n * @return an *Array* representation of the matrix\n */\n toFloat64Array(is2D?: boolean): Float64Array {\n return is2D\n ? new Float64Array([this.a, this.b, this.c, this.d, this.e, this.f])\n : new Float64Array([\n this.m11,\n this.m12,\n this.m13,\n this.m14,\n this.m21,\n this.m22,\n this.m23,\n this.m24,\n this.m31,\n this.m32,\n this.m33,\n this.m34,\n this.m41,\n this.m42,\n this.m43,\n this.m44,\n ]);\n }\n\n /**\n * Creates and returns a string representation of the matrix in `CSS` matrix syntax,\n * using the appropriate `CSS` matrix notation.\n *\n * matrix3d *matrix3d(m11, m12, m13, m14, m21, ...)*\n * matrix *matrix(a, b, c, d, e, f)*\n *\n * @return a string representation of the matrix\n */\n toString(): string {\n const { is2D } = this;\n const values = this.toFloat64Array(is2D).join(\", \");\n const type = is2D ? \"matrix\" : \"matrix3d\";\n return `${type}(${values})`;\n }\n\n /**\n * Returns a JSON representation of the `CSSMatrix` instance, a standard *Object*\n * that includes `{a,b,c,d,e,f}` and `{m11,m12,m13,..m44}` properties as well\n * as the `is2D` & `isIdentity` properties.\n *\n * The result can also be used as a second parameter for the `fromMatrix` static method\n * to load values into another matrix instance.\n *\n * @return an *Object* with all matrix values.\n */\n toJSON(): JSONMatrix {\n const { is2D, isIdentity } = this;\n return {\n a: this.a,\n b: this.b,\n c: this.c,\n d: this.d,\n e: this.e,\n f: this.f,\n m11: this.m11,\n m12: this.m12,\n m13: this.m13,\n m14: this.m14,\n m21: this.m21,\n m22: this.m22,\n m23: this.m23,\n m24: this.m24,\n m31: this.m31,\n m32: this.m32,\n m33: this.m33,\n m34: this.m34,\n m41: this.m41,\n m42: this.m42,\n m43: this.m43,\n m44: this.m44,\n is2D,\n isIdentity,\n };\n }\n\n /**\n * The Multiply method returns a new CSSMatrix which is the result of this\n * matrix multiplied by the passed matrix, with the passed matrix to the right.\n * This matrix is not modified.\n *\n * @param m2 CSSMatrix\n * @return The resulted matrix.\n */\n multiply(m2: CSSMatrix | DOMMatrix | JSONMatrix): CSSMatrix {\n return Multiply(this, m2);\n }\n\n /**\n * The translate method returns a new matrix which is this matrix post\n * multiplied by a translation matrix containing the passed values. If the z\n * component is undefined, a 0 value is used in its place. This matrix is not\n * modified.\n *\n * @param x X component of the translation value.\n * @param y Y component of the translation value.\n * @param z Z component of the translation value.\n * @return The resulted matrix\n */\n translate(x: number, y?: number, z?: number): CSSMatrix {\n const ty = y ?? 0;\n const tz = z ?? 0;\n const {\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n } = this;\n const n41 = x * m11 + ty * m21 + tz * m31 + m41;\n const n42 = x * m12 + ty * m22 + tz * m32 + m42;\n const n43 = x * m13 + ty * m23 + tz * m33 + m43;\n const n44 = x * m14 + ty * m24 + tz * m34 + m44;\n return fromValues(\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n n41,\n n42,\n n43,\n n44,\n );\n }\n\n /**\n * The scale method returns a new matrix which is this matrix post multiplied by\n * a scale matrix containing the passed values. If the z component is undefined,\n * a 1 value is used in its place. If the y component is undefined, the x\n * component value is used in its place. This matrix is not modified.\n *\n * @param x The X component of the scale value.\n * @param y The Y component of the scale value.\n * @param z The Z component of the scale value.\n * @return The resulted matrix\n */\n scale(x: number, y?: number, z?: number): CSSMatrix {\n const sy = y ?? x;\n const sz = z ?? 1;\n const { m41, m42, m43, m44 } = this;\n return fromValues(\n this.m11 * x,\n this.m12 * x,\n this.m13 * x,\n this.m14 * x,\n this.m21 * sy,\n this.m22 * sy,\n this.m23 * sy,\n this.m24 * sy,\n this.m31 * sz,\n this.m32 * sz,\n this.m33 * sz,\n this.m34 * sz,\n m41,\n m42,\n m43,\n m44,\n );\n }\n\n /**\n * The rotate method returns a new matrix which is this matrix post multiplied\n * by each of 3 rotation matrices about the major axes, first X, then Y, then Z.\n * If the y and z components are undefined, the x value is used to rotate the\n * object about the z axis, as though the vector (0,0,x) were passed. All\n * rotation values are in degrees. This matrix is not modified.\n *\n * @param rx The X component of the rotation, or Z if Y and Z are null.\n * @param ry The (optional) Y component of the rotation value.\n * @param rz The (optional) Z component of the rotation value.\n * @return The resulted matrix\n */\n rotate(rx: number, ry?: number, rz?: number): CSSMatrix {\n let RX = rx;\n let RY = ry || 0;\n let RZ = rz || 0;\n\n if (\n typeof rx === \"number\" &&\n typeof ry === \"undefined\" &&\n typeof rz === \"undefined\"\n ) {\n RZ = RX;\n RX = 0;\n RY = 0;\n }\n\n return this.multiply(Rotate(RX, RY, RZ));\n }\n\n /**\n * The rotateAxisAngle method returns a new matrix which is this matrix post\n * multiplied by a rotation matrix with the given axis and `angle`. The right-hand\n * rule is used to determine the direction of rotation. All rotation values are\n * in degrees. This matrix is not modified.\n *\n * @param x The X component of the axis vector.\n * @param y The Y component of the axis vector.\n * @param z The Z component of the axis vector.\n * @param angle The angle of rotation about the axis vector, in degrees.\n * @return The resulted matrix\n */\n rotateAxisAngle(\n x: number = 0,\n y: number = 0,\n z: number = 0,\n angle: number = 0,\n ): CSSMatrix {\n if ([x, y, z, angle].some((n) => !Number.isFinite(n))) {\n throw new TypeError(\"CSSMatrix: expecting 4 values\");\n }\n\n // Early return if zero-length vector\n const length = Math.sqrt(x * x + y * y + z * z);\n if (length === 0) {\n return fromMatrix(this); // Return copy of this\n }\n\n return this.multiply(RotateAxisAngle(x, y, z, angle));\n }\n\n /**\n * Specifies a skew transformation along the `x-axis` by the given angle.\n * This matrix is not modified.\n *\n * @param angle The angle amount in degrees to skew.\n * @return The resulted matrix\n */\n skewX(angle: number): CSSMatrix {\n return this.skew(angle, 0);\n }\n\n /**\n * Specifies a skew transformation along the `y-axis` by the given angle.\n * This matrix is not modified.\n *\n * @param angle The angle amount in degrees to skew.\n * @return The resulted matrix\n */\n skewY(angle: number): CSSMatrix {\n return this.skew(0, angle);\n }\n\n /**\n * Specifies a skew transformation along both the `x-axis` and `y-axis`.\n * This matrix is not modified.\n *\n * @param angleX The X-angle amount in degrees to skew.\n * @param angleY The angle amount in degrees to skew.\n * @return The resulted matrix\n */\n skew(angleX: number, angleY: number): CSSMatrix {\n const tX = angleX ? Math.tan((angleX * Math.PI) / 180) : 0;\n const tY = angleY ? Math.tan((angleY * Math.PI) / 180) : 0;\n const { m11, m12, m13, m14, m21, m22, m23, m24 } = this;\n return fromValues(\n m11 + tY * m21,\n m12 + tY * m22,\n m13 + tY * m23,\n m14 + tY * m24,\n tX * m11 + m21,\n tX * m12 + m22,\n tX * m13 + m23,\n tX * m14 + m24,\n this.m31,\n this.m32,\n this.m33,\n this.m34,\n this.m41,\n this.m42,\n this.m43,\n this.m44,\n );\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with another matrix.\n * This is the mutable version of multiply().\n *\n * @param m2 The matrix to multiply with\n * @return this matrix (modified)\n */\n multiplySelf(m2: CSSMatrix | DOMMatrix | JSONMatrix): this {\n multiplyInto(this, m2, this);\n return this;\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a translation matrix.\n * This is the mutable version of translate().\n *\n * @param x X component of the translation value.\n * @param y Y component of the translation value.\n * @param z Z component of the translation value.\n * @return this matrix (modified)\n */\n translateSelf(x: number, y?: number, z?: number): this {\n const ty = y ?? 0;\n const tz = z ?? 0;\n const {\n m11,\n m12,\n m13,\n m14,\n m21,\n m22,\n m23,\n m24,\n m31,\n m32,\n m33,\n m34,\n m41,\n m42,\n m43,\n m44,\n } = this;\n const n41 = x * m11 + ty * m21 + tz * m31 + m41;\n const n42 = x * m12 + ty * m22 + tz * m32 + m42;\n const n43 = x * m13 + ty * m23 + tz * m33 + m43;\n const n44 = x * m14 + ty * m24 + tz * m34 + m44;\n this.m41 = n41;\n this.e = n41;\n this.m42 = n42;\n this.f = n42;\n this.m43 = n43;\n this.m44 = n44;\n return this;\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a scale matrix.\n * This is the mutable version of scale().\n *\n * @param x The X component of the scale value.\n * @param y The Y component of the scale value.\n * @param z The Z component of the scale value.\n * @return this matrix (modified)\n */\n scaleSelf(x: number, y?: number, z?: number): this {\n const sy = y ?? x;\n const sz = z ?? 1;\n this.m11 *= x;\n this.a *= x;\n this.m12 *= x;\n this.b *= x;\n this.m13 *= x;\n this.m14 *= x;\n this.m21 *= sy;\n this.c *= sy;\n this.m22 *= sy;\n this.d *= sy;\n this.m23 *= sy;\n this.m24 *= sy;\n this.m31 *= sz;\n this.m32 *= sz;\n this.m33 *= sz;\n this.m34 *= sz;\n return this;\n }\n /**\n * Modifies the current matrix by post-multiplying it with a rotation matrix.\n * This is the mutable version of rotate().\n *\n * @param rx The X component of the rotation, or Z if Y and Z are null.\n * @param ry The (optional) Y component of the rotation value.\n * @param rz The (optional) Z component of the rotation value.\n * @return this matrix (modified)\n */\n rotateSelf(rx: number, ry?: number, rz?: number): this {\n let RX = rx;\n let RY = ry || 0;\n let RZ = rz || 0;\n\n if (\n typeof rx === \"number\" &&\n typeof ry === \"undefined\" &&\n typeof rz === \"undefined\"\n ) {\n RZ = RX;\n RX = 0;\n RY = 0;\n }\n\n return this.multiplySelf(Rotate(RX, RY, RZ));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a rotation matrix\n * with the given axis and angle.\n * This is the mutable version of rotateAxisAngle().\n *\n * @param x The X component of the axis vector.\n * @param y The Y component of the axis vector.\n * @param z The Z component of the axis vector.\n * @param angle The angle of rotation about the axis vector, in degrees.\n * @return this matrix (modified)\n */\n rotateAxisAngleSelf(\n x: number = 0,\n y: number = 0,\n z: number = 0,\n angle: number = 0,\n ): this {\n if ([x, y, z, angle].some((n) => !Number.isFinite(n))) {\n throw new TypeError(\"CSSMatrix: expecting 4 values\");\n }\n\n // Early return if zero-length vector\n const length = Math.sqrt(x * x + y * y + z * z);\n if (length === 0) {\n return this;\n }\n return this.multiplySelf(RotateAxisAngle(x, y, z, angle));\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a skewX matrix.\n * This is the mutable version of skewX().\n *\n * @param angle The angle amount in degrees to skew.\n * @return this matrix (modified)\n */\n skewXSelf(angle: number): this {\n return this.skewSelf(angle, 0);\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a skewY matrix.\n * This is the mutable version of skewY().\n *\n * @param angle The angle amount in degrees to skew.\n * @return this matrix (modified)\n */\n skewYSelf(angle: number): this {\n return this.skewSelf(0, angle);\n }\n\n /**\n * Modifies the current matrix by post-multiplying it with a skew matrix.\n * This is the mutable version of skew().\n *\n * @param angleX The X-angle amount in degrees to skew.\n * @param angleY The Y-angle amount in degrees to skew.\n * @return this matrix (modified)\n */\n skewSelf(angleX: number, angleY: number): this {\n const tX = angleX ? Math.tan((angleX * Math.PI) / 180) : 0;\n const tY = angleY ? Math.tan((angleY * Math.PI) / 180) : 0;\n const { m11, m12, m13, m14, m21, m22, m23, m24 } = this;\n const n11 = m11 + tY * m21;\n const n12 = m12 + tY * m22;\n const n13 = m13 + tY * m23;\n const n14 = m14 + tY * m24;\n const n21 = tX * m11 + m21;\n const n22 = tX * m12 + m22;\n const n23 = tX * m13 + m23;\n const n24 = tX * m14 + m24;\n this.m11 = n11;\n this.a = n11;\n this.m12 = n12;\n this.b = n12;\n this.m13 = n13;\n this.m14 = n14;\n this.m21 = n21;\n this.c = n21;\n this.m22 = n22;\n this.d = n22;\n this.m23 = n23;\n this.m24 = n24;\n return this;\n }\n\n /**\n * Transforms a specified vector using the matrix, returning a new\n * {x,y,z,w} Tuple *Object* comprising the transformed vector.\n * Neither the matrix nor the original vector are altered.\n *\n * The method is equivalent with `transformPoint()` method\n * of the `DOMMatrix` constructor.\n *\n * @param t Tuple with `{x,y,z,w}` components\n * @return the resulting Tuple\n */\n transformPoint(t: PointTuple | DOMPoint): PointTuple | DOMPoint {\n const x = this.m11 * t.x + this.m21 * t.y + this.m31 * t.z + this.m41 * t.w;\n const y = this.m12 * t.x + this.m22 * t.y + this.m32 * t.z + this.m42 * t.w;\n const z = this.m13 * t.x + this.m23 * t.y + this.m33 * t.z + this.m43 * t.w;\n const w = this.m14 * t.x + this.m24 * t.y + this.m34 * t.z + this.m44 * t.w;\n\n return typeof DOMPoint !== \"undefined\" && t instanceof DOMPoint\n ? new DOMPoint(x, y, z, w)\n : {\n x,\n y,\n z,\n w,\n };\n }\n}\n"],"mappings":";;AA4CA,MAAM,YAAY,OAAO,KAAK;CA3B5B,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,YAAY;AAI0B,CAAC;;AAUzC,MAAM,qBACJ,UAC6D;CAC7D,QACG,iBAAiB,gBAChB,iBAAiB,gBAChB,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,MAAM,OAAO,MAAM,QAAQ,MACnE,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,MAAM,MAAM,WAAW,CAAC;AAE1C;;AAGA,MAAM,sBACJ,WACiD;CACjD,OACG,OAAO,cAAc,eAAe,kBAAkB,aACvD,kBAAkB,aACjB,OAAO,WAAW,YACjB,UAAU,OAAO,MAAM,UAAU,KAAK,MAAM;AAElD;;;;;;;;;;;;;AAcA,MAAM,aACJ,OACA,WACc;CACd,IAAI,CAAC,kBAAkB,KAAK,GAC1B,MAAM,UACJ,eACE,MAAM,KAAK,KAAK,CAAC,CAAC,KAAK,GAAG,EAC3B,sCACH;;CAGF,IAAI,MAAM,WAAW,IAAI;EACvB,MAAM,CACJ,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,OACE;EACJ,OAAO,YACL,UAAU,IAAI,UAAU,GACxB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,GACF;CACF;CACA,MAAM,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,OAAO;CACvC,OAAO,YACL,UAAU,IAAI,UAAU,GACxB,KACA,KACA,GACA,GACA,KACA,KACA,GACA,GACA,GACA,GACA,GACA,GACA,KACA,KACA,GACA,CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,eACJ,QACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,QACc;CACd,OAAO,MAAM;CACb,OAAO,IAAI;CAEX,OAAO,MAAM;CACb,OAAO,IAAI;CAEX,OAAO,MAAM;CAEb,OAAO,MAAM;CACb,OAAO,IAAI;CAEX,OAAO,MAAM;CACb,OAAO,IAAI;CAEX,OAAO,MAAM;CACb,OAAO,IAAI;CAEX,OAAO,MAAM;CAEb,OAAO,MAAM;CACb,OAAO,IAAI;CAEX,OAAO,MAAM;CACb,OAAO,MAAM;CACb,OAAO,MAAM;CACb,OAAO,MAAM;CACb,OAAO,MAAM;CACb,OAAO,MAAM;CACb,OAAO,MAAM;CACb,OAAO,MAAM;CAEb,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,cACJ,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,QACc;CACd,OAAO,YACL,IAAI,UAAU,GACd,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,GACF;AACF;;;;;;;;;;AAWA,MAAM,cACJ,GACA,WACc;CACd,IAAI,mBAAmB,CAAC,GACtB,OAAO,YACL,UAAU,IAAI,UAAU,GACxB,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,KACF,EAAE,GACJ;CAEF,MAAM,UACJ,eACE,KAAK,UACH,CACF,E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;EACX,KAAK,MAAM;EACX,KAAK,MAAM;EACX,KAAK,IAAI;EACT,KAAK,MAAM;EACX,KAAK,IAAI;EACT,KAAK,MAAM;EACX,KAAK,MAAM;EACX,OAAO;CACT;;;;;;;;;;;;CAaA,eAAe,GAAiD;EAC9D,MAAM,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE;EAC1E,MAAM,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE;EAC1E,MAAM,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE;EAC1E,MAAM,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM,EAAE;EAE1E,OAAO,OAAO,aAAa,eAAe,aAAa,WACnD,IAAI,SAAS,GAAG,GAAG,GAAG,CAAC,IACvB;GACA;GACA;GACA;GACA;EACF;CACJ;AACF"}
|
package/dist/dommatrix.d.ts
CHANGED
|
@@ -1,36 +1,64 @@
|
|
|
1
1
|
//#region src/types.d.ts
|
|
2
|
-
/** A
|
|
2
|
+
/** A DOMPoint compatible Tuple. */
|
|
3
3
|
interface PointTuple {
|
|
4
|
+
/** The X coordinate of the point. */
|
|
4
5
|
x: number;
|
|
6
|
+
/** The Y coordinate of the point. */
|
|
5
7
|
y: number;
|
|
8
|
+
/** The Z coordinate of the point. */
|
|
6
9
|
z: number;
|
|
10
|
+
/** The perspective divide component of the point. */
|
|
7
11
|
w: number;
|
|
8
12
|
}
|
|
9
13
|
/** The result of **CSSMatrix.toJSON()** / **DOMMatrix.toJSON()** instance calls. */
|
|
10
14
|
interface JSONMatrix {
|
|
15
|
+
/** The first element of the first row, alias of `a`. */
|
|
11
16
|
m11: number;
|
|
17
|
+
/** The second element of the first row, alias of `b`. */
|
|
12
18
|
m12: number;
|
|
19
|
+
/** The third element of the first row. */
|
|
13
20
|
m13: number;
|
|
21
|
+
/** The fourth element of the first row. */
|
|
14
22
|
m14: number;
|
|
23
|
+
/** The first element of the second row, alias of `c`. */
|
|
15
24
|
m21: number;
|
|
25
|
+
/** The second element of the second row, alias of `d`. */
|
|
16
26
|
m22: number;
|
|
27
|
+
/** The third element of the second row. */
|
|
17
28
|
m23: number;
|
|
29
|
+
/** The fourth element of the second row. */
|
|
18
30
|
m24: number;
|
|
31
|
+
/** The first element of the third row. */
|
|
19
32
|
m31: number;
|
|
33
|
+
/** The second element of the third row. */
|
|
20
34
|
m32: number;
|
|
35
|
+
/** The third element of the third row. */
|
|
21
36
|
m33: number;
|
|
37
|
+
/** The fourth element of the third row. */
|
|
22
38
|
m34: number;
|
|
39
|
+
/** The first element of the fourth row, alias of `e`. */
|
|
23
40
|
m41: number;
|
|
41
|
+
/** The second element of the fourth row, alias of `f`. */
|
|
24
42
|
m42: number;
|
|
43
|
+
/** The third element of the fourth row. */
|
|
25
44
|
m43: number;
|
|
45
|
+
/** The fourth element of the fourth row. */
|
|
26
46
|
m44: number;
|
|
47
|
+
/** The first element of the first row, alias of `m11`. */
|
|
27
48
|
a: number;
|
|
49
|
+
/** The second element of the first row, alias of `m12`. */
|
|
28
50
|
b: number;
|
|
51
|
+
/** The first element of the second row, alias of `m21`. */
|
|
29
52
|
c: number;
|
|
53
|
+
/** The second element of the second row, alias of `m22`. */
|
|
30
54
|
d: number;
|
|
55
|
+
/** The first element of the fourth row, alias of `m41`. */
|
|
31
56
|
e: number;
|
|
57
|
+
/** The second element of the fourth row, alias of `m42`. */
|
|
32
58
|
f: number;
|
|
59
|
+
/** A boolean flag indicating whether the matrix is 2D. */
|
|
33
60
|
is2D: boolean;
|
|
61
|
+
/** A boolean flag indicating whether the matrix is the identity matrix. */
|
|
34
62
|
isIdentity: boolean;
|
|
35
63
|
}
|
|
36
64
|
/** An array of 6 numbers representing a 2D matrix. */
|
|
@@ -53,17 +81,21 @@ declare const isCompatibleObject: (object?: unknown) => object is CSSMatrix | DO
|
|
|
53
81
|
* the result is a 3D matrix. Otherwise, a TypeError exception is thrown.
|
|
54
82
|
*
|
|
55
83
|
* @param array an `Array` to feed values from.
|
|
84
|
+
* @param target an optional matrix instance to write the values into; when omitted
|
|
85
|
+
* a new matrix is returned. Used internally by `setMatrixValue` to mutate in place.
|
|
56
86
|
* @return the resulted matrix.
|
|
57
87
|
*/
|
|
58
|
-
declare const fromArray: (array: number[] | Float32Array | Float64Array) => CSSMatrix;
|
|
88
|
+
declare const fromArray: (array: number[] | Float32Array | Float64Array, target?: CSSMatrix) => CSSMatrix;
|
|
59
89
|
/**
|
|
60
90
|
* Creates a new mutable `CSSMatrix` instance given an existing matrix or a
|
|
61
91
|
* `DOMMatrix` instance which provides the values for its properties.
|
|
62
92
|
*
|
|
63
93
|
* @param m the source matrix to feed values from.
|
|
94
|
+
* @param target an optional matrix instance to write the values into; when omitted
|
|
95
|
+
* a new matrix is returned. Used internally by `setMatrixValue` to mutate in place.
|
|
64
96
|
* @return the resulted matrix.
|
|
65
97
|
*/
|
|
66
|
-
declare const fromMatrix: (m: CSSMatrix | DOMMatrix | JSONMatrix) => CSSMatrix;
|
|
98
|
+
declare const fromMatrix: (m: CSSMatrix | DOMMatrix | JSONMatrix, target?: CSSMatrix) => CSSMatrix;
|
|
67
99
|
/**
|
|
68
100
|
* Creates a new mutable `CSSMatrix` given any valid CSS transform string,
|
|
69
101
|
* or what we call `TransformList`:
|
|
@@ -294,8 +326,11 @@ declare class CSSMatrix {
|
|
|
294
326
|
* This method expects valid *matrix()* / *matrix3d()* string values, as well
|
|
295
327
|
* as other transform functions like *translateX(10px)*.
|
|
296
328
|
*
|
|
329
|
+
* The matrix is mutated in place (the same instance is returned), matching
|
|
330
|
+
* the behavior of the native `DOMMatrix.setMatrixValue()`.
|
|
331
|
+
*
|
|
297
332
|
* @param source
|
|
298
|
-
* @return the matrix instance
|
|
333
|
+
* @return the current matrix instance
|
|
299
334
|
*/
|
|
300
335
|
setMatrixValue(source?: CSSMatrixInput): CSSMatrix;
|
|
301
336
|
/**
|