Skip to main content

TypeOperation AST TypeScript Object

The TypeOperation object matches a TypeScript type (e.g. the identifier of a type).

The astType value for this node is typeoperation.

Code Pattern

This object catches the following code patterns:

const foo: number | string = ...;
const bar: number & string = ...;

The TypeOperation captures the element number | string or number & string in the code above.


  • left (AstString): left side of the operation
  • operand (AstString): the string of the operand (e.g. | or &)
  • right (AstString): right side of the operation.