attr.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { Dictionary } from '@antv/x6-common';
  2. import { Rectangle } from '@antv/x6-geometry';
  3. import { Attr } from '../registry/attr';
  4. import { Markup } from './markup';
  5. import { CellView } from './cell';
  6. export declare class AttrManager {
  7. protected view: CellView;
  8. constructor(view: CellView);
  9. protected get cell(): import("..").Cell<import("..").Cell.Properties>;
  10. protected getDefinition(attrName: string): Attr.Definition | null;
  11. protected processAttrs(elem: Element, raw: Attr.ComplexAttrs): AttrManager.ProcessedAttrs;
  12. protected mergeProcessedAttrs(allProcessedAttrs: AttrManager.ProcessedAttrs, roProcessedAttrs: AttrManager.ProcessedAttrs): void;
  13. protected findAttrs(cellAttrs: Attr.CellAttrs, rootNode: Element, selectorCache: {
  14. [selector: string]: Element[];
  15. }, selectors: Markup.Selectors): Dictionary<Element, {
  16. elem: Element;
  17. array: boolean;
  18. priority: number | number[];
  19. attrs: Attr.ComplexAttrs;
  20. }>;
  21. protected updateRelativeAttrs(elem: Element, processedAttrs: AttrManager.ProcessedAttrs, refBBox: Rectangle): void;
  22. update(rootNode: Element, attrs: Attr.CellAttrs, options: AttrManager.UpdateOptions): void;
  23. }
  24. export declare namespace AttrManager {
  25. interface UpdateOptions {
  26. rootBBox: Rectangle;
  27. selectors: Markup.Selectors;
  28. scalableNode?: Element | null;
  29. rotatableNode?: Element | null;
  30. /**
  31. * Rendering only the specified attributes.
  32. */
  33. attrs?: Attr.CellAttrs | null;
  34. }
  35. interface ProcessedAttrs {
  36. raw: Attr.ComplexAttrs;
  37. normal?: Attr.SimpleAttrs | undefined;
  38. set?: Attr.ComplexAttrs | undefined;
  39. offset?: Attr.ComplexAttrs | undefined;
  40. position?: Attr.ComplexAttrs | undefined;
  41. }
  42. }