LayoutObject.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import type { CSSStyleValue, ParsedBaseStyleProps } from '@antv/g-lite';
  2. import type { LayoutFragment } from './LayoutFragment';
  3. import type { IntrinsicSizes, MeasureFn } from './types';
  4. interface LayoutObjectIntrinsicSizes {
  5. minContentInlineSize: number;
  6. minContentBlockSize: number;
  7. maxContentInlineSize: number;
  8. maxContentBlockSize: number;
  9. }
  10. export declare class LayoutObject {
  11. private id;
  12. private style;
  13. private dirty;
  14. parent?: LayoutObject;
  15. children: LayoutObject[];
  16. private internalIntrisicSizes?;
  17. private computedLayout?;
  18. get intrisicSizes(): LayoutObjectIntrinsicSizes;
  19. get childCount(): number;
  20. private measureFn?;
  21. constructor(style?: Map<string, any>);
  22. /**
  23. * set the intrinsic size of leaf node, different basic shape has different size, compsed shape has
  24. * @param measure measure function
  25. */
  26. setMeasure(measure: MeasureFn): void;
  27. setIntrisicSizes(intrisicSizes: IntrinsicSizes): void;
  28. addChild(child: LayoutObject): void;
  29. insertChild(index: number, child: LayoutObject): void;
  30. removeChild(child: LayoutObject): void;
  31. removeChildAtIndex(index: number): void;
  32. replaceChildAtIndex(index: number, child: LayoutObject): void;
  33. setStyle(property: keyof ParsedBaseStyleProps, value: CSSStyleValue): void;
  34. getStyle(...properties: string[]): Map<any, any>;
  35. getAllStyle(): Map<string, any>;
  36. markDirty(): void;
  37. idDirty(): boolean;
  38. private getSize;
  39. computeLayout(): Promise<void>;
  40. setComputedLayout(computedLayout: LayoutFragment): void;
  41. getComputedLayout(): LayoutFragment<void>;
  42. getAllComputedLayout(): void;
  43. toString(): string;
  44. }
  45. export {};
  46. //# sourceMappingURL=LayoutObject.d.ts.map