LayoutEngine.d.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { LayoutRegistry } from '@antv/g-lite';
  2. import type { LayoutContextFactory } from './LayoutContext';
  3. import type { LayoutEdgesFactory } from './LayoutEdges';
  4. import type { LayoutFragmentOptions } from './LayoutFragment';
  5. import type { LayoutObject } from './LayoutObject';
  6. import type { LayoutWorkTask } from './LayoutWorkTask';
  7. import type { IntrinsicSizes, LayoutConstraints } from './types';
  8. export declare class LayoutEngine {
  9. protected readonly _layoutRegistry: LayoutRegistry;
  10. protected readonly _layoutContextFactory: LayoutContextFactory;
  11. protected readonly _layoutEdgesFactory: LayoutEdgesFactory;
  12. protected layoutRegistry: LayoutRegistry;
  13. protected layoutContextFactory: LayoutContextFactory;
  14. protected layoutEdgesFactory: LayoutEdgesFactory;
  15. constructor(_layoutRegistry: LayoutRegistry, _layoutContextFactory: LayoutContextFactory, _layoutEdgesFactory: LayoutEdgesFactory);
  16. /**
  17. * This function takes the root of the box-tree, a LayoutConstraints object, and compute the position of every node in the tree
  18. * @param rootNode root node of the layout object tree
  19. * @param rootPageConstraints layout constraints
  20. * @returns
  21. */
  22. computeLayout(rootNode: LayoutObject, rootPageConstraints: LayoutConstraints): Promise<void>;
  23. /**
  24. * calculate intrinsicSize of node tree, use depth dirst / post order traversal
  25. * @param rootNode
  26. */
  27. determineAllIntrinsicSizes(rootNode: LayoutObject): Promise<void>;
  28. protected getLayoutDefinitionName(node: LayoutObject): any;
  29. /**
  30. * calculate the min/max content size of node
  31. * @param node current layout object
  32. * @param childNodes children of the current node
  33. */
  34. protected determineIntrinsicSizes(node: LayoutObject, childNodes: LayoutObject[]): Promise<void>;
  35. protected invokeIntrinsicSizesCallback(layoutName: string, node: LayoutObject, childNodes: LayoutObject[]): Promise<void>;
  36. protected calculateLayout(node: LayoutObject, childNodes: LayoutObject[], layoutConstraints: LayoutConstraints): Promise<void>;
  37. protected invokeLayoutCallback(layoutName: string, node: LayoutObject, childNodes: LayoutObject[], layoutConstraints: LayoutConstraints): Promise<void>;
  38. protected runWorkQueue<T>(promise: Promise<T>, workQueue: LayoutWorkTask[]): Generator<any, T, any>;
  39. protected getNodeIntrisicSizes(node: LayoutObject): IntrinsicSizes;
  40. protected getNodeFragment(node: LayoutObject, constraints: LayoutConstraints): LayoutFragmentOptions;
  41. }
  42. //# sourceMappingURL=LayoutEngine.d.ts.map