@antv/g 5.0.22 → 5.0.23-alpha.11

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 (168) hide show
  1. package/dist/index.umd.min.js +3 -3
  2. package/es/AbstractRenderer.js +5 -0
  3. package/es/camera/Camera.js +2 -2
  4. package/es/css/StyleValueRegistry.d.ts +2 -0
  5. package/es/css/StyleValueRegistry.js +7 -3
  6. package/es/css/cssom/CSSKeywordValue.d.ts +1 -1
  7. package/es/css/cssom/CSSNumericSumValue.d.ts +1 -1
  8. package/es/css/cssom/CSSNumericValue.d.ts +141 -4
  9. package/es/css/cssom/CSSNumericValue.js +1166 -5
  10. package/es/css/cssom/CSSTransformValue.d.ts +1 -1
  11. package/es/css/cssom/index.d.ts +0 -10
  12. package/es/css/cssom/index.js +1 -11
  13. package/es/css/parser/color.js +1 -1
  14. package/es/css/parser/dimension.js +1 -2
  15. package/es/css/parser/numeric.d.ts +1 -1
  16. package/es/css/parser/numeric.js +2 -2
  17. package/es/css/parser/path.d.ts +2 -2
  18. package/es/css/parser/path.js +1 -1
  19. package/es/css/parser/points.js +1 -1
  20. package/es/css/parser/transform-origin.d.ts +1 -1
  21. package/es/css/parser/transform-origin.js +2 -2
  22. package/es/css/parser/transform.d.ts +1 -3
  23. package/es/css/parser/transform.js +9 -8
  24. package/es/css/properties/CSSPropertyPath.d.ts +14 -2
  25. package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  26. package/es/css/properties/CSSPropertyTransform.js +3 -4
  27. package/es/display-objects/DisplayObject.js +4 -5
  28. package/es/display-objects/Path.d.ts +15 -15
  29. package/es/display-objects/Path.js +1 -1
  30. package/es/display-objects/Polygon.d.ts +8 -1
  31. package/es/display-objects/Polyline.d.ts +7 -5
  32. package/es/dom/Document.js +2 -2
  33. package/es/dom/Element.js +1 -2
  34. package/es/dom/EventTarget.js +1 -1
  35. package/es/dom/FederatedTouchEvent.d.ts +5 -3
  36. package/es/plugins/CullingPlugin.d.ts +0 -1
  37. package/es/plugins/CullingPlugin.js +3 -8
  38. package/es/plugins/DirtyCheckPlugin.d.ts +1 -1
  39. package/es/plugins/DirtyCheckPlugin.js +9 -8
  40. package/es/plugins/EventPlugin.d.ts +1 -1
  41. package/es/plugins/EventPlugin.js +163 -148
  42. package/es/plugins/PrepareRendererPlugin.d.ts +0 -1
  43. package/es/plugins/PrepareRendererPlugin.js +17 -18
  44. package/es/services/EventService.d.ts +8 -0
  45. package/es/services/EventService.js +274 -20
  46. package/es/services/RenderingService.d.ts +17 -16
  47. package/es/services/RenderingService.js +20 -19
  48. package/es/services/SceneGraphService.js +1 -1
  49. package/es/services/aabb/PathUpdater.d.ts +3 -3
  50. package/es/services/aabb/PolylineUpdater.d.ts +3 -3
  51. package/es/services/aabb/RectUpdater.js +1 -1
  52. package/es/types.d.ts +5 -3
  53. package/es/utils/assert.d.ts +6 -0
  54. package/es/utils/assert.js +18 -0
  55. package/es/utils/event.d.ts +18 -16
  56. package/es/utils/hooks.d.ts +280 -0
  57. package/es/utils/hooks.js +753 -0
  58. package/es/utils/index.d.ts +1 -0
  59. package/es/utils/index.js +2 -1
  60. package/es/utils/math.d.ts +1 -0
  61. package/es/utils/math.js +13 -2
  62. package/es/utils/string.d.ts +1 -0
  63. package/es/utils/string.js +8 -0
  64. package/es/utils/text.js +2 -1
  65. package/lib/AbstractRenderer.js +5 -0
  66. package/lib/camera/Camera.js +4 -4
  67. package/lib/css/StyleValueRegistry.d.ts +2 -0
  68. package/lib/css/StyleValueRegistry.js +13 -5
  69. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  70. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  71. package/lib/css/cssom/CSSNumericValue.d.ts +141 -4
  72. package/lib/css/cssom/CSSNumericValue.js +1226 -52
  73. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  74. package/lib/css/cssom/index.d.ts +0 -10
  75. package/lib/css/cssom/index.js +0 -130
  76. package/lib/css/parser/color.js +5 -5
  77. package/lib/css/parser/dimension.js +1 -3
  78. package/lib/css/parser/numeric.d.ts +1 -1
  79. package/lib/css/parser/numeric.js +7 -7
  80. package/lib/css/parser/path.d.ts +2 -2
  81. package/lib/css/parser/path.js +4 -4
  82. package/lib/css/parser/points.js +2 -2
  83. package/lib/css/parser/transform-origin.d.ts +1 -1
  84. package/lib/css/parser/transform-origin.js +4 -4
  85. package/lib/css/parser/transform.d.ts +1 -3
  86. package/lib/css/parser/transform.js +25 -24
  87. package/lib/css/properties/CSSPropertyPath.d.ts +14 -2
  88. package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -2
  89. package/lib/css/properties/CSSPropertyTransform.js +18 -20
  90. package/lib/display-objects/DisplayObject.js +7 -9
  91. package/lib/display-objects/Path.d.ts +15 -15
  92. package/lib/display-objects/Path.js +3 -3
  93. package/lib/display-objects/Polygon.d.ts +8 -1
  94. package/lib/display-objects/Polyline.d.ts +7 -5
  95. package/lib/dom/Document.js +2 -2
  96. package/lib/dom/Element.js +1 -3
  97. package/lib/dom/EventTarget.js +9 -9
  98. package/lib/dom/FederatedTouchEvent.d.ts +5 -3
  99. package/lib/plugins/CullingPlugin.d.ts +0 -1
  100. package/lib/plugins/CullingPlugin.js +3 -7
  101. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -1
  102. package/lib/plugins/DirtyCheckPlugin.js +10 -8
  103. package/lib/plugins/EventPlugin.d.ts +1 -1
  104. package/lib/plugins/EventPlugin.js +172 -156
  105. package/lib/plugins/PrepareRendererPlugin.d.ts +0 -1
  106. package/lib/plugins/PrepareRendererPlugin.js +16 -16
  107. package/lib/services/EventService.d.ts +8 -0
  108. package/lib/services/EventService.js +274 -19
  109. package/lib/services/RenderingService.d.ts +17 -16
  110. package/lib/services/RenderingService.js +21 -20
  111. package/lib/services/SceneGraphService.js +3 -3
  112. package/lib/services/aabb/PathUpdater.d.ts +3 -3
  113. package/lib/services/aabb/PolylineUpdater.d.ts +3 -3
  114. package/lib/services/aabb/RectUpdater.js +3 -3
  115. package/lib/types.d.ts +5 -3
  116. package/lib/utils/assert.d.ts +6 -0
  117. package/lib/utils/assert.js +30 -0
  118. package/lib/utils/event.d.ts +18 -16
  119. package/lib/utils/hooks.d.ts +280 -0
  120. package/lib/utils/hooks.js +759 -0
  121. package/lib/utils/index.d.ts +1 -0
  122. package/lib/utils/index.js +13 -0
  123. package/lib/utils/math.d.ts +1 -0
  124. package/lib/utils/math.js +17 -4
  125. package/lib/utils/string.d.ts +1 -0
  126. package/lib/utils/string.js +11 -0
  127. package/lib/utils/text.js +5 -3
  128. package/package.json +4 -7
  129. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  130. package/es/css/cssom/CSSMathInvert.js +0 -84
  131. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  132. package/es/css/cssom/CSSMathMax.js +0 -118
  133. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  134. package/es/css/cssom/CSSMathMin.js +0 -119
  135. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  136. package/es/css/cssom/CSSMathNegate.js +0 -80
  137. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  138. package/es/css/cssom/CSSMathProduct.js +0 -109
  139. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  140. package/es/css/cssom/CSSMathSum.js +0 -117
  141. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  142. package/es/css/cssom/CSSMathValue.js +0 -27
  143. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  144. package/es/css/cssom/CSSMathVariadic.js +0 -44
  145. package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
  146. package/es/css/cssom/CSSNumericValueType.js +0 -259
  147. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  148. package/es/css/cssom/CSSUnitValue.js +0 -252
  149. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  150. package/lib/css/cssom/CSSMathInvert.js +0 -94
  151. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  152. package/lib/css/cssom/CSSMathMax.js +0 -128
  153. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  154. package/lib/css/cssom/CSSMathMin.js +0 -128
  155. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  156. package/lib/css/cssom/CSSMathNegate.js +0 -89
  157. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  158. package/lib/css/cssom/CSSMathProduct.js +0 -119
  159. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  160. package/lib/css/cssom/CSSMathSum.js +0 -129
  161. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  162. package/lib/css/cssom/CSSMathValue.js +0 -35
  163. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  164. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  165. package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
  166. package/lib/css/cssom/CSSNumericValueType.js +0 -272
  167. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  168. package/lib/css/cssom/CSSUnitValue.js +0 -267
@@ -6,3 +6,4 @@ export * from './text';
6
6
  export * from './string';
7
7
  export * from './event';
8
8
  export * from './canvas';
9
+ export * from './hooks';
package/es/utils/index.js CHANGED
@@ -5,4 +5,5 @@ export * from './path';
5
5
  export * from './text';
6
6
  export * from './string';
7
7
  export * from './event';
8
- export * from './canvas';
8
+ export * from './canvas';
9
+ export * from './hooks';
@@ -1,5 +1,6 @@
1
1
  import type { quat, vec2, vec4 } from 'gl-matrix';
2
2
  import { mat3, mat4, vec3 } from 'gl-matrix';
3
+ export declare function clamp(number: number, boundOne: number, boundTwo: number): number;
3
4
  export declare function getAngle(angle?: number): number;
4
5
  export declare function createVec3(x: number | vec2 | vec3 | vec4, y?: number, z?: number): vec3;
5
6
  export declare function deg2rad(deg: number): number;
package/es/utils/math.js CHANGED
@@ -1,6 +1,17 @@
1
1
  import { __read } from "tslib";
2
- import { isArray, isNumber } from 'lodash-es';
3
2
  import { mat3, mat4, vec3 } from 'gl-matrix';
3
+ import { isNumber } from './assert';
4
+ export function clamp(number, boundOne, boundTwo) {
5
+ if (!boundTwo) {
6
+ return Math.max(number, boundOne) === boundOne ? number : boundOne;
7
+ } else if (Math.min(number, boundOne) === number) {
8
+ return boundOne;
9
+ } else if (Math.max(number, boundTwo) === number) {
10
+ return boundTwo;
11
+ }
12
+
13
+ return number;
14
+ }
4
15
  export function getAngle(angle) {
5
16
  if (angle === undefined) {
6
17
  return 0;
@@ -23,7 +34,7 @@ export function createVec3(x, y, z) {
23
34
  return vec3.fromValues(x, y, z);
24
35
  }
25
36
 
26
- if (isArray(x) && x.length === 3) {
37
+ if (Array.isArray(x) && x.length === 3) {
27
38
  return vec3.clone(x);
28
39
  }
29
40
 
@@ -1 +1,2 @@
1
1
  export declare function camelCase(str?: string): string;
2
+ export declare function isString(str: any): str is string;
@@ -1,3 +1,4 @@
1
+ import { isNil } from './assert';
1
2
  export function camelCase(str) {
2
3
  if (str === void 0) {
3
4
  str = '';
@@ -6,4 +7,11 @@ export function camelCase(str) {
6
7
  return str.replace(/-([a-z])/g, function (g) {
7
8
  return g[1].toUpperCase();
8
9
  });
10
+ }
11
+ export function isString(str) {
12
+ if (!isNil(str) && typeof str === 'string') {
13
+ return true;
14
+ }
15
+
16
+ return false;
9
17
  }
package/es/utils/text.js CHANGED
@@ -1,4 +1,5 @@
1
- import { isNumber, isString } from 'lodash-es';
1
+ import { isNumber } from './assert';
2
+ import { isString } from './string';
2
3
  var genericFontFamilies = ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui'];
3
4
  export function toFontString(attributes) {
4
5
  var fontSize = attributes.fontSize,
@@ -13,6 +13,11 @@ function () {
13
13
  function AbstractRenderer(config) {
14
14
  this.plugins = [];
15
15
  this.config = (0, _tslib.__assign)({
16
+ /**
17
+ * only dirty object will cause re-render
18
+ */
19
+ enableDirtyCheck: true,
20
+
16
21
  /**
17
22
  * enable auto rendering by default
18
23
  */
@@ -7,8 +7,6 @@ exports.DefaultCamera = exports.CameraType = exports.CameraTrackingMode = export
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
10
- var _lodashEs = require("lodash-es");
11
-
12
10
  var _manaSyringe = require("mana-syringe");
13
11
 
14
12
  var _eventemitter = require("eventemitter3");
@@ -21,6 +19,8 @@ var _math = require("../utils/math");
21
19
 
22
20
  var _animation = require("../utils/animation");
23
21
 
22
+ var _utils = require("../utils");
23
+
24
24
  // import { DisplayObject } from '../display-objects';
25
25
  var DefaultCamera = _manaSyringe.Syringe.defineToken('DefaultCamera');
26
26
 
@@ -914,12 +914,12 @@ function (_super) {
914
914
  options = {};
915
915
  }
916
916
 
917
- var landmark = (0, _lodashEs.isString)(name) ? this.landmarks.find(function (l) {
917
+ var landmark = (0, _utils.isString)(name) ? this.landmarks.find(function (l) {
918
918
  return l.name === name;
919
919
  }) : name;
920
920
 
921
921
  if (landmark) {
922
- var _a = (0, _lodashEs.isNumber)(options) ? {
922
+ var _a = (0, _utils.isNumber)(options) ? {
923
923
  duration: options
924
924
  } : options,
925
925
  _b = _a.easing,
@@ -1,3 +1,4 @@
1
+ import { Syringe } from 'mana-syringe';
1
2
  import type { DisplayObject } from '../display-objects';
2
3
  import type { BaseStyleProps } from '../types';
3
4
  import { CSSStyleValue } from './cssom';
@@ -65,6 +66,7 @@ export interface PropertyMetadata {
65
66
  * Blink used them in code generation(css_properties.json5)
66
67
  */
67
68
  export declare const BUILT_IN_PROPERTIES: PropertyMetadata[];
69
+ export declare const StyleValueRegistryContribution: Syringe.DefinedToken;
68
70
  export declare class StyleValueRegistry {
69
71
  /**
70
72
  * need recalc later
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyleValueRegistry = exports.PropertySyntax = exports.BUILT_IN_PROPERTIES = void 0;
6
+ exports.StyleValueRegistryContribution = exports.StyleValueRegistry = exports.PropertySyntax = exports.BUILT_IN_PROPERTIES = void 0;
7
7
 
8
8
  var _tslib = require("tslib");
9
9
 
@@ -11,7 +11,9 @@ var _manaSyringe = require("mana-syringe");
11
11
 
12
12
  var _glMatrix = require("gl-matrix");
13
13
 
14
- var _services = require("../services");
14
+ var _interfaces = require("../services/aabb/interfaces");
15
+
16
+ var _SceneGraphService = require("../services/SceneGraphService");
15
17
 
16
18
  var _dom = require("../dom");
17
19
 
@@ -431,6 +433,10 @@ var BUILT_IN_PROPERTIES = [{
431
433
  }];
432
434
  exports.BUILT_IN_PROPERTIES = BUILT_IN_PROPERTIES;
433
435
 
436
+ var StyleValueRegistryContribution = _manaSyringe.Syringe.defineToken('StyleValueRegistry');
437
+
438
+ exports.StyleValueRegistryContribution = StyleValueRegistryContribution;
439
+
434
440
  var StyleValueRegistry =
435
441
  /** @class */
436
442
  function () {
@@ -761,7 +767,7 @@ function () {
761
767
  StyleValueRegistry.prototype.updateGeometry = function (object) {
762
768
  var _a;
763
769
 
764
- var geometryUpdaterFactory = _manaSyringe.GlobalContainer.get(_services.GeometryUpdaterFactory);
770
+ var geometryUpdaterFactory = _manaSyringe.GlobalContainer.get(_interfaces.GeometryUpdaterFactory);
765
771
 
766
772
  var geometryUpdater = geometryUpdaterFactory(object.nodeName);
767
773
 
@@ -892,7 +898,7 @@ function () {
892
898
  usedOriginYValue -= (anchor && anchor[1].value || 0) * geometry_1.contentBounds.halfExtents[1] * 2;
893
899
  object.setOrigin(usedOriginXValue, usedOriginYValue);
894
900
  object.emit(_dom.ElementEvent.GEOMETRY_BOUNDS_CHANGED, {});
895
- (0, _services.dirtifyToRoot)(object);
901
+ (0, _SceneGraphService.dirtifyToRoot)(object);
896
902
  }
897
903
  };
898
904
 
@@ -907,7 +913,9 @@ function () {
907
913
  };
908
914
 
909
915
  (0, _tslib.__decorate)([(0, _manaSyringe.postConstruct)(), (0, _tslib.__metadata)("design:type", Function), (0, _tslib.__metadata)("design:paramtypes", []), (0, _tslib.__metadata)("design:returntype", void 0)], StyleValueRegistry.prototype, "init", null);
910
- StyleValueRegistry = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], StyleValueRegistry);
916
+ StyleValueRegistry = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
917
+ token: StyleValueRegistryContribution
918
+ })], StyleValueRegistry);
911
919
  return StyleValueRegistry;
912
920
  }();
913
921
 
@@ -1,4 +1,4 @@
1
- import type { Nested, ParenLess } from '.';
1
+ import type { Nested, ParenLess } from './types';
2
2
  import { CSSStyleValue, CSSStyleValueType } from './CSSStyleValue';
3
3
  /**
4
4
  * CSSKeywordValue represents CSS Values that are specified as keywords
@@ -1,4 +1,4 @@
1
- import type { UnitType } from '.';
1
+ import type { UnitType } from './types';
2
2
  export declare type UnitMap = Record<UnitType, number>;
3
3
  export interface Term {
4
4
  value: number;
@@ -1,7 +1,6 @@
1
- import type { CSSNumericSumValue } from './CSSNumericSumValue';
2
- import type { CSSNumericValueType } from './CSSNumericValueType';
3
- import { CSSStyleValue } from './CSSStyleValue';
4
- import { UnitType, CSSStyleValueType, CSSUnitValue, CSSMathSum } from '.';
1
+ import type { CSSNumericSumValue, UnitMap } from './CSSNumericSumValue';
2
+ import { CSSStyleValue, CSSStyleValueType } from './CSSStyleValue';
3
+ import { Nested, ParenLess, UnitType } from './types';
5
4
  export declare type CSSNumberish = number | CSSNumericValue;
6
5
  declare type CSSNumericBaseType = 'length' | 'angle' | 'time' | 'frequency' | 'resolution' | 'flex' | 'percent';
7
6
  interface CSSNumericType {
@@ -14,6 +13,38 @@ interface CSSNumericType {
14
13
  percent: number;
15
14
  percentHint: CSSNumericBaseType;
16
15
  }
16
+ export declare enum BaseType {
17
+ kLength = 0,
18
+ kAngle = 1,
19
+ kTime = 2,
20
+ kFrequency = 3,
21
+ kResolution = 4,
22
+ kFlex = 5,
23
+ kPercent = 6,
24
+ kNumBaseTypes = 7
25
+ }
26
+ export declare function unitTypeToBaseType(unit: UnitType): BaseType.kLength | BaseType.kAngle | BaseType.kTime | BaseType.kFrequency | BaseType.kResolution | BaseType.kFlex | BaseType.kPercent;
27
+ export declare function baseTypeToString(baseType: BaseType): "" | "percent" | "length" | "angle" | "time" | "frequency" | "resolution" | "flex";
28
+ export declare class CSSNumericValueType {
29
+ private exponents;
30
+ private numNonZeroEntries;
31
+ percentHint: BaseType;
32
+ hasPercentHint: boolean;
33
+ constructor(unit?: UnitType, exponent?: number);
34
+ applyPercentHint(hint: BaseType): void;
35
+ hasNonZeroEntries(): boolean;
36
+ isOnlyNonZeroEntry(baseType: BaseType, value: number): boolean;
37
+ exponent(type: BaseType): number;
38
+ setExponent(type: BaseType, newValue: number): void;
39
+ static negateExponents(type: CSSNumericValueType): CSSNumericValueType;
40
+ matchesBaseType(baseType: BaseType): boolean;
41
+ matchesPercentage(): boolean;
42
+ matchesBaseTypePercentage(baseType: BaseType): boolean;
43
+ matchesNumber(): boolean;
44
+ matchesNumberPercentage(): boolean;
45
+ static add(type1: CSSNumericValueType, type2: CSSNumericValueType, error: boolean): CSSNumericValueType;
46
+ static multiply(type1: CSSNumericValueType, type2: CSSNumericValueType, error: boolean): CSSNumericValueType;
47
+ }
17
48
  /**
18
49
  * CSSNumericValue is the base class for numeric and length typed CSS Values.
19
50
  * @see https://drafts.css-houdini.org/css-typed-om/#numeric-objects
@@ -72,4 +103,110 @@ export declare abstract class CSSNumericValue extends CSSStyleValue {
72
103
  negate(): CSSNumericValue;
73
104
  invert(): CSSNumericValue;
74
105
  }
106
+ /**
107
+ * Represents numeric values that can be expressed as a single number plus a
108
+ * unit (or a naked number or percentage).
109
+ * @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
110
+ */
111
+ export declare class CSSUnitValue extends CSSNumericValue {
112
+ static toCanonicalUnit(unit: UnitType): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;
113
+ static toCanonicalUnitIfPossible(unit: UnitType): UnitType;
114
+ static formatInfinityOrNaN(number: number, suffix?: string): string;
115
+ static formatNumber(number: number, suffix?: string): string;
116
+ unit: UnitType;
117
+ value: number;
118
+ constructor(value: number, unitOrName?: UnitType | string);
119
+ clone(): CSSUnitValue;
120
+ convertTo(target_unit: UnitType): CSSUnitValue;
121
+ equals(other: CSSNumericValue): boolean;
122
+ getType(): CSSStyleValueType;
123
+ sumValue(): CSSNumericSumValue;
124
+ negate(): CSSUnitValue;
125
+ invert(): CSSUnitValue | CSSMathInvert;
126
+ buildCSSText(n: Nested, p: ParenLess, result: string): string;
127
+ }
128
+ /**
129
+ * The CSSMathValue interface of the CSS_Object_Model a base class for classes representing complex numeric values.
130
+ *
131
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
132
+ * @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
133
+ */
134
+ export declare abstract class CSSMathValue extends CSSNumericValue {
135
+ abstract operator: string;
136
+ isUnitValue(): boolean;
137
+ }
138
+ export declare class CSSMathInvert extends CSSMathValue {
139
+ private value;
140
+ static create(value: CSSNumericValue): CSSMathInvert;
141
+ constructor(value: CSSNumericValue, type: CSSNumericValueType);
142
+ operator: string;
143
+ clone(): CSSMathInvert;
144
+ getType(): CSSStyleValueType;
145
+ equals(other: CSSNumericValue): any;
146
+ sumValue(): CSSNumericSumValue;
147
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
148
+ }
149
+ export declare class CSSMathNegate extends CSSMathValue {
150
+ value: CSSNumericValue;
151
+ static create(value: CSSNumericValue): CSSMathNegate;
152
+ constructor(value: CSSNumericValue, type: CSSNumericValueType);
153
+ operator: string;
154
+ clone(): CSSMathNegate;
155
+ getType(): CSSStyleValueType;
156
+ equals(other: CSSNumericValue): any;
157
+ sumValue(): CSSNumericSumValue;
158
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
159
+ }
160
+ export declare function typeCheck(values: CSSNumericValue[], op: Function, error: boolean): CSSNumericValueType;
161
+ export declare abstract class CSSMathVariadic extends CSSMathValue {
162
+ values: CSSNumericValue[];
163
+ constructor(values: CSSNumericValue[], type: CSSNumericValueType);
164
+ numericValues(): CSSNumericValue[];
165
+ equals(other: CSSNumericValue): any;
166
+ }
167
+ export declare class CSSMathMin extends CSSMathVariadic {
168
+ static create(values: CSSNumericValue[]): CSSMathMin;
169
+ operator: string;
170
+ clone(): CSSMathMin;
171
+ getType(): CSSStyleValueType;
172
+ sumValue(): CSSNumericSumValue;
173
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
174
+ }
175
+ export declare class CSSMathMax extends CSSMathVariadic {
176
+ static create(values: CSSNumericValue[]): CSSMathMax;
177
+ operator: string;
178
+ clone(): CSSMathMax;
179
+ getType(): CSSStyleValueType;
180
+ sumValue(): CSSNumericSumValue;
181
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
182
+ }
183
+ /**
184
+ * Represents the sum of one or more CSSNumericValues.
185
+ * @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
186
+ */
187
+ export declare class CSSMathSum extends CSSMathVariadic {
188
+ static create(values: CSSNumericValue[]): CSSMathSum;
189
+ static numericTypeFromUnitMap(units: UnitMap): CSSNumericValueType;
190
+ static canCreateNumericTypeFromSumValue(sum: CSSNumericSumValue): boolean;
191
+ operator: string;
192
+ clone(): CSSMathSum;
193
+ getType(): CSSStyleValueType;
194
+ sumValue(): CSSNumericSumValue;
195
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
196
+ }
197
+ /**
198
+ * Represents the product of one or more CSSNumericValues.
199
+ * @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
200
+ */
201
+ export declare class CSSMathProduct extends CSSMathVariadic {
202
+ static create(values: CSSNumericValue[]): CSSMathProduct;
203
+ static multiplyUnitMaps(a: UnitMap, b: UnitMap): UnitMap;
204
+ operator: string;
205
+ clone(): CSSMathProduct;
206
+ getType(): CSSStyleValueType;
207
+ sumValue(): CSSNumericSumValue;
208
+ buildCSSText(nested: Nested, paren_less: ParenLess, result: string): string;
209
+ }
210
+ export declare const Opx: CSSUnitValue;
211
+ export declare const Odeg: CSSUnitValue;
75
212
  export {};