UNPKG

2.51 kBTypeScriptView Raw
1import type { LayoutObject } from './LayoutObject';
2import { LayoutRegistry } from './LayoutRegistry';
3import type { IntrinsicSizes, LayoutConstraints } from './types';
4import { LayoutContextFactory } from './LayoutContext';
5import { LayoutEdgesFactory } from './LayoutEdges';
6import type { LayoutWorkTask } from './LayoutWorkTask';
7import type { LayoutFragmentOptions } from './LayoutFragment';
8export 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}