MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / newLayoutNode

Function newLayoutNode

frontend/layout/lib/layoutNode.ts:16–34  ·  view source on GitHub ↗
(
    flexDirection?: FlexDirection,
    size?: number,
    children?: LayoutNode[],
    data?: TabLayoutData
)

Source from the content-addressed store, hash-verified

14 * @returns The new node.
15 */
16export function newLayoutNode(
17 flexDirection?: FlexDirection,
18 size?: number,
19 children?: LayoutNode[],
20 data?: TabLayoutData
21): LayoutNode {
22 const newNode: LayoutNode = {
23 id: crypto.randomUUID(),
24 flexDirection: flexDirection ?? FlexDirection.Row,
25 size: size ?? DefaultNodeSize,
26 children,
27 data,
28 };
29
30 if (!validateNode(newNode)) {
31 throw new Error("Invalid node");
32 }
33 return newNode;
34}
35
36/**
37 * Adds new nodes to the tree at the given index.

Callers 11

handleBackendActionMethod · 0.90
newEphemeralNodeMethod · 0.90
splitHorizontalFunction · 0.90
splitVerticalFunction · 0.90
layoutNode.test.tsFile · 0.90
layoutTree.test.tsFile · 0.90
addIntermediateNodeFunction · 0.85
createBlockFunction · 0.85
replaceBlockFunction · 0.85

Calls 1

validateNodeFunction · 0.85

Tested by

no test coverage detected