Skip to main content

convertLegacyToNary

react-mosaic-component


react-mosaic-component / convertLegacyToNary

Function: convertLegacyToNary()

Call Signature​

convertLegacyToNary<T>(legacyNode): null

Defined in: libs/react-mosaic-component/src/lib/util/mosaicUtilities.ts:275

Converts a legacy binary-tree MosaicNode to the new n-ary tree format.

  • LegacyMosaicParent is converted to MosaicSplitNode.
  • splitPercentage is converted to a splitPercentages array.

Type Parameters​

T​

T extends MosaicKey

Parameters​

legacyNode​

null

The node from the old binary tree structure.

Returns​

null

The equivalent node in the new n-ary tree structure.

Call Signature​

convertLegacyToNary<T>(legacyNode): MosaicNode<T>

Defined in: libs/react-mosaic-component/src/lib/util/mosaicUtilities.ts:278

Converts a legacy binary-tree MosaicNode to the new n-ary tree format.

  • LegacyMosaicParent is converted to MosaicSplitNode.
  • splitPercentage is converted to a splitPercentages array.

Type Parameters​

T​

T extends MosaicKey

Parameters​

legacyNode​

T | MosaicSplitNode<T> | MosaicTabsNode<T> | LegacyMosaicParent<T>

The node from the old binary tree structure.

Returns​

MosaicNode<T>

The equivalent node in the new n-ary tree structure.

Call Signature​

convertLegacyToNary<T>(legacyNode): MosaicNode<T> | null

Defined in: libs/react-mosaic-component/src/lib/util/mosaicUtilities.ts:281

Converts a legacy binary-tree MosaicNode to the new n-ary tree format.

  • LegacyMosaicParent is converted to MosaicSplitNode.
  • splitPercentage is converted to a splitPercentages array.

Type Parameters​

T​

T extends MosaicKey

Parameters​

legacyNode​

T | MosaicSplitNode<T> | MosaicTabsNode<T> | LegacyMosaicParent<T> | null

The node from the old binary tree structure.

Returns​

MosaicNode<T> | null

The equivalent node in the new n-ary tree structure.