@antv/g-lite 2.0.8 → 2.0.10-alpha.0

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/dist/Canvas.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="webxr" />
2
1
  import type { IRenderer } from './AbstractRenderer';
3
2
  import { DisplayObject } from './display-objects/DisplayObject';
4
3
  import type { CanvasContext, IChildNode } from './dom';
@@ -8,4 +8,4 @@ export declare enum CSSMathOperator {
8
8
  kClamp = "clamp",
9
9
  kInvalid = ""
10
10
  }
11
- export declare function isComparison(op: CSSMathOperator): boolean;
11
+ export declare function isComparison(op: CSSMathOperator): op is CSSMathOperator.kMin | CSSMathOperator.kMax | CSSMathOperator.kClamp;
@@ -24,5 +24,4 @@ export declare class CSSUnitValue extends CSSStyleValue {
24
24
  buildCSSText(n: Nested, p: ParenLess, result: string): string;
25
25
  }
26
26
  export declare const Opx: CSSUnitValue;
27
- export declare const Lpx: CSSUnitValue;
28
27
  export declare const Odeg: CSSUnitValue;
@@ -33,10 +33,10 @@ export declare const unitTypeToString: (type: UnitType) => "" | "em" | "px" | "d
33
33
  * Docs @see https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleValue
34
34
  */
35
35
  export declare abstract class CSSStyleValue {
36
- static isAngle(unit: UnitType): boolean;
36
+ static isAngle(unit: UnitType): unit is UnitType.kDegrees | UnitType.kRadians | UnitType.kGradians | UnitType.kTurns;
37
37
  static isLength(type: UnitType): boolean;
38
- static isRelativeUnit(type: UnitType): boolean;
39
- static isTime(unit: UnitType): boolean;
38
+ static isRelativeUnit(type: UnitType): type is UnitType.kPercentage | UnitType.kEms | UnitType.kRems;
39
+ static isTime(unit: UnitType): unit is UnitType.kMilliseconds | UnitType.kSeconds;
40
40
  protected abstract getType(): CSSStyleValueType;
41
41
  abstract buildCSSText(n: Nested, p: ParenLess, result: string): string;
42
42
  abstract clone(): CSSStyleValue;
@@ -1,5 +1,6 @@
1
1
  import type { DisplayObject } from '../../display-objects';
2
2
  import { CSSUnitValue } from '../cssom';
3
+ import type { TransformArray } from '../../types';
3
4
  export interface ParsedTransform {
4
5
  t: string;
5
6
  d: CSSUnitValue[];
@@ -9,8 +10,8 @@ export interface ParsedTransform {
9
10
  * scale(1) scale(1, 2)
10
11
  * scaleX(1)
11
12
  */
12
- export declare function parseTransform(string: string): ParsedTransform[];
13
- export declare function parseTransformUnmemoize(string: string): ParsedTransform[];
13
+ export declare function parseTransform(transform: string | TransformArray): ParsedTransform[];
14
+ export declare function parseTransformUnmemoize(transform: string | TransformArray): ParsedTransform[];
14
15
  export declare function convertItemToMatrix(item: ParsedTransform): number[];
15
16
  export declare const composeMatrix: (translate: any, scale: any, skew: any, quat: any, perspective: any) => number[];
16
17
  export declare function mergeTransforms(left: ParsedTransform[], right: ParsedTransform[], target: DisplayObject | null): [number[][], number[][], (d: number[][]) => string];
@@ -1,5 +1,5 @@
1
1
  import type { DisplayObjectConfig } from '../dom';
2
- import { AABB, Rectangle } from '../shapes';
2
+ import { AABB } from '../shapes';
3
3
  import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
4
4
  import { DisplayObject } from './DisplayObject';
5
5
  export interface HTMLStyleProps extends BaseStyleProps {
@@ -32,9 +32,9 @@ export declare class HTML extends DisplayObject<HTMLStyleProps, ParsedHTMLStyleP
32
32
  /**
33
33
  * override with $el.getBoundingClientRect
34
34
  * @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
35
+ *
36
+ * ! The calculation logic of the html element should be consistent with that of the canvas element
35
37
  */
36
- getBoundingClientRect(): Rectangle;
37
- getClientRects(): Rectangle[];
38
- getBounds(): AABB;
38
+ getClientRects(): import("../shapes").Rectangle[];
39
39
  getLocalBounds(): AABB;
40
40
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import './preset';
1
2
  import RBush from 'rbush/rbush.js';
2
3
  export * from './AbstractRenderer';
3
4
  export * from './Canvas';