Skip to main content
The SyntaxKind enum identifies the type of each node in the TypeScript Abstract Syntax Tree (AST). Every node has a kind property that determines its type and structure.

Trivia and Tokens

Trivia (Comments and Whitespace)

Literals

Primary Literals

Template Literals

Punctuation

Braces and Brackets

Operators

Other Punctuation

Assignment Operators

Keywords

Reserved Words

Strict Mode Reserved Words

Contextual Keywords

Parse Tree Nodes

Names

  • QualifiedName - A.B.C
  • ComputedPropertyName - [expr]

Type Members

  • PropertySignature
  • PropertyDeclaration
  • MethodSignature
  • MethodDeclaration
  • Constructor
  • GetAccessor
  • SetAccessor
  • CallSignature
  • ConstructSignature
  • IndexSignature

Types

  • TypePredicate
  • TypeReference
  • FunctionType
  • ConstructorType
  • TypeQuery
  • TypeLiteral
  • ArrayType
  • TupleType
  • UnionType
  • IntersectionType
  • ConditionalType
  • InferType
  • MappedType
  • TemplateLiteralType
  • ImportType

Expressions

  • ArrayLiteralExpression
  • ObjectLiteralExpression
  • PropertyAccessExpression
  • ElementAccessExpression
  • CallExpression
  • NewExpression
  • TaggedTemplateExpression
  • TypeAssertionExpression
  • ParenthesizedExpression
  • FunctionExpression
  • ArrowFunction
  • DeleteExpression
  • TypeOfExpression
  • VoidExpression
  • AwaitExpression
  • PrefixUnaryExpression
  • PostfixUnaryExpression
  • BinaryExpression
  • ConditionalExpression
  • YieldExpression
  • SpreadElement
  • ClassExpression
  • AsExpression
  • NonNullExpression
  • SatisfiesExpression

Statements

  • Block
  • VariableStatement
  • ExpressionStatement
  • IfStatement
  • DoStatement
  • WhileStatement
  • ForStatement
  • ForInStatement
  • ForOfStatement
  • ContinueStatement
  • BreakStatement
  • ReturnStatement
  • WithStatement
  • SwitchStatement
  • LabeledStatement
  • ThrowStatement
  • TryStatement
  • DebuggerStatement

Declarations

  • VariableDeclaration
  • FunctionDeclaration
  • ClassDeclaration
  • InterfaceDeclaration
  • TypeAliasDeclaration
  • EnumDeclaration
  • ModuleDeclaration
  • ImportDeclaration
  • ExportDeclaration
  • ImportEqualsDeclaration
  • ExportAssignment

JSX

  • JsxElement
  • JsxSelfClosingElement
  • JsxOpeningElement
  • JsxClosingElement
  • JsxFragment
  • JsxAttribute
  • JsxSpreadAttribute
  • JsxExpression

Other

  • SourceFile - Root node
  • Bundle - Multiple source files
  • SyntaxList - List of nodes

Helper Markers

The enum includes helper values for ranges:

Usage

Checking Node Kind

Getting Kind Name

See Also