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

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 +139 -4
  5. package/es/css/cssom/CSSNumericValue.js +1164 -5
  6. package/es/css/cssom/CSSTransformValue.d.ts +1 -1
  7. package/es/css/cssom/index.d.ts +0 -10
  8. package/es/css/cssom/index.js +1 -11
  9. package/lib/css/cssom/CSSKeywordValue.d.ts +1 -1
  10. package/lib/css/cssom/CSSNumericSumValue.d.ts +1 -1
  11. package/lib/css/cssom/CSSNumericValue.d.ts +139 -4
  12. package/lib/css/cssom/CSSNumericValue.js +1222 -52
  13. package/lib/css/cssom/CSSTransformValue.d.ts +1 -1
  14. package/lib/css/cssom/index.d.ts +0 -10
  15. package/lib/css/cssom/index.js +0 -130
  16. package/package.json +3 -3
  17. package/es/css/cssom/CSSMathInvert.d.ts +0 -14
  18. package/es/css/cssom/CSSMathInvert.js +0 -84
  19. package/es/css/cssom/CSSMathMax.d.ts +0 -17
  20. package/es/css/cssom/CSSMathMax.js +0 -118
  21. package/es/css/cssom/CSSMathMin.d.ts +0 -17
  22. package/es/css/cssom/CSSMathMin.js +0 -119
  23. package/es/css/cssom/CSSMathNegate.d.ts +0 -14
  24. package/es/css/cssom/CSSMathNegate.js +0 -80
  25. package/es/css/cssom/CSSMathProduct.d.ts +0 -16
  26. package/es/css/cssom/CSSMathProduct.js +0 -109
  27. package/es/css/cssom/CSSMathSum.d.ts +0 -17
  28. package/es/css/cssom/CSSMathSum.js +0 -117
  29. package/es/css/cssom/CSSMathValue.d.ts +0 -11
  30. package/es/css/cssom/CSSMathValue.js +0 -27
  31. package/es/css/cssom/CSSMathVariadic.d.ts +0 -9
  32. package/es/css/cssom/CSSMathVariadic.js +0 -44
  33. package/es/css/cssom/CSSNumericValueType.d.ts +0 -33
  34. package/es/css/cssom/CSSNumericValueType.js +0 -259
  35. package/es/css/cssom/CSSUnitValue.d.ts +0 -33
  36. package/es/css/cssom/CSSUnitValue.js +0 -252
  37. package/lib/css/cssom/CSSMathInvert.d.ts +0 -14
  38. package/lib/css/cssom/CSSMathInvert.js +0 -94
  39. package/lib/css/cssom/CSSMathMax.d.ts +0 -17
  40. package/lib/css/cssom/CSSMathMax.js +0 -128
  41. package/lib/css/cssom/CSSMathMin.d.ts +0 -17
  42. package/lib/css/cssom/CSSMathMin.js +0 -128
  43. package/lib/css/cssom/CSSMathNegate.d.ts +0 -14
  44. package/lib/css/cssom/CSSMathNegate.js +0 -89
  45. package/lib/css/cssom/CSSMathProduct.d.ts +0 -16
  46. package/lib/css/cssom/CSSMathProduct.js +0 -119
  47. package/lib/css/cssom/CSSMathSum.d.ts +0 -17
  48. package/lib/css/cssom/CSSMathSum.js +0 -129
  49. package/lib/css/cssom/CSSMathValue.d.ts +0 -11
  50. package/lib/css/cssom/CSSMathValue.js +0 -35
  51. package/lib/css/cssom/CSSMathVariadic.d.ts +0 -9
  52. package/lib/css/cssom/CSSMathVariadic.js +0 -55
  53. package/lib/css/cssom/CSSNumericValueType.d.ts +0 -33
  54. package/lib/css/cssom/CSSNumericValueType.js +0 -272
  55. package/lib/css/cssom/CSSUnitValue.d.ts +0 -33
  56. package/lib/css/cssom/CSSUnitValue.js +0 -267
@@ -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,108 @@ 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
+ }
75
210
  export {};