dimension.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import type { DisplayObject } from '../../display-objects';
  2. import type { IElement } from '../../dom';
  3. import type { CSSStyleValue } from '../cssom';
  4. import { CSSUnitValue } from '../cssom';
  5. export declare function parseDimension(unitRegExp: RegExp, string: string): CSSStyleValue | undefined;
  6. /**
  7. * <length>
  8. * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/length
  9. * length with only absolute unit, eg. 1px
  10. */
  11. export declare const parseLength: {
  12. (...args: any[]): any;
  13. cache: Map<any, any>;
  14. };
  15. /**
  16. * <percentage>
  17. * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/percentage
  18. */
  19. export declare const parserPercentage: {
  20. (...args: any[]): any;
  21. cache: Map<any, any>;
  22. };
  23. /**
  24. * length with absolute or relative unit,
  25. * eg. 1px, 0.7em, 50%, calc(100% - 200px);
  26. *
  27. * @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/length-percentage
  28. */
  29. export declare const parseLengthOrPercentage: (css: string) => CSSUnitValue;
  30. export declare const parseAngle: {
  31. (...args: any[]): any;
  32. cache: Map<any, any>;
  33. };
  34. /**
  35. * merge CSSUnitValue
  36. *
  37. * @example
  38. * 10px + 20px = 30px
  39. * 10deg + 10rad
  40. * 10% + 20% = 30%
  41. */
  42. export declare function mergeDimensions(left: CSSUnitValue, right: CSSUnitValue, target: IElement, nonNegative?: boolean, index?: number): [number, number, (value: number) => string];
  43. export declare function convertAngleUnit(value: CSSUnitValue): number;
  44. export declare function parseDimensionArrayFormat(string: string | number | (string | number)[], size: number): number[];
  45. export declare function parseDimensionArray(string: string | (string | number)[]): CSSUnitValue[];
  46. export declare function convertPercentUnit(valueWithUnit: CSSUnitValue, vec3Index: number, target: DisplayObject): number;
  47. //# sourceMappingURL=dimension.d.ts.map