ts-morph-structures

Home > ts-morph-structures

ts-morph-structures package

Classes

Class Description
ArrayTypeStructureImpl boolean[]
CallSignatureDeclarationImpl  
ClassDeclarationImpl  
ClassFieldStatementsMap <p>This is a map for specifying statements across several class members for a single class field.</p><p>For example, a field may require statements for: - defining a getter and/or a setter - initializing in a constructor - implementing a .toJSON() method</p><p>The field name specifies which field the statements are about. The statement group specifies where the statements go (what method, or an initializer).</p><p>Special field keys: ClassFieldStatementsMap.FIELD_HEAD_SUPER_CALL: These statements will appear at the head of the statement block. ClassFieldStatementsMap.FIELD_TAIL_FINAL_RETURN: These statements will appear at the tail of the statement block.</p><p>Special statement group keys: ClassFieldStatementsMap.GROUP_INITIALIZER_OR_PROPERTY: This represents an initializer for a property, or a value reference for a getter or setter. Field keys will have get or set stripped from them for this group key. Statement arrays for this group key should contain exactly one statement, and should be just a string.</p>
ClassMembersMap A map for class methods, properties, accessors and a constructor. This doesn’t replace ClassDeclarationImpl, rather, it _feeds_ ClassDeclarationImpl.
ClassStaticBlockDeclarationImpl  
ConditionalTypeStructureImpl checkType extends extendsType ? trueType : falseType
ConstructorDeclarationImpl  
ConstructorDeclarationOverloadImpl  
ConstructSignatureDeclarationImpl  
DecoratorImpl  
EnumDeclarationImpl  
EnumMemberImpl  
ExportAssignmentImpl  
ExportDeclarationImpl  
ExportManager This manages export declarations and specifiers, for including in a source file.
ExportSpecifierImpl  
FunctionDeclarationImpl  
FunctionDeclarationOverloadImpl  
FunctionTypeStructureImpl (“new” | “get” | “set” | “”) name(parameters, ...restParameter) ("=>" | ":" ) returnType
GetAccessorDeclarationImpl  
ImportAttributeImpl  
ImportDeclarationImpl  
ImportManager This manages import declarations and specifiers, for including in a source file.
ImportSpecifierImpl  
ImportTypeStructureImpl  
IndexedAccessTypeStructureImpl  
IndexSignatureDeclarationImpl  
InferTypeStructureImpl  
InterfaceDeclarationImpl  
IntersectionTypeStructureImpl  
JSDocImpl  
JSDocTagImpl  
JsxAttributeImpl  
JsxElementImpl  
JsxSelfClosingElementImpl  
JsxSpreadAttributeImpl  
LiteralTypeStructureImpl Literals (boolean, number, string, void, etc.), without quotes, brackets, or anything else around them. Leaf nodes.
MappedTypeStructureImpl { readonly [key in keyof Foo]: boolean }
MemberedObjectTypeStructureImpl Properties, methods, getters, setters, and index signatures. Very much like interfaces. Usually in type aliases.
MemberedTypeToClass Convert type members to a class members map, including statements.
MethodDeclarationImpl  
MethodDeclarationOverloadImpl  
MethodSignatureImpl  
ModuleDeclarationImpl  
NumberTypeStructureImpl Numbers (boolean, number, string, void, etc.), without quotes, brackets, or anything else around them. Leaf nodes.
ParameterDeclarationImpl  
ParameterTypeStructureImpl Just a parameter name and type for a FunctionTypeStructureImpl.
ParenthesesTypeStructureImpl Wrap the child type in parentheses.
PrefixOperatorsTypeStructureImpl ("..." | "keyof" | "typeof" | "readonly" | "unique")[] (object type)
PropertyAssignmentImpl  
PropertyDeclarationImpl  
PropertySignatureImpl  
QualifiedNameTypeStructureImpl  
SetAccessorDeclarationImpl  
ShorthandPropertyAssignmentImpl  
SourceFileImpl  
SpreadAssignmentImpl  
StringTypeStructureImpl Strings, encased in double quotes. Leaf nodes.
TemplateLiteralTypeStructureImpl one${"A" | "B"}two${"C" | "D"}three
TupleTypeStructureImpl  
TypeAliasDeclarationImpl  
TypeArgumentedTypeStructureImpl This resolves type parameters, as opposed to defining them.
TypeMembersMap A map for members of InterfaceDeclarationImpl and MemberedObjectTypeStructureImpl. This doesn’t replace the structures, rather it _feeds_ them.
TypeParameterDeclarationImpl  
TypePredicateTypeStructureImpl  
UnionTypeStructureImpl  
VariableDeclarationImpl  
VariableStatementImpl  
WriterTypeStructureImpl Wrappers for writer functions from external sources. Leaf nodes.

Enumerations

Enumeration Description
ClassSupportsStatementsFlags Bitwise flags to enable statement getter traps.
FunctionWriterStyle  
TypeStructureKind  

Functions

Function Description
forEachAugmentedStructureChild(structureOrArray, callback) Iterates over the children of a structure (or type structure), or the elements of an array of structures and type structures.
getTypeAugmentedStructure(rootNode, userConsole, assertNoFailures) Get a structure for a node, with type structures installed throughout its descendants.
getTypeAugmentedStructure(rootNode, userConsole, assertNoFailures, kind) Get a structure for a node, with type structures installed throughout its descendants.
parseLiteralType(source)  
VoidTypeNodeToTypeStructureConsole(message, failingTypeNode)  

Interfaces

Interface Description
AbstractableNodeStructureClassIfc  
AccessorMirrorGetter A value for getters and setters of a class to reflect.
AddExportContext A description of the exports to add.
AddImportContext A description of the imports to add.
AmbientableNodeStructureClassIfc  
AsyncableNodeStructureClassIfc  
CallSignatureDeclarationStructureClassIfc  
ClassAbstractMemberQuestion  
ClassAsyncMethodQuestion  
ClassBodyStatementsGetter Statements in a statement purpose block for a particular property and function.
ClassDeclarationStructureClassIfc  
ClassDeclarationWithImplementsTypeStructures  
ClassGeneratorMethodQuestion  
ClassHeadStatementsGetter Statements at the start of a statement purpose block.
ClassScopeMemberQuestion  
ClassStatementsGetter Traps for getting statements, based on a MemberedStatementsKey.
ClassStaticBlockDeclarationStructureClassIfc  
ClassTailStatementsGetter Statements at the end of a statement purpose block.
ConditionalTypeStructureParts  
ConstructorBodyStatementsGetter Statements in a statement purpose block for a particular property in the constructor.
ConstructorDeclarationOverloadStructureClassIfc  
ConstructorDeclarationStructureClassIfc  
ConstructorHeadStatementsGetter Statements at the start of a constructor’s statement purpose block.
ConstructorTailStatementsGetter Statements at the end of a constructor’s statement purpose block.
ConstructSignatureDeclarationStructureClassIfc  
DecoratableNodeStructureClassIfc  
DecoratorStructureClassIfc  
EnumDeclarationStructureClassIfc  
EnumMemberStructureClassIfc  
ExclamationTokenableNodeStructureClassIfc  
ExportableNodeStructureClassIfc  
ExportAssignmentStructureClassIfc  
ExportDeclarationStructureClassIfc  
ExportSpecifierStructureClassIfc  
FunctionDeclarationOverloadStructureClassIfc  
FunctionDeclarationStructureClassIfc  
FunctionTypeContext  
GeneratorableNodeStructureClassIfc  
GetAccessorDeclarationStructureClassIfc  
ImportAttributeStructureClassIfc  
ImportDeclarationStructureClassIfc  
ImportSpecifierStructureClassIfc  
IndexSignatureDeclarationStructureClassIfc  
IndexSignatureResolver  
InitializerExpressionableNodeStructureClassIfc  
InterfaceDeclarationStructureClassIfc  
InterfaceDeclarationWithExtendsTypeStructures  
JSDocableNodeStructureClassIfc  
JSDocStructureClassIfc  
JSDocTagStructureClassIfc  
JsxAttributeStructureClassIfc  
JsxElementStructureClassIfc  
JsxSelfClosingElementStructureClassIfc  
JsxSpreadAttributeStructureClassIfc  
KindedTypeStructure  
MemberedStatementsKey  
MethodDeclarationOverloadStructureClassIfc  
MethodDeclarationStructureClassIfc  
MethodSignatureStructureClassIfc  
ModuleDeclarationStructureClassIfc  
NameableNodeStructureClassIfc  
NamedNodeStructureClassIfc  
OverrideableNodeStructureClassIfc  
ParameterDeclarationStructureClassIfc  
ParameteredNodeStructureClassIfc  
PropertyAssignmentStructureClassIfc  
PropertyDeclarationStructureClassIfc  
PropertyInitializerGetter For the initial value of a property.
PropertySignatureStructureClassIfc  
QuestionTokenableNodeStructureClassIfc  
ReadonlyableNodeStructureClassIfc  
ReturnTypedNodeStructureClassIfc  
ReturnTypedNodeTypeStructure  
ScopedNodeStructureClassIfc  
SetAccessorDeclarationStructureClassIfc  
ShorthandPropertyAssignmentStructureClassIfc  
SourceFileStructureClassIfc  
SpreadAssignmentStructureClassIfc  
StatementedNodeStructureClassIfc  
StructureClassIfc  
TypeAliasDeclarationStructureClassIfc  
TypedNodeStructureClassIfc  
TypedNodeTypeStructure  
TypeParameterDeclarationStructureClassIfc  
TypeParameteredNodeStructureClassIfc  
TypeParameterWithTypeStructures  
TypeStructureSet  
VariableDeclarationStructureClassIfc  
VariableStatementStructureClassIfc  

Type Aliases

Type Alias Description
ClassFieldStatement  
ClassMemberImpl  
ClassMemberStructureImpls  
InterfaceMemberStructureImpls  
JsxStructureImpls  
NamedClassMemberImpl  
NamedTypeMemberImpl  
ObjectLiteralExpressionPropertyStructureImpls  
PrefixUnaryOperator  
ReadonlyTypeMembersMap  
StatementStructureImpls  
stringOrWriterFunction  
stringWriterOrStatementImpl  
StructureImpls  
TypeElementMemberStructureImpls  
TypeMemberImpl  
TypeNodeToTypeStructureConsole  
TypeStructures  
TypeStructuresOrNull