ts-morph-structures

Home > ts-morph-structures > getTypeAugmentedStructure

getTypeAugmentedStructure() function

Get a structure for a node, with type structures installed throughout its descendants.

Signature:

declare function getTypeAugmentedStructure<TKind extends StructureKind>(rootNode: NodeWithStructures, userConsole: TypeNodeToTypeStructureConsole, assertNoFailures: boolean, kind: TKind): RootStructureWithConvertFailures<TKind>;

Parameters

Parameter Type Description
rootNode NodeWithStructures The node to start from.
userConsole TypeNodeToTypeStructureConsole a callback for conversion failures.
assertNoFailures boolean if true, assert there are no conversion failures.
kind TKind the expected structure kind to retrieve.

Returns:

RootStructureWithConvertFailures<TKind>

the root structure, the root node, and any failures during recursion.