Transformable.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import * as matrix from './matrix';
  2. import * as vector from './vector';
  3. declare class Transformable {
  4. parent: Transformable;
  5. x: number;
  6. y: number;
  7. scaleX: number;
  8. scaleY: number;
  9. skewX: number;
  10. skewY: number;
  11. rotation: number;
  12. anchorX: number;
  13. anchorY: number;
  14. originX: number;
  15. originY: number;
  16. globalScaleRatio: number;
  17. transform: matrix.MatrixArray;
  18. invTransform: matrix.MatrixArray;
  19. getLocalTransform(m?: matrix.MatrixArray): matrix.MatrixArray;
  20. setPosition(arr: number[]): void;
  21. setScale(arr: number[]): void;
  22. setSkew(arr: number[]): void;
  23. setOrigin(arr: number[]): void;
  24. needLocalTransform(): boolean;
  25. updateTransform(): void;
  26. private _resolveGlobalScaleRatio;
  27. getComputedTransform(): matrix.MatrixArray;
  28. setLocalTransform(m: vector.VectorArray): void;
  29. decomposeTransform(): void;
  30. getGlobalScale(out?: vector.VectorArray): vector.VectorArray;
  31. transformCoordToLocal(x: number, y: number): number[];
  32. transformCoordToGlobal(x: number, y: number): number[];
  33. getLineScale(): number;
  34. copyTransform(source: Transformable): void;
  35. static getLocalTransform(target: Transformable, m?: matrix.MatrixArray): matrix.MatrixArray;
  36. private static initDefaultProps;
  37. }
  38. export declare const TRANSFORMABLE_PROPS: readonly ["x", "y", "originX", "originY", "anchorX", "anchorY", "rotation", "scaleX", "scaleY", "skewX", "skewY"];
  39. export declare type TransformProp = (typeof TRANSFORMABLE_PROPS)[number];
  40. export declare function copyTransform(target: Partial<Pick<Transformable, TransformProp>>, source: Pick<Transformable, TransformProp>): void;
  41. export default Transformable;