morphPath.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Path from '../graphic/Path';
  2. import Element, { ElementAnimateConfig } from '../Element';
  3. import { split } from './dividePath';
  4. export declare function alignBezierCurves(array1: number[][], array2: number[][]): number[][][];
  5. export interface CombineMorphingPath extends Path {
  6. childrenRef(): (CombineMorphingPath | Path)[];
  7. __isCombineMorphing: boolean;
  8. }
  9. export declare function centroid(array: number[]): number[];
  10. export declare function isCombineMorphing(path: Element): path is CombineMorphingPath;
  11. export declare function isMorphing(el: Element): boolean;
  12. export declare function morphPath(fromPath: Path, toPath: Path, animationOpts: ElementAnimateConfig): Path;
  13. export interface DividePathParams {
  14. path: Path;
  15. count: number;
  16. }
  17. export interface DividePath {
  18. (params: DividePathParams): Path[];
  19. }
  20. export interface IndividualDelay {
  21. (index: number, count: number, fromPath: Path, toPath: Path): number;
  22. }
  23. export interface CombineConfig extends ElementAnimateConfig {
  24. dividePath?: DividePath;
  25. individualDelay?: IndividualDelay;
  26. }
  27. export declare function combineMorph(fromList: (CombineMorphingPath | Path)[], toPath: Path, animationOpts: CombineConfig): {
  28. fromIndividuals: Path<import("../graphic/Path").PathProps>[];
  29. toIndividuals: Path<import("../graphic/Path").PathProps>[];
  30. count: number;
  31. };
  32. export interface SeparateConfig extends ElementAnimateConfig {
  33. dividePath?: DividePath;
  34. individualDelay?: IndividualDelay;
  35. }
  36. export declare function separateMorph(fromPath: Path, toPathList: Path[], animationOpts: SeparateConfig): {
  37. fromIndividuals: Path<import("../graphic/Path").PathProps>[];
  38. toIndividuals: Path<import("../graphic/Path").PathProps>[];
  39. count: number;
  40. };
  41. export { split as defaultDividePath };