@antv/g 5.0.23-alpha.0 → 5.0.23-alpha.2

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.
Files changed (56) hide show
  1. package/dist/index.umd.min.js +2 -2
  2. package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
  3. package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
  4. package/es/css/cssom/CSSNumericValue.d.ts +108 -4
  5. package/es/css/cssom/CSSNumericValue.js +908 -5
  6. package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
  7. package/es/css/cssom/CSSNumericValueType.js +1 -1
  8. package/es/css/cssom/CSSTransformValue.d.ts +1 -1
  9. package/es/css/cssom/index.d.ts +0 -9
  10. package/es/css/cssom/index.js +1 -10
  11. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  12. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  13. package/lib/css/cssom/CSSNumericValue.d.ts +108 -4
  14. package/lib/css/cssom/CSSNumericValue.js +965 -52
  15. package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
  16. package/lib/css/cssom/CSSNumericValueType.js +59 -59
  17. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  18. package/lib/css/cssom/index.d.ts +0 -9
  19. package/lib/css/cssom/index.js +0 -117
  20. package/package.json +3 -3
  21. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  22. package/es/css/cssom/CSSMathInvert.js +0 -84
  23. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  24. package/es/css/cssom/CSSMathMax.js +0 -118
  25. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  26. package/es/css/cssom/CSSMathMin.js +0 -119
  27. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  28. package/es/css/cssom/CSSMathNegate.js +0 -80
  29. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  30. package/es/css/cssom/CSSMathProduct.js +0 -109
  31. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  32. package/es/css/cssom/CSSMathSum.js +0 -117
  33. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  34. package/es/css/cssom/CSSMathValue.js +0 -27
  35. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  36. package/es/css/cssom/CSSMathVariadic.js +0 -44
  37. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  38. package/es/css/cssom/CSSUnitValue.js +0 -252
  39. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  40. package/lib/css/cssom/CSSMathInvert.js +0 -94
  41. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  42. package/lib/css/cssom/CSSMathMax.js +0 -128
  43. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  44. package/lib/css/cssom/CSSMathMin.js +0 -128
  45. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  46. package/lib/css/cssom/CSSMathNegate.js +0 -89
  47. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  48. package/lib/css/cssom/CSSMathProduct.js +0 -119
  49. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  50. package/lib/css/cssom/CSSMathSum.js +0 -129
  51. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  52. package/lib/css/cssom/CSSMathValue.js +0 -35
  53. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  54. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  55. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  56. package/lib/css/cssom/CSSUnitValue.js +0 -267
@@ -1,119 +0,0 @@
1
- import { __extends, __values } from "tslib";
2
- /**
3
- * The CSSMathMin interface of the CSS_Object_Model represents the CSS min() function.
4
- * It inherits properties and methods from its parent CSSNumericValue.
5
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_min.idl
6
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathMin
7
- */
8
-
9
- import { CSSMathVariadic } from './CSSMathVariadic';
10
- import { CSSNumericValueType, CSSStyleValueType, typeCheck, Nested, ParenLess } from '.'; // Represents the minimum of one or more CSSNumericValues.
11
- // @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
12
-
13
- var CSSMathMin =
14
- /** @class */
15
- function (_super) {
16
- __extends(CSSMathMin, _super);
17
-
18
- function CSSMathMin() {
19
- var _this = _super !== null && _super.apply(this, arguments) || this;
20
-
21
- _this.operator = 'min';
22
- return _this;
23
- }
24
-
25
- CSSMathMin.create = function (values) {
26
- var error = false;
27
- var final_type = typeCheck(values, CSSNumericValueType.add, error);
28
- return error ? null : new CSSMathMin(values, final_type);
29
- };
30
-
31
- CSSMathMin.prototype.clone = function () {
32
- return new CSSMathMin(this.values, this.type_);
33
- };
34
-
35
- CSSMathMin.prototype.getType = function () {
36
- return CSSStyleValueType.kMinType;
37
- };
38
-
39
- CSSMathMin.prototype.sumValue = function () {
40
- var e_1, _a;
41
-
42
- var cur_min = this.numericValues()[0].sumValue();
43
-
44
- if (!cur_min.length) {
45
- return null;
46
- }
47
-
48
- try {
49
- for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
50
- var value = _c.value;
51
- var child_sum = value.sumValue();
52
-
53
- if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_min[0].units)) {
54
- return null;
55
- }
56
-
57
- if (child_sum[0].value < cur_min[0].value) {
58
- cur_min = child_sum;
59
- }
60
- }
61
- } catch (e_1_1) {
62
- e_1 = {
63
- error: e_1_1
64
- };
65
- } finally {
66
- try {
67
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
68
- } finally {
69
- if (e_1) throw e_1.error;
70
- }
71
- }
72
-
73
- return cur_min;
74
- }; // toCalcExpressionNode() {
75
- // const operands: CSSMathExpressionOperation[] = [];
76
- // for (const value of this.numericValues()) {
77
- // const operand = value.toCalcExpressionNode();
78
- // if (!operand) {
79
- // continue;
80
- // }
81
- // operands.push(operand as CSSMathExpressionOperation);
82
- // }
83
- // return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMin);
84
- // }
85
-
86
-
87
- CSSMathMin.prototype.buildCSSText = function (nested, paren_less, result) {
88
- var e_2, _a;
89
-
90
- result += 'min(';
91
- var first_iteration = true;
92
-
93
- try {
94
- for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
95
- var value = _c.value;
96
- if (!first_iteration) result += ', ';
97
- first_iteration = false;
98
- result = value.buildCSSText(Nested.kYes, ParenLess.kYes, result);
99
- }
100
- } catch (e_2_1) {
101
- e_2 = {
102
- error: e_2_1
103
- };
104
- } finally {
105
- try {
106
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
107
- } finally {
108
- if (e_2) throw e_2.error;
109
- }
110
- }
111
-
112
- result += ')';
113
- return result;
114
- };
115
-
116
- return CSSMathMin;
117
- }(CSSMathVariadic);
118
-
119
- export { CSSMathMin };
@@ -1,14 +0,0 @@
1
- import type { CSSNumericSumValue, CSSNumericValueType, CSSNumericValue } from '.';
2
- import { CSSMathValue } from './CSSMathValue';
3
- import { Nested, ParenLess, CSSStyleValueType } from '.';
4
- export declare class CSSMathNegate extends CSSMathValue {
5
- value: CSSNumericValue;
6
- static create(value: CSSNumericValue): CSSMathNegate;
7
- constructor(value: CSSNumericValue, type: CSSNumericValueType);
8
- operator: string;
9
- clone(): CSSMathNegate;
10
- getType(): CSSStyleValueType;
11
- equals(other: CSSNumericValue): any;
12
- sumValue(): CSSNumericSumValue;
13
- buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
14
- }
@@ -1,80 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { CSSMathValue } from './CSSMathValue';
3
- import { Nested, ParenLess, CSSStyleValueType } from '.';
4
-
5
- var CSSMathNegate =
6
- /** @class */
7
- function (_super) {
8
- __extends(CSSMathNegate, _super);
9
-
10
- function CSSMathNegate(value, type) {
11
- var _this = _super.call(this, type) || this;
12
-
13
- _this.value = value;
14
- _this.operator = 'negate';
15
- return _this;
16
- }
17
-
18
- CSSMathNegate.create = function (value) {
19
- return new CSSMathNegate(value, value.type_);
20
- };
21
-
22
- CSSMathNegate.prototype.clone = function () {
23
- return new CSSMathNegate(this.value, this.type_);
24
- };
25
-
26
- CSSMathNegate.prototype.getType = function () {
27
- return CSSStyleValueType.kNegateType;
28
- };
29
-
30
- CSSMathNegate.prototype.equals = function (other) {
31
- if (other.getType() !== CSSStyleValueType.kNegateType) {
32
- return false;
33
- }
34
-
35
- var other_invert = other;
36
- return this.value.equals(other_invert.value);
37
- };
38
-
39
- CSSMathNegate.prototype.sumValue = function () {
40
- var sum = this.value.sumValue();
41
-
42
- if (sum.length === 0) {
43
- return null;
44
- }
45
-
46
- sum.forEach(function (term) {
47
- term.value *= -1;
48
- });
49
- return sum;
50
- }; // toCalcExpressionNode(): CSSMathExpressionNode {
51
- // const right_side = this.value.toCalcExpressionNode();
52
- // if (!right_side) {
53
- // return null;
54
- // }
55
- // // return CSSMathExpressionOperation::CreateArithmeticOperationSimplified(
56
- // // CSSMathExpressionNumericLiteral::Create(
57
- // // -1, CSSPrimitiveValue::UnitType::kNumber),
58
- // // right_side, CSSMathOperator::kMultiply);
59
- // }
60
-
61
-
62
- CSSMathNegate.prototype.buildCSSText = function (nested, paren_less, result) {
63
- if (paren_less == ParenLess.kNo) {
64
- result += nested === Nested.kYes ? '(' : 'calc(';
65
- }
66
-
67
- result += '-';
68
- result = this.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
69
-
70
- if (paren_less === ParenLess.kNo) {
71
- result += ')';
72
- }
73
-
74
- return result;
75
- };
76
-
77
- return CSSMathNegate;
78
- }(CSSMathValue);
79
-
80
- export { CSSMathNegate };
@@ -1,16 +0,0 @@
1
- import type { CSSNumericValue, CSSNumericSumValue, UnitMap } from '.';
2
- import { CSSMathVariadic } from './CSSMathVariadic';
3
- import { CSSStyleValueType, Nested, ParenLess } from '.';
4
- /**
5
- * Represents the product of one or more CSSNumericValues.
6
- * @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
7
- */
8
- export declare class CSSMathProduct extends CSSMathVariadic {
9
- static create(values: CSSNumericValue[]): CSSMathProduct;
10
- static multiplyUnitMaps(a: UnitMap, b: UnitMap): UnitMap;
11
- operator: string;
12
- clone(): CSSMathProduct;
13
- getType(): CSSStyleValueType;
14
- sumValue(): CSSNumericSumValue;
15
- buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
16
- }
@@ -1,109 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { DCHECK_NE } from '../../utils';
3
- import { CSSMathVariadic } from './CSSMathVariadic';
4
- import { typeCheck, CSSStyleValueType, CSSNumericValueType, Nested, ParenLess } from '.';
5
- /**
6
- * Represents the product of one or more CSSNumericValues.
7
- * @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
8
- */
9
-
10
- var CSSMathProduct =
11
- /** @class */
12
- function (_super) {
13
- __extends(CSSMathProduct, _super);
14
-
15
- function CSSMathProduct() {
16
- var _this = _super !== null && _super.apply(this, arguments) || this;
17
-
18
- _this.operator = 'product';
19
- return _this;
20
- }
21
-
22
- CSSMathProduct.create = function (values) {
23
- var error = false;
24
- var finalType = typeCheck(values, CSSNumericValueType.multiply, error);
25
- return error ? null : new CSSMathProduct(values, finalType);
26
- };
27
-
28
- CSSMathProduct.multiplyUnitMaps = function (a, b) {
29
- Object.keys(b).forEach(function (key) {
30
- DCHECK_NE(b[key].value, 0);
31
- var old_value = key in a ? a[key].value : 0;
32
-
33
- if (old_value + b[key].value === 0) {
34
- delete a[key];
35
- } else {
36
- a[key] = old_value + b[key].value;
37
- }
38
- });
39
- return a;
40
- };
41
-
42
- CSSMathProduct.prototype.clone = function () {
43
- return new CSSMathProduct(this.values, this.type_);
44
- };
45
-
46
- CSSMathProduct.prototype.getType = function () {
47
- return CSSStyleValueType.kProductType;
48
- }; // toCalcExpressionNode() {
49
- // return this.toCalcExporessionNodeForVariadic(CSSMathOperator.kMultiply);
50
- // }
51
-
52
-
53
- CSSMathProduct.prototype.sumValue = function () {
54
- var sum = [{
55
- value: 1,
56
- units: {}
57
- }];
58
- this.numericValues().forEach(function (value) {
59
- var child_sum = value.sumValue();
60
-
61
- if (!child_sum.length) {
62
- return null;
63
- }
64
-
65
- var new_sum = [];
66
- sum.forEach(function (a) {
67
- child_sum.forEach(function (b) {
68
- new_sum.push({
69
- value: a.value * b.value,
70
- units: CSSMathProduct.multiplyUnitMaps(a.units, b.units)
71
- });
72
- });
73
- });
74
- sum = new_sum;
75
- });
76
- return sum;
77
- };
78
-
79
- CSSMathProduct.prototype.buildCSSText = function (nested, paren_less, result) {
80
- if (paren_less == ParenLess.kNo) {
81
- result += nested === Nested.kYes ? '(' : 'calc(';
82
- }
83
-
84
- var values = this.numericValues();
85
- result = values[0].buildCSSText(Nested.kYes, ParenLess.kNo, result);
86
-
87
- for (var i = 1; i < values.length; i++) {
88
- var arg = values[i];
89
-
90
- if (arg.getType() === CSSStyleValueType.kInvertType) {
91
- result += ' / ';
92
- result = arg.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
93
- } else {
94
- result += ' * ';
95
- result = arg.buildCSSText(Nested.kYes, ParenLess.kNo, result);
96
- }
97
- }
98
-
99
- if (paren_less === ParenLess.kNo) {
100
- result += ')';
101
- }
102
-
103
- return result;
104
- };
105
-
106
- return CSSMathProduct;
107
- }(CSSMathVariadic);
108
-
109
- export { CSSMathProduct };
@@ -1,17 +0,0 @@
1
- import type { CSSNumericValue, CSSNumericSumValue, UnitMap } from '.';
2
- import { CSSMathVariadic } from './CSSMathVariadic';
3
- import { CSSStyleValueType, CSSNumericValueType, Nested, ParenLess } from '.';
4
- /**
5
- * Represents the sum of one or more CSSNumericValues.
6
- * @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
7
- */
8
- export declare class CSSMathSum extends CSSMathVariadic {
9
- static create(values: CSSNumericValue[]): CSSMathSum;
10
- static numericTypeFromUnitMap(units: UnitMap): CSSNumericValueType;
11
- static canCreateNumericTypeFromSumValue(sum: CSSNumericSumValue): boolean;
12
- operator: string;
13
- clone(): CSSMathSum;
14
- getType(): CSSStyleValueType;
15
- sumValue(): CSSNumericSumValue;
16
- buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
17
- }
@@ -1,117 +0,0 @@
1
- import { __assign, __extends } from "tslib";
2
- import { DCHECK } from '../../utils';
3
- import { CSSMathVariadic } from './CSSMathVariadic';
4
- import { typeCheck, CSSStyleValueType, CSSNumericValueType, Nested, ParenLess } from '.';
5
- /**
6
- * Represents the sum of one or more CSSNumericValues.
7
- * @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
8
- */
9
-
10
- var CSSMathSum =
11
- /** @class */
12
- function (_super) {
13
- __extends(CSSMathSum, _super);
14
-
15
- function CSSMathSum() {
16
- var _this = _super !== null && _super.apply(this, arguments) || this;
17
-
18
- _this.operator = 'sum';
19
- return _this;
20
- }
21
-
22
- CSSMathSum.create = function (values) {
23
- var error = false;
24
- var finalType = typeCheck(values, CSSNumericValueType.add, error);
25
- return error ? null : new CSSMathSum(values, finalType);
26
- };
27
-
28
- CSSMathSum.numericTypeFromUnitMap = function (units) {
29
- var type = new CSSNumericValueType();
30
- Object.keys(units).forEach(function (key) {
31
- var exp = units[key];
32
- var error = false;
33
- type = CSSNumericValueType.multiply(type, new CSSNumericValueType(Number(key), exp), error);
34
- DCHECK(!error);
35
- });
36
- return type;
37
- };
38
-
39
- CSSMathSum.canCreateNumericTypeFromSumValue = function (sum) {
40
- var _this = this;
41
-
42
- DCHECK(!!sum.length);
43
- var first_type = this.numericTypeFromUnitMap(sum[0].units);
44
- return sum.every(function (term) {
45
- var error = false;
46
- CSSNumericValueType.add(first_type, _this.numericTypeFromUnitMap(term.units), error);
47
- return !error;
48
- });
49
- };
50
-
51
- CSSMathSum.prototype.clone = function () {
52
- return new CSSMathSum(this.values, this.type_);
53
- };
54
-
55
- CSSMathSum.prototype.getType = function () {
56
- return CSSStyleValueType.kSumType;
57
- }; // toCalcExpressionNode() {
58
- // return this.toCalcExporessionNodeForVariadic(CSSMathOperator.kAdd);
59
- // }
60
-
61
-
62
- CSSMathSum.prototype.sumValue = function () {
63
- var sum = [];
64
- this.numericValues().forEach(function (value) {
65
- var child_sum = value.sumValue();
66
-
67
- if (!child_sum.length) {
68
- return null;
69
- }
70
-
71
- child_sum.forEach(function (term) {
72
- var index = sum.findIndex(function (s) {
73
- return JSON.stringify(s.units) === JSON.stringify(term.units);
74
- });
75
-
76
- if (index === -1) {
77
- sum.push(__assign({}, term));
78
- } else {
79
- sum[index].value += term.value;
80
- }
81
- });
82
- });
83
- if (!CSSMathSum.canCreateNumericTypeFromSumValue(sum)) return null;
84
- return sum;
85
- };
86
-
87
- CSSMathSum.prototype.buildCSSText = function (nested, paren_less, result) {
88
- if (paren_less == ParenLess.kNo) {
89
- result += nested === Nested.kYes ? '(' : 'calc(';
90
- }
91
-
92
- var values = this.numericValues();
93
- result = values[0].buildCSSText(Nested.kYes, ParenLess.kNo, result);
94
-
95
- for (var i = 1; i < values.length; i++) {
96
- var arg = values[i];
97
-
98
- if (arg.getType() === CSSStyleValueType.kNegateType) {
99
- result += ' - ';
100
- result = arg.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
101
- } else {
102
- result += ' + ';
103
- result = arg.buildCSSText(Nested.kYes, ParenLess.kNo, result);
104
- }
105
- }
106
-
107
- if (paren_less === ParenLess.kNo) {
108
- result += ')';
109
- }
110
-
111
- return result;
112
- };
113
-
114
- return CSSMathSum;
115
- }(CSSMathVariadic);
116
-
117
- export { CSSMathSum };
@@ -1,11 +0,0 @@
1
- import { CSSNumericValue } from './CSSNumericValue';
2
- /**
3
- * The CSSMathValue interface of the CSS_Object_Model a base class for classes representing complex numeric values.
4
- *
5
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
6
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
7
- */
8
- export declare abstract class CSSMathValue extends CSSNumericValue {
9
- abstract operator: string;
10
- isUnitValue(): boolean;
11
- }
@@ -1,27 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { CSSNumericValue } from './CSSNumericValue';
3
- /**
4
- * The CSSMathValue interface of the CSS_Object_Model a base class for classes representing complex numeric values.
5
- *
6
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
7
- * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
8
- */
9
-
10
- var CSSMathValue =
11
- /** @class */
12
- function (_super) {
13
- __extends(CSSMathValue, _super);
14
-
15
- function CSSMathValue() {
16
- return _super !== null && _super.apply(this, arguments) || this;
17
- } // From CSSNumericValue
18
-
19
-
20
- CSSMathValue.prototype.isUnitValue = function () {
21
- return false;
22
- };
23
-
24
- return CSSMathValue;
25
- }(CSSNumericValue);
26
-
27
- export { CSSMathValue };
@@ -1,9 +0,0 @@
1
- import { CSSMathValue } from './CSSMathValue';
2
- import type { CSSNumericValue, CSSNumericValueType } from '.';
3
- export declare function typeCheck(values: CSSNumericValue[], op: Function, error: boolean): CSSNumericValueType;
4
- export declare abstract class CSSMathVariadic extends CSSMathValue {
5
- values: CSSNumericValue[];
6
- constructor(values: CSSNumericValue[], type: CSSNumericValueType);
7
- numericValues(): CSSNumericValue[];
8
- equals(other: CSSNumericValue): any;
9
- }
@@ -1,44 +0,0 @@
1
- import { __extends } from "tslib";
2
- import { CSSMathValue } from './CSSMathValue';
3
- export function typeCheck(values, op, error) {
4
- error = false;
5
- var final_type = values[0].type_;
6
-
7
- for (var i = 1; i < values.length; i++) {
8
- final_type = op(final_type, values[i].type_, error);
9
- if (error) return final_type;
10
- }
11
-
12
- return final_type;
13
- } // Represents an arithmetic operation with one or more CSSNumericValues.
14
-
15
- var CSSMathVariadic =
16
- /** @class */
17
- function (_super) {
18
- __extends(CSSMathVariadic, _super);
19
-
20
- function CSSMathVariadic(values, type) {
21
- var _this = _super.call(this, type) || this;
22
-
23
- _this.values = values;
24
- return _this;
25
- }
26
-
27
- CSSMathVariadic.prototype.numericValues = function () {
28
- return this.values;
29
- };
30
-
31
- CSSMathVariadic.prototype.equals = function (other) {
32
- if (this.getType() !== other.getType()) {
33
- return false;
34
- }
35
-
36
- return this.values.every(function (value, i) {
37
- return value.equals(other.values[i]);
38
- });
39
- };
40
-
41
- return CSSMathVariadic;
42
- }(CSSMathValue);
43
-
44
- export { CSSMathVariadic };
@@ -1,33 +0,0 @@
1
- /**
2
- * The CSSUnitValue interface of the CSS_Object_Model represents values that contain a single unit type.
3
- * For example, "42px" would be represented by a CSSNumericValue.
4
- *
5
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSUnitValue
6
- */
7
- import { CSSMathInvert } from './CSSMathInvert';
8
- import type { CSSNumericSumValue } from './CSSNumericSumValue';
9
- import type { Nested, ParenLess } from '.';
10
- import { CSSNumericValue } from './CSSNumericValue';
11
- import { CSSStyleValueType, UnitType } from '.';
12
- /**
13
- * Represents numeric values that can be expressed as a single number plus a
14
- * unit (or a naked number or percentage).
15
- * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
16
- */
17
- export declare class CSSUnitValue extends CSSNumericValue {
18
- static toCanonicalUnit(unit: UnitType): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;
19
- static toCanonicalUnitIfPossible(unit: UnitType): UnitType;
20
- static formatInfinityOrNaN(number: number, suffix?: string): string;
21
- static formatNumber(number: number, suffix?: string): string;
22
- unit: UnitType;
23
- value: number;
24
- constructor(value: number, unitOrName?: UnitType | string);
25
- clone(): CSSUnitValue;
26
- convertTo(target_unit: UnitType): CSSUnitValue;
27
- equals(other: CSSNumericValue): boolean;
28
- getType(): CSSStyleValueType;
29
- sumValue(): CSSNumericSumValue;
30
- negate(): CSSUnitValue;
31
- invert(): CSSUnitValue | CSSMathInvert;
32
- buildCSSText(n: Nested, p: ParenLess, result: string): string;
33
- }