helper.d.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { MatrixArray } from '../core/matrix';
  2. import Transformable, { TransformProp } from '../core/Transformable';
  3. import Displayable from '../graphic/Displayable';
  4. import { GradientObject } from '../graphic/Gradient';
  5. import { LinearGradientObject } from '../graphic/LinearGradient';
  6. import Path from '../graphic/Path';
  7. import { ImagePatternObject, PatternObject, SVGPatternObject } from '../graphic/Pattern';
  8. import { RadialGradientObject } from '../graphic/RadialGradient';
  9. export declare function normalizeColor(color: string): {
  10. color: string;
  11. opacity: number;
  12. };
  13. export declare function isAroundZero(transform: number): boolean;
  14. export declare function round3(transform: number): number;
  15. export declare function round4(transform: number): number;
  16. export declare function round1(transform: number): number;
  17. export declare function getMatrixStr(m: MatrixArray): string;
  18. export declare const TEXT_ALIGN_TO_ANCHOR: {
  19. left: string;
  20. right: string;
  21. center: string;
  22. middle: string;
  23. };
  24. export declare function adjustTextY(y: number, lineHeight: number, textBaseline: CanvasTextBaseline): number;
  25. export declare function hasShadow(style: Displayable['style']): any;
  26. export declare function getShadowKey(displayable: Displayable): string;
  27. export declare function getClipPathsKey(clipPaths: Path[]): string;
  28. export declare function isImagePattern(val: any): val is ImagePatternObject;
  29. export declare function isSVGPattern(val: any): val is SVGPatternObject;
  30. export declare function isPattern(val: any): val is PatternObject;
  31. export declare function isLinearGradient(val: GradientObject): val is LinearGradientObject;
  32. export declare function isRadialGradient(val: GradientObject): val is RadialGradientObject;
  33. export declare function isGradient(val: any): val is GradientObject;
  34. export declare function getIdURL(id: string): string;
  35. export declare function getPathPrecision(el: Path): number;
  36. export declare function getSRTTransformString(transform: Partial<Pick<Transformable, TransformProp>>): string;
  37. export declare const encodeBase64: (str: string) => string;