@antv/g 5.0.23-alpha.8 → 5.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/index.umd.min.js +4 -3
  2. package/es/AbstractRenderer.d.ts +11 -0
  3. package/es/AbstractRenderer.js +17 -2
  4. package/es/Canvas.d.ts +1 -1
  5. package/es/css/CSS.d.ts +2 -1
  6. package/es/css/CSS.js +6 -2
  7. package/es/css/CSSProperty.d.ts +1 -1
  8. package/es/css/StyleValueRegistry.d.ts +2 -1
  9. package/es/css/StyleValueRegistry.js +34 -25
  10. package/es/css/cssom/CSSNumericValue.js +1 -1
  11. package/es/css/index.d.ts +2 -1
  12. package/es/css/index.js +2 -1
  13. package/es/css/interfaces.d.ts +6 -0
  14. package/es/css/interfaces.js +2 -0
  15. package/es/css/layout/FragmentResult.d.ts +32 -0
  16. package/es/css/layout/FragmentResult.js +32 -0
  17. package/es/css/layout/LayoutChildren.d.ts +23 -0
  18. package/es/css/layout/LayoutChildren.js +55 -0
  19. package/es/css/layout/LayoutContext.d.ts +35 -0
  20. package/es/css/layout/LayoutContext.js +35 -0
  21. package/es/css/layout/LayoutDefinition.d.ts +20 -0
  22. package/es/css/layout/LayoutDefinition.js +9 -0
  23. package/es/css/layout/LayoutEdges.d.ts +24 -0
  24. package/es/css/layout/LayoutEdges.js +41 -0
  25. package/es/css/layout/LayoutEngine.d.ts +41 -0
  26. package/es/css/layout/LayoutEngine.js +332 -0
  27. package/es/css/layout/LayoutFragment.d.ts +26 -0
  28. package/es/css/layout/LayoutFragment.js +28 -0
  29. package/es/css/layout/LayoutObject.d.ts +46 -0
  30. package/es/css/layout/LayoutObject.js +172 -0
  31. package/es/css/layout/LayoutRegistry.d.ts +16 -0
  32. package/es/css/layout/LayoutRegistry.js +78 -0
  33. package/es/css/layout/LayoutWorkTask.d.ts +14 -0
  34. package/es/css/layout/LayoutWorkTask.js +1 -0
  35. package/es/css/layout/index.d.ts +11 -0
  36. package/es/css/layout/index.js +11 -0
  37. package/es/css/layout/types.d.ts +104 -0
  38. package/es/css/layout/types.js +66 -0
  39. package/es/css/parser/numeric.d.ts +1 -1
  40. package/es/css/parser/numeric.js +1 -1
  41. package/es/css/parser/transform.js +5 -4
  42. package/es/css/properties/CSSPropertyColor.d.ts +1 -1
  43. package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -1
  44. package/es/display-objects/DisplayObject.d.ts +1 -2
  45. package/es/display-objects/DisplayObject.js +2 -1
  46. package/es/dom/Document.js +2 -2
  47. package/es/global-module.js +91 -8
  48. package/es/index.d.ts +3 -0
  49. package/es/index.js +3 -0
  50. package/es/plugins/CullingPlugin.d.ts +1 -0
  51. package/es/plugins/CullingPlugin.js +8 -3
  52. package/es/plugins/DirtyCheckPlugin.d.ts +1 -0
  53. package/es/plugins/DirtyCheckPlugin.js +7 -2
  54. package/es/plugins/EventPlugin.d.ts +1 -0
  55. package/es/plugins/EventPlugin.js +14 -9
  56. package/es/plugins/PrepareRendererPlugin.d.ts +1 -0
  57. package/es/plugins/PrepareRendererPlugin.js +10 -5
  58. package/es/services/EventService.js +4 -8
  59. package/es/services/OffscreenCanvasCreator.d.ts +1 -1
  60. package/es/services/OffscreenCanvasCreator.js +1 -1
  61. package/es/services/RenderingService.d.ts +18 -18
  62. package/es/services/RenderingService.js +26 -23
  63. package/es/services/SceneGraphService.js +3 -1
  64. package/es/types.d.ts +7 -5
  65. package/es/utils/deferred.d.ts +43 -0
  66. package/es/utils/deferred.js +117 -0
  67. package/es/utils/dom.d.ts +2 -0
  68. package/es/utils/dom.js +8 -0
  69. package/es/utils/index.d.ts +2 -1
  70. package/es/utils/index.js +2 -1
  71. package/es/utils/interpolation.js +1 -1
  72. package/lib/AbstractRenderer.d.ts +11 -0
  73. package/lib/AbstractRenderer.js +17 -2
  74. package/lib/Canvas.d.ts +1 -1
  75. package/lib/css/CSS.d.ts +2 -1
  76. package/lib/css/CSS.js +9 -3
  77. package/lib/css/CSSProperty.d.ts +1 -1
  78. package/lib/css/StyleValueRegistry.d.ts +2 -1
  79. package/lib/css/StyleValueRegistry.js +39 -27
  80. package/lib/css/cssom/CSSNumericValue.js +17 -17
  81. package/lib/css/index.d.ts +2 -1
  82. package/lib/css/index.js +25 -12
  83. package/lib/css/interfaces.d.ts +6 -0
  84. package/lib/css/interfaces.js +12 -0
  85. package/lib/css/layout/FragmentResult.d.ts +32 -0
  86. package/lib/css/layout/FragmentResult.js +51 -0
  87. package/lib/css/layout/LayoutChildren.d.ts +23 -0
  88. package/lib/css/layout/LayoutChildren.js +72 -0
  89. package/lib/css/layout/LayoutContext.d.ts +35 -0
  90. package/lib/css/layout/LayoutContext.js +49 -0
  91. package/lib/css/layout/LayoutDefinition.d.ts +20 -0
  92. package/lib/css/layout/LayoutDefinition.js +16 -0
  93. package/lib/css/layout/LayoutEdges.d.ts +24 -0
  94. package/lib/css/layout/LayoutEdges.js +56 -0
  95. package/lib/css/layout/LayoutEngine.d.ts +41 -0
  96. package/lib/css/layout/LayoutEngine.js +345 -0
  97. package/lib/css/layout/LayoutFragment.d.ts +26 -0
  98. package/lib/css/layout/LayoutFragment.js +44 -0
  99. package/lib/css/layout/LayoutObject.d.ts +46 -0
  100. package/lib/css/layout/LayoutObject.js +182 -0
  101. package/lib/css/layout/LayoutRegistry.d.ts +16 -0
  102. package/lib/css/layout/LayoutRegistry.js +87 -0
  103. package/lib/css/layout/LayoutWorkTask.d.ts +14 -0
  104. package/lib/css/layout/LayoutWorkTask.js +5 -0
  105. package/lib/css/layout/index.d.ts +11 -0
  106. package/lib/css/layout/index.js +148 -0
  107. package/lib/css/layout/types.d.ts +104 -0
  108. package/lib/css/layout/types.js +74 -0
  109. package/lib/css/parser/numeric.d.ts +1 -1
  110. package/lib/css/parser/numeric.js +4 -4
  111. package/lib/css/parser/transform.js +6 -4
  112. package/lib/css/properties/CSSPropertyColor.d.ts +1 -1
  113. package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -1
  114. package/lib/display-objects/DisplayObject.d.ts +1 -2
  115. package/lib/display-objects/DisplayObject.js +3 -2
  116. package/lib/dom/Document.js +2 -2
  117. package/lib/global-module.js +91 -6
  118. package/lib/index.d.ts +3 -0
  119. package/lib/index.js +7 -2
  120. package/lib/plugins/CullingPlugin.d.ts +1 -0
  121. package/lib/plugins/CullingPlugin.js +7 -3
  122. package/lib/plugins/DirtyCheckPlugin.d.ts +1 -0
  123. package/lib/plugins/DirtyCheckPlugin.js +6 -2
  124. package/lib/plugins/EventPlugin.d.ts +1 -0
  125. package/lib/plugins/EventPlugin.js +13 -9
  126. package/lib/plugins/PrepareRendererPlugin.d.ts +1 -0
  127. package/lib/plugins/PrepareRendererPlugin.js +9 -5
  128. package/lib/services/EventService.js +4 -8
  129. package/lib/services/OffscreenCanvasCreator.d.ts +1 -1
  130. package/lib/services/OffscreenCanvasCreator.js +1 -1
  131. package/lib/services/RenderingService.d.ts +18 -18
  132. package/lib/services/RenderingService.js +26 -23
  133. package/lib/services/SceneGraphService.js +3 -1
  134. package/lib/types.d.ts +7 -5
  135. package/lib/utils/deferred.d.ts +43 -0
  136. package/lib/utils/deferred.js +131 -0
  137. package/lib/utils/dom.d.ts +2 -0
  138. package/lib/utils/dom.js +17 -0
  139. package/lib/utils/index.d.ts +2 -1
  140. package/lib/utils/index.js +17 -4
  141. package/lib/utils/interpolation.js +2 -2
  142. package/package.json +4 -3
  143. package/es/css/LayoutRegistry.d.ts +0 -11
  144. package/es/css/LayoutRegistry.js +0 -22
  145. package/es/utils/hooks.d.ts +0 -280
  146. package/es/utils/hooks.js +0 -753
  147. package/lib/css/LayoutRegistry.d.ts +0 -11
  148. package/lib/css/LayoutRegistry.js +0 -30
  149. package/lib/utils/hooks.d.ts +0 -280
  150. package/lib/utils/hooks.js +0 -759
@@ -0,0 +1,23 @@
1
+ import { Syringe } from 'mana-syringe';
2
+ import type { LayoutObject } from './LayoutObject';
3
+ import { LayoutContext } from './LayoutContext';
4
+ import type { LayoutFragment } from './LayoutFragment';
5
+ import type { IntrinsicSizes, LayoutConstraints } from './types';
6
+ export declare const LayoutChildrenFactory: Syringe.DefinedToken;
7
+ export interface LayoutChildrenFactory {
8
+ (options: LayoutChildrenOptions): LayoutChildren;
9
+ }
10
+ export declare const LayoutChildrenOptions: Syringe.DefinedToken;
11
+ export interface LayoutChildrenOptions {
12
+ node: LayoutObject;
13
+ }
14
+ export declare class LayoutChildren {
15
+ protected readonly _layoutContext: LayoutContext;
16
+ protected readonly options: LayoutChildrenOptions;
17
+ node: LayoutObject;
18
+ readonly styleMap: Map<string, any>;
19
+ layoutContext: LayoutContext;
20
+ constructor(_layoutContext: LayoutContext, options: LayoutChildrenOptions);
21
+ intrinsicSizes(): Promise<IntrinsicSizes>;
22
+ layoutNextFragment(constraints: LayoutConstraints): Promise<LayoutFragment>;
23
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LayoutChildrenOptions = exports.LayoutChildrenFactory = exports.LayoutChildren = void 0;
7
+
8
+ var _tslib = require("tslib");
9
+
10
+ var _manaSyringe = require("mana-syringe");
11
+
12
+ var _utils = require("../../utils");
13
+
14
+ var _LayoutContext = require("./LayoutContext");
15
+
16
+ var _types = require("./types");
17
+
18
+ var LayoutChildrenFactory = _manaSyringe.Syringe.defineToken('LayoutChildrenFactory');
19
+
20
+ exports.LayoutChildrenFactory = LayoutChildrenFactory;
21
+
22
+ var LayoutChildrenOptions = _manaSyringe.Syringe.defineToken('LayoutChildrenOptions');
23
+
24
+ exports.LayoutChildrenOptions = LayoutChildrenOptions;
25
+
26
+ var LayoutChildren =
27
+ /** @class */
28
+ function () {
29
+ function LayoutChildren(_layoutContext, options) {
30
+ this._layoutContext = _layoutContext;
31
+ this.options = options;
32
+ this.layoutContext = _layoutContext;
33
+ this.node = options.node;
34
+ this.styleMap = options.node.getAllStyle();
35
+ }
36
+
37
+ LayoutChildren.prototype.intrinsicSizes = function () {
38
+ // if (this.contextId !== this.layoutContext.contextId) {
39
+ // throw new Error('Invalid State: wrong layout context');
40
+ // }
41
+ var deferred = new _utils.Deferred();
42
+ this.layoutContext.appendWorkTask({
43
+ layoutChild: this,
44
+ taskType: _types.LayoutTaskType.IntrinsicSizes,
45
+ deferred: deferred
46
+ });
47
+ return deferred.promise;
48
+ };
49
+
50
+ LayoutChildren.prototype.layoutNextFragment = function (constraints) {
51
+ // if (this.layoutContext.contextId !== this.layoutContext.contextId) {
52
+ // throw new Error('Invalid State: wrong layout context');
53
+ // }
54
+ if (this.layoutContext.mode === _types.LayoutTaskType.IntrinsicSizes) {
55
+ throw new Error('Not Supported: cant call layoutNextFragment in intrinsicSizes');
56
+ }
57
+
58
+ var deferred = new _utils.Deferred();
59
+ this.layoutContext.appendWorkTask({
60
+ layoutConstraints: constraints,
61
+ layoutChild: this,
62
+ taskType: _types.LayoutTaskType.Layout,
63
+ deferred: deferred
64
+ });
65
+ return deferred.promise;
66
+ };
67
+
68
+ LayoutChildren = (0, _tslib.__decorate)([(0, _manaSyringe.injectable)(), (0, _tslib.__param)(0, (0, _manaSyringe.inject)(_LayoutContext.LayoutContext)), (0, _tslib.__param)(1, (0, _manaSyringe.inject)(LayoutChildrenOptions)), (0, _tslib.__metadata)("design:paramtypes", [_LayoutContext.LayoutContext, Object])], LayoutChildren);
69
+ return LayoutChildren;
70
+ }();
71
+
72
+ exports.LayoutChildren = LayoutChildren;
@@ -0,0 +1,35 @@
1
+ import { Syringe } from 'mana-syringe';
2
+ import type { LayoutWorkTask } from './LayoutWorkTask';
3
+ import type { LayoutTaskType } from './types';
4
+ import type { ContextId } from './types';
5
+ import type { FragmentResultFactory } from './FragmentResult';
6
+ import type { LayoutChildrenFactory } from './LayoutChildren';
7
+ import type { LayoutFragmentFactory } from './LayoutFragment';
8
+ export declare const LayoutContextFactory: Syringe.DefinedToken;
9
+ export interface LayoutContextFactory {
10
+ (options: {
11
+ mode: LayoutTaskType;
12
+ }): LayoutContext;
13
+ }
14
+ export declare const LayoutContextOptions: Syringe.DefinedToken;
15
+ export interface LayoutContextOptions {
16
+ mode: LayoutTaskType;
17
+ layoutChildrenFactory: LayoutChildrenFactory;
18
+ fragmentResultFactory: FragmentResultFactory;
19
+ layoutFragmentFactory: LayoutFragmentFactory;
20
+ }
21
+ /**
22
+ * 每次layout 有单独的 context
23
+ */
24
+ export declare class LayoutContext {
25
+ protected readonly options: LayoutContextOptions;
26
+ contextId: ContextId;
27
+ workQueue: LayoutWorkTask[];
28
+ mode: LayoutTaskType;
29
+ layoutChildrenFactory: LayoutChildrenFactory;
30
+ fragmentResultFactory: FragmentResultFactory;
31
+ layoutFragmentFactory: LayoutFragmentFactory;
32
+ constructor(options: LayoutContextOptions);
33
+ appendWorkTask(work: LayoutWorkTask): void;
34
+ clearWorkQueue(): void;
35
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LayoutContextOptions = exports.LayoutContextFactory = exports.LayoutContext = void 0;
7
+
8
+ var _tslib = require("tslib");
9
+
10
+ var _manaSyringe = require("mana-syringe");
11
+
12
+ var LayoutContextFactory = _manaSyringe.Syringe.defineToken('LayoutContextFactory');
13
+
14
+ exports.LayoutContextFactory = LayoutContextFactory;
15
+
16
+ var LayoutContextOptions = _manaSyringe.Syringe.defineToken('LayoutContextOptions');
17
+
18
+ exports.LayoutContextOptions = LayoutContextOptions;
19
+ var guid = 0;
20
+ /**
21
+ * 每次layout 有单独的 context
22
+ */
23
+
24
+ var LayoutContext =
25
+ /** @class */
26
+ function () {
27
+ function LayoutContext(options) {
28
+ this.options = options;
29
+ this.workQueue = [];
30
+ this.contextId = "".concat(guid++);
31
+ this.mode = options.mode;
32
+ this.layoutChildrenFactory = options.layoutChildrenFactory;
33
+ this.fragmentResultFactory = options.fragmentResultFactory;
34
+ this.layoutFragmentFactory = options.layoutFragmentFactory;
35
+ }
36
+
37
+ LayoutContext.prototype.appendWorkTask = function (work) {
38
+ this.workQueue.push(work);
39
+ };
40
+
41
+ LayoutContext.prototype.clearWorkQueue = function () {
42
+ this.workQueue = [];
43
+ };
44
+
45
+ LayoutContext = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)(), (0, _tslib.__param)(0, (0, _manaSyringe.inject)(LayoutContextOptions)), (0, _tslib.__metadata)("design:paramtypes", [Object])], LayoutContext);
46
+ return LayoutContext;
47
+ }();
48
+
49
+ exports.LayoutContext = LayoutContext;
@@ -0,0 +1,20 @@
1
+ import type { IntrinsicSizes, LayoutConstraints, LayoutOptions } from './types';
2
+ import type { FragmentResultOptions, FragmentResult } from './FragmentResult';
3
+ import type { LayoutChildren } from './LayoutChildren';
4
+ import type { LayoutEdges } from './LayoutEdges';
5
+ export declare abstract class AbstractLayoutDefinition {
6
+ static inputProperties: string[];
7
+ static childrenInputProperties: string[];
8
+ static layoutOptions: LayoutOptions;
9
+ abstract intrinsicSizes(children: LayoutChildren[], edges: LayoutEdges, styleMap: Map<string, any>): Promise<IntrinsicSizes>;
10
+ abstract layout(children: LayoutChildren[], edges: LayoutEdges, constraints: LayoutConstraints, styleMap: Map<string, any>): Promise<FragmentResultOptions | FragmentResult>;
11
+ }
12
+ /**
13
+ * internal use
14
+ */
15
+ export declare type LayoutDefinitionCtor = {
16
+ new (): AbstractLayoutDefinition;
17
+ inputProperties: string[];
18
+ childrenInputProperties: string[];
19
+ layoutOptions: LayoutOptions;
20
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AbstractLayoutDefinition = void 0;
7
+
8
+ var AbstractLayoutDefinition =
9
+ /** @class */
10
+ function () {
11
+ function AbstractLayoutDefinition() {}
12
+
13
+ return AbstractLayoutDefinition;
14
+ }();
15
+
16
+ exports.AbstractLayoutDefinition = AbstractLayoutDefinition;
@@ -0,0 +1,24 @@
1
+ import { Syringe } from 'mana-syringe';
2
+ import type { LayoutObject } from './LayoutObject';
3
+ export declare const LayoutEdgesFactory: Syringe.DefinedToken;
4
+ export interface LayoutEdgesFactory {
5
+ (options: LayoutEdgesOptions): LayoutEdges;
6
+ }
7
+ export declare const LayoutEdgesOptions: Syringe.DefinedToken;
8
+ export interface LayoutEdgesOptions {
9
+ node: LayoutObject;
10
+ }
11
+ /**
12
+ * https://drafts.css-houdini.org/css-layout-api/#layoutedges
13
+ * the size of border, scrollbar, padding
14
+ */
15
+ export declare class LayoutEdges {
16
+ protected readonly options: LayoutEdgesOptions;
17
+ readonly inlineStart: number;
18
+ readonly inlineEnd: number;
19
+ readonly blockStart: number;
20
+ readonly blockEnd: number;
21
+ readonly inline: number;
22
+ readonly block: number;
23
+ constructor(options: LayoutEdgesOptions);
24
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LayoutEdgesOptions = exports.LayoutEdgesFactory = exports.LayoutEdges = void 0;
7
+
8
+ var _tslib = require("tslib");
9
+
10
+ var _manaSyringe = require("mana-syringe");
11
+
12
+ var _types = require("./types");
13
+
14
+ var LayoutEdgesFactory = _manaSyringe.Syringe.defineToken('LayoutEdgesFactory');
15
+
16
+ exports.LayoutEdgesFactory = LayoutEdgesFactory;
17
+
18
+ var LayoutEdgesOptions = _manaSyringe.Syringe.defineToken('LayoutEdgesOptions');
19
+
20
+ exports.LayoutEdgesOptions = LayoutEdgesOptions;
21
+ var SCROLLBAR_SIZES = [0, 0, 0, 0];
22
+ /**
23
+ * https://drafts.css-houdini.org/css-layout-api/#layoutedges
24
+ * the size of border, scrollbar, padding
25
+ */
26
+
27
+ var LayoutEdges =
28
+ /** @class */
29
+ function () {
30
+ function LayoutEdges(options) {
31
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
32
+
33
+ this.options = options;
34
+ var node = options.node;
35
+ var styleMap = node.getAllStyle();
36
+ var borderTopWidth = (_b = (_a = styleMap.get(_types.PropertyName.PADDING_TOP)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0;
37
+ var borderRightWidth = (_d = (_c = styleMap.get(_types.PropertyName.PADDING_END)) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 0;
38
+ var borderBottomWidth = (_f = (_e = styleMap.get(_types.PropertyName.PADDING_BOTTOM)) === null || _e === void 0 ? void 0 : _e.value) !== null && _f !== void 0 ? _f : 0;
39
+ var borderLeftWidth = (_h = (_g = styleMap.get(_types.PropertyName.PADDING_START)) === null || _g === void 0 ? void 0 : _g.value) !== null && _h !== void 0 ? _h : 0;
40
+ var paddingTopWidth = (_k = (_j = styleMap.get(_types.PropertyName.PADDING_TOP)) === null || _j === void 0 ? void 0 : _j.value) !== null && _k !== void 0 ? _k : 0;
41
+ var paddingRightWidth = (_m = (_l = styleMap.get(_types.PropertyName.PADDING_END)) === null || _l === void 0 ? void 0 : _l.value) !== null && _m !== void 0 ? _m : 0;
42
+ var paddingBottomWidth = (_p = (_o = styleMap.get(_types.PropertyName.PADDING_BOTTOM)) === null || _o === void 0 ? void 0 : _o.value) !== null && _p !== void 0 ? _p : 0;
43
+ var paddingLeftWidth = (_r = (_q = styleMap.get(_types.PropertyName.PADDING_START)) === null || _q === void 0 ? void 0 : _q.value) !== null && _r !== void 0 ? _r : 0;
44
+ this.blockStart = borderTopWidth + SCROLLBAR_SIZES[0] + paddingTopWidth;
45
+ this.inlineStart = borderRightWidth + SCROLLBAR_SIZES[1] + paddingRightWidth;
46
+ this.blockEnd = borderBottomWidth + SCROLLBAR_SIZES[2] + paddingBottomWidth;
47
+ this.inlineEnd = borderLeftWidth + SCROLLBAR_SIZES[3] + paddingLeftWidth;
48
+ this.block = this.blockStart + this.blockEnd;
49
+ this.inline = this.inlineStart + this.inlineEnd;
50
+ }
51
+
52
+ LayoutEdges = (0, _tslib.__decorate)([(0, _manaSyringe.injectable)(), (0, _tslib.__param)(0, (0, _manaSyringe.inject)(LayoutEdgesOptions)), (0, _tslib.__metadata)("design:paramtypes", [Object])], LayoutEdges);
53
+ return LayoutEdges;
54
+ }();
55
+
56
+ exports.LayoutEdges = LayoutEdges;
@@ -0,0 +1,41 @@
1
+ import type { LayoutObject } from './LayoutObject';
2
+ import { LayoutRegistry } from './LayoutRegistry';
3
+ import type { IntrinsicSizes, LayoutConstraints } from './types';
4
+ import { LayoutContextFactory } from './LayoutContext';
5
+ import { LayoutEdgesFactory } from './LayoutEdges';
6
+ import type { LayoutWorkTask } from './LayoutWorkTask';
7
+ import type { LayoutFragmentOptions } from './LayoutFragment';
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
+ }