cache.d.ts 918 B

123456789101112131415161718192021222324252627
  1. import { Dictionary, JSONObject } from '@antv/x6-common';
  2. import { Line, Rectangle, Ellipse, Polyline, Path, Segment } from '@antv/x6-geometry';
  3. import { CellView } from './cell';
  4. export declare class Cache {
  5. protected view: CellView;
  6. protected elemCache: Dictionary<Element, Cache.Item>;
  7. pathCache: {
  8. data?: string;
  9. length?: number;
  10. segmentSubdivisions?: Segment[][];
  11. };
  12. constructor(view: CellView);
  13. clean(): void;
  14. get(elem: Element): Cache.Item;
  15. getData(elem: Element): JSONObject;
  16. getMatrix(elem: Element): DOMMatrix;
  17. getShape(elem: Element): Path | Rectangle | Line | Polyline | Ellipse;
  18. getBoundingRect(elem: Element): Rectangle;
  19. }
  20. export declare namespace Cache {
  21. interface Item {
  22. data?: JSONObject;
  23. matrix?: DOMMatrix;
  24. boundingRect?: Rectangle;
  25. shape?: Rectangle | Ellipse | Polyline | Path | Line;
  26. }
  27. }