Skip to content

Instantly share code, notes, and snippets.

@cutiful
Last active June 27, 2022 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cutiful/7604565488ad331cde03d9851c0c8987 to your computer and use it in GitHub Desktop.
Save cutiful/7604565488ad331cde03d9851c0c8987 to your computer and use it in GitHub Desktop.
ESTree spec as a table

ESTree node types

interface base type body argument id value test source left right operator expression kind computed label consequent key name generator object alternate init elements properties method prefix property callee arguments expressions static local specifiers declaration exported loc start end line column regex sourceType params async directive discriminant cases block handler finalizer param update declarations shorthand await delegate quasis tag quasi tail superClass meta imported bigint optional
Node string SourceLocation | "null"
SourceLocation string | "null" Position Position
Position number number
Identifier Expression, Pattern "Identifier" string SourceLocation | "null"
Literal Expression "Literal" string | boolean | "null" | number | RegExp | bigint SourceLocation | "null"
RegExpLiteral Literal "Literal" string | boolean | "null" | number | RegExp | bigint SourceLocation | "null" { patternstring, flagsstring }
Program Node "Program" Statement | ModuleDeclaration ] SourceLocation | "null" "script" | "module"
Function Node string FunctionBody Identifier | "null" boolean SourceLocation | "null" Pattern ] boolean
Statement Node string SourceLocation | "null"
ExpressionStatement Statement "ExpressionStatement" Expression SourceLocation | "null"
Directive ExpressionStatement "ExpressionStatement" Literal SourceLocation | "null" string
BlockStatement Statement "BlockStatement" Statement ] SourceLocation | "null"
FunctionBody BlockStatement "BlockStatement" Directive | Statement ] SourceLocation | "null"
EmptyStatement Statement "EmptyStatement" SourceLocation | "null"
DebuggerStatement Statement "DebuggerStatement" SourceLocation | "null"
WithStatement Statement "WithStatement" Statement Expression SourceLocation | "null"
ReturnStatement Statement "ReturnStatement" Expression | "null" SourceLocation | "null"
LabeledStatement Statement "LabeledStatement" Statement Identifier SourceLocation | "null"
BreakStatement Statement "BreakStatement" Identifier | "null" SourceLocation | "null"
ContinueStatement Statement "ContinueStatement" Identifier | "null" SourceLocation | "null"
IfStatement Statement "IfStatement" Expression Statement Statement | "null" SourceLocation | "null"
SwitchStatement Statement "SwitchStatement" SourceLocation | "null" Expression SwitchCase ]
SwitchCase Node "SwitchCase" Expression | "null" Statement ] SourceLocation | "null"
ThrowStatement Statement "ThrowStatement" Expression SourceLocation | "null"
TryStatement Statement "TryStatement" SourceLocation | "null" BlockStatement CatchClause | "null" BlockStatement | "null"
CatchClause Node "CatchClause" BlockStatement SourceLocation | "null" Pattern | "null"
WhileStatement Statement "WhileStatement" Statement Expression SourceLocation | "null"
DoWhileStatement Statement "DoWhileStatement" Statement Expression SourceLocation | "null"
ForStatement Statement "ForStatement" Statement Expression | "null" VariableDeclaration | Expression | "null" SourceLocation | "null" Expression | "null"
ForInStatement Statement "ForInStatement" Statement VariableDeclaration | Pattern Expression SourceLocation | "null"
Declaration Statement string SourceLocation | "null"
FunctionDeclaration Function, Declaration "FunctionDeclaration" FunctionBody Identifier boolean SourceLocation | "null" Pattern ] boolean
VariableDeclaration Declaration "VariableDeclaration" "var" | "let" | "const" SourceLocation | "null" VariableDeclarator ]
VariableDeclarator Node "VariableDeclarator" Pattern Expression | "null" SourceLocation | "null"
Expression Node string SourceLocation | "null"
ThisExpression Expression "ThisExpression" SourceLocation | "null"
ArrayExpression Expression "ArrayExpression" Expression | SpreadElement | "null" ] SourceLocation | "null"
ObjectExpression Expression "ObjectExpression" Property | SpreadElement ] SourceLocation | "null"
Property Node "Property" Expression "init" | "get" | "set" boolean Expression boolean SourceLocation | "null" boolean
FunctionExpression Function, Expression "FunctionExpression" FunctionBody Identifier | "null" boolean SourceLocation | "null" Pattern ] boolean
UnaryExpression Expression "UnaryExpression" Expression UnaryOperator boolean SourceLocation | "null"
UpdateExpression Expression "UpdateExpression" Expression UpdateOperator boolean SourceLocation | "null"
BinaryExpression Expression "BinaryExpression" Expression | PrivateIdentifier Expression BinaryOperator SourceLocation | "null"
AssignmentExpression Expression "AssignmentExpression" Pattern Expression AssignmentOperator SourceLocation | "null"
LogicalExpression Expression "LogicalExpression" Expression Expression LogicalOperator SourceLocation | "null"
MemberExpression Expression, Pattern, ChainElement "MemberExpression" boolean Expression | Super Expression | PrivateIdentifier SourceLocation | "null" boolean
ConditionalExpression Expression "ConditionalExpression" Expression Expression Expression SourceLocation | "null"
CallExpression Expression, ChainElement "CallExpression" Expression | Super Expression | SpreadElement ] SourceLocation | "null" boolean
NewExpression Expression "NewExpression" Expression Expression | SpreadElement ] SourceLocation | "null"
SequenceExpression Expression "SequenceExpression" Expression ] SourceLocation | "null"
Pattern Node string SourceLocation | "null"
ForOfStatement ForInStatement "ForOfStatement" Statement VariableDeclaration | Pattern Expression SourceLocation | "null" boolean
Super Node "Super" SourceLocation | "null"
SpreadElement Node "SpreadElement" Expression SourceLocation | "null"
ArrowFunctionExpression Function, Expression "ArrowFunctionExpression" FunctionBody | Expression Identifier | "null" boolean "false" SourceLocation | "null" Pattern ] boolean
YieldExpression Expression "YieldExpression" Expression | "null" SourceLocation | "null" boolean
TemplateLiteral Expression "TemplateLiteral" Expression ] SourceLocation | "null" TemplateElement ]
TaggedTemplateExpression Expression "TaggedTemplateExpression" SourceLocation | "null" Expression TemplateLiteral
TemplateElement Node "TemplateElement" { cookedstring | "null", rawstring } SourceLocation | "null" boolean
AssignmentProperty Property "Property" Pattern "init" boolean Expression "false" SourceLocation | "null" boolean
ObjectPattern Pattern "ObjectPattern" AssignmentProperty | RestElement ] SourceLocation | "null"
ArrayPattern Pattern "ArrayPattern" Pattern | "null" ] SourceLocation | "null"
RestElement Pattern "RestElement" Pattern SourceLocation | "null"
AssignmentPattern Pattern "AssignmentPattern" Pattern Expression SourceLocation | "null"
Class Node string ClassBody Identifier | "null" SourceLocation | "null" Expression | "null"
ClassBody Node "ClassBody" MethodDefinition | PropertyDefinition | StaticBlock ] SourceLocation | "null"
MethodDefinition Node "MethodDefinition" FunctionExpression "constructor" | "method" | "get" | "set" boolean Expression | PrivateIdentifier boolean SourceLocation | "null"
ClassDeclaration Class, Declaration "ClassDeclaration" ClassBody Identifier SourceLocation | "null" Expression | "null"
ClassExpression Class, Expression "ClassExpression" ClassBody Identifier | "null" SourceLocation | "null" Expression | "null"
MetaProperty Expression "MetaProperty" Identifier SourceLocation | "null" Identifier
ModuleDeclaration Node string SourceLocation | "null"
ModuleSpecifier Node string Identifier SourceLocation | "null"
ImportDeclaration ModuleDeclaration "ImportDeclaration" Literal ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ] SourceLocation | "null"
ImportSpecifier ModuleSpecifier "ImportSpecifier" Identifier SourceLocation | "null" Identifier | Literal
ImportDefaultSpecifier ModuleSpecifier "ImportDefaultSpecifier" Identifier SourceLocation | "null"
ImportNamespaceSpecifier ModuleSpecifier "ImportNamespaceSpecifier" Identifier SourceLocation | "null"
ExportNamedDeclaration ModuleDeclaration "ExportNamedDeclaration" Literal | "null" ExportSpecifier ] Declaration | "null" SourceLocation | "null"
ExportSpecifier ModuleSpecifier "ExportSpecifier" Identifier | Literal Identifier | Literal SourceLocation | "null"
AnonymousDefaultExportedFunctionDeclaration Function "FunctionDeclaration" FunctionBody "null" boolean SourceLocation | "null" Pattern ] boolean
AnonymousDefaultExportedClassDeclaration Class "ClassDeclaration" ClassBody "null" SourceLocation | "null" Expression | "null"
ExportDefaultDeclaration ModuleDeclaration "ExportDefaultDeclaration" AnonymousDefaultExportedFunctionDeclaration | FunctionDeclaration | AnonymousDefaultExportedClassDeclaration | ClassDeclaration | Expression SourceLocation | "null"
ExportAllDeclaration ModuleDeclaration "ExportAllDeclaration" Literal Identifier | Literal | "null" SourceLocation | "null"
AwaitExpression Expression "AwaitExpression" Expression SourceLocation | "null"
BigIntLiteral Literal "Literal" string | boolean | "null" | number | RegExp | bigint SourceLocation | "null" string
ChainExpression Expression "ChainExpression" ChainElement SourceLocation | "null"
ChainElement Node string SourceLocation | "null" boolean
ImportExpression Expression "ImportExpression" Expression SourceLocation | "null"
PropertyDefinition Node "PropertyDefinition" Expression | "null" boolean Expression | PrivateIdentifier boolean SourceLocation | "null"
PrivateIdentifier Node "PrivateIdentifier" string SourceLocation | "null"
StaticBlock BlockStatement "StaticBlock" Statement ] SourceLocation | "null"

Node

ES5:

interface Node {
    type: string;
    loc: SourceLocation | null;
}

SourceLocation

ES5:

interface SourceLocation {
    source: string | null;
    start: Position;
    end: Position;
}

Position

ES5:

interface Position {
    line: number; // >= 1
    column: number; // >= 0
}

Identifier

ES5:

interface Identifier <: Expression, Pattern {
    type: "Identifier";
    name: string;
}

Literal

ES5:

interface Literal <: Expression {
    type: "Literal";
    value: string | boolean | null | number | RegExp;
}

ES2020:

extend interface Literal <: Expression {
    type: "Literal";
    value: string | boolean | null | number | RegExp | bigint;
}

RegExpLiteral

ES5:

interface RegExpLiteral <: Literal {
  regex: {
    pattern: string;
    flags: string;
  };
}

Program

ES5:

interface Program <: Node {
    type: "Program";
    body: [ Directive | Statement ];
}

ES2015:

extend interface Program {
    sourceType: "script" | "module";
    body: [ Statement | ModuleDeclaration ];
}

Function

ES5:

interface Function <: Node {
    id: Identifier | null;
    params: [ Pattern ];
    body: FunctionBody;
}

ES2015:

extend interface Function {
    generator: boolean;
}

ES2017:

extend interface Function {
    async: boolean;
}

Statement

ES5:

interface Statement <: Node { }

ExpressionStatement

ES5:

interface ExpressionStatement <: Statement {
    type: "ExpressionStatement";
    expression: Expression;
}

Directive

ES5:

interface Directive <: ExpressionStatement {
    expression: Literal;
    directive: string;
}

BlockStatement

ES5:

interface BlockStatement <: Statement {
    type: "BlockStatement";
    body: [ Statement ];
}

FunctionBody

ES5:

interface FunctionBody <: BlockStatement {
    body: [ Directive | Statement ];
}

EmptyStatement

ES5:

interface EmptyStatement <: Statement {
    type: "EmptyStatement";
}

DebuggerStatement

ES5:

interface DebuggerStatement <: Statement {
    type: "DebuggerStatement";
}

WithStatement

ES5:

interface WithStatement <: Statement {
    type: "WithStatement";
    object: Expression;
    body: Statement;
}

ReturnStatement

ES5:

interface ReturnStatement <: Statement {
    type: "ReturnStatement";
    argument: Expression | null;
}

LabeledStatement

ES5:

interface LabeledStatement <: Statement {
    type: "LabeledStatement";
    label: Identifier;
    body: Statement;
}

BreakStatement

ES5:

interface BreakStatement <: Statement {
    type: "BreakStatement";
    label: Identifier | null;
}

ContinueStatement

ES5:

interface ContinueStatement <: Statement {
    type: "ContinueStatement";
    label: Identifier | null;
}

IfStatement

ES5:

interface IfStatement <: Statement {
    type: "IfStatement";
    test: Expression;
    consequent: Statement;
    alternate: Statement | null;
}

SwitchStatement

ES5:

interface SwitchStatement <: Statement {
    type: "SwitchStatement";
    discriminant: Expression;
    cases: [ SwitchCase ];
}

SwitchCase

ES5:

interface SwitchCase <: Node {
    type: "SwitchCase";
    test: Expression | null;
    consequent: [ Statement ];
}

ThrowStatement

ES5:

interface ThrowStatement <: Statement {
    type: "ThrowStatement";
    argument: Expression;
}

TryStatement

ES5:

interface TryStatement <: Statement {
    type: "TryStatement";
    block: BlockStatement;
    handler: CatchClause | null;
    finalizer: BlockStatement | null;
}

CatchClause

ES5:

interface CatchClause <: Node {
    type: "CatchClause";
    param: Pattern;
    body: BlockStatement;
}

ES2019:

extend interface CatchClause {
    param: Pattern | null;
}

WhileStatement

ES5:

interface WhileStatement <: Statement {
    type: "WhileStatement";
    test: Expression;
    body: Statement;
}

DoWhileStatement

ES5:

interface DoWhileStatement <: Statement {
    type: "DoWhileStatement";
    body: Statement;
    test: Expression;
}

ForStatement

ES5:

interface ForStatement <: Statement {
    type: "ForStatement";
    init: VariableDeclaration | Expression | null;
    test: Expression | null;
    update: Expression | null;
    body: Statement;
}

ForInStatement

ES5:

interface ForInStatement <: Statement {
    type: "ForInStatement";
    left: VariableDeclaration |  Pattern;
    right: Expression;
    body: Statement;
}

Declaration

ES5:

interface Declaration <: Statement { }

FunctionDeclaration

ES5:

interface FunctionDeclaration <: Function, Declaration {
    type: "FunctionDeclaration";
    id: Identifier;
}

VariableDeclaration

ES5:

interface VariableDeclaration <: Declaration {
    type: "VariableDeclaration";
    declarations: [ VariableDeclarator ];
    kind: "var";
}

ES2015:

extend interface VariableDeclaration {
    kind: "var" | "let" | "const";
}

VariableDeclarator

ES5:

interface VariableDeclarator <: Node {
    type: "VariableDeclarator";
    id: Pattern;
    init: Expression | null;
}

Expression

ES5:

interface Expression <: Node { }

ThisExpression

ES5:

interface ThisExpression <: Expression {
    type: "ThisExpression";
}

ArrayExpression

ES5:

interface ArrayExpression <: Expression {
    type: "ArrayExpression";
    elements: [ Expression | null ];
}

ES2015:

extend interface ArrayExpression {
    elements: [ Expression | SpreadElement | null ];
}

ObjectExpression

ES5:

interface ObjectExpression <: Expression {
    type: "ObjectExpression";
    properties: [ Property ];
}

ES2018:

extend interface ObjectExpression {
    properties: [ Property | SpreadElement ];
}

Property

ES5:

interface Property <: Node {
    type: "Property";
    key: Literal | Identifier;
    value: Expression;
    kind: "init" | "get" | "set";
}

ES2015:

extend interface Property {
    key: Expression;
    method: boolean;
    shorthand: boolean;
    computed: boolean;
}

FunctionExpression

ES5:

interface FunctionExpression <: Function, Expression {
    type: "FunctionExpression";
}

UnaryExpression

ES5:

interface UnaryExpression <: Expression {
    type: "UnaryExpression";
    operator: UnaryOperator;
    prefix: boolean;
    argument: Expression;
}

UnaryOperator

ES5:

enum UnaryOperator {
    "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"
}

UpdateExpression

ES5:

interface UpdateExpression <: Expression {
    type: "UpdateExpression";
    operator: UpdateOperator;
    argument: Expression;
    prefix: boolean;
}

UpdateOperator

ES5:

enum UpdateOperator {
    "++" | "--"
}

BinaryExpression

ES5:

interface BinaryExpression <: Expression {
    type: "BinaryExpression";
    operator: BinaryOperator;
    left: Expression;
    right: Expression;
}

ES2022:

extend interface BinaryExpression <: Expression {
    left: Expression | PrivateIdentifier;
}

BinaryOperator

ES5:

enum BinaryOperator {
    "==" | "!=" | "===" | "!=="
         | "<" | "<=" | ">" | ">="
         | "<<" | ">>" | ">>>"
         | "+" | "-" | "*" | "/" | "%"
         | "|" | "^" | "&" | "in"
         | "instanceof"
}

ES2016:

extend enum BinaryOperator {
    "**"
}

AssignmentExpression

ES5:

interface AssignmentExpression <: Expression {
    type: "AssignmentExpression";
    operator: AssignmentOperator;
    left: Pattern | Expression;
    right: Expression;
}

ES2015:

extend interface AssignmentExpression {
    left: Pattern;
}

AssignmentOperator

ES5:

enum AssignmentOperator {
    "=" | "+=" | "-=" | "*=" | "/=" | "%="
        | "<<=" | ">>=" | ">>>="
        | "|=" | "^=" | "&="
}

ES2016:

extend enum AssignmentOperator {
    "**="
}

ES2021:

extend enum AssignmentOperator {
    "||=" | "&&=" | "??="
}

LogicalExpression

ES5:

interface LogicalExpression <: Expression {
    type: "LogicalExpression";
    operator: LogicalOperator;
    left: Expression;
    right: Expression;
}

LogicalOperator

ES5:

enum LogicalOperator {
    "||" | "&&"
}

ES2020:

extend enum LogicalOperator {
    "||" | "&&" | "??"
}

MemberExpression

ES5:

interface MemberExpression <: Expression, Pattern {
    type: "MemberExpression";
    object: Expression;
    property: Expression;
    computed: boolean;
}

ES2015:

extend interface MemberExpression {
    object: Expression | Super;
}

ES2020:

extend interface MemberExpression <: ChainElement {}

ES2022:

extend interface MemberExpression {
    property: Expression | PrivateIdentifier;
}

ConditionalExpression

ES5:

interface ConditionalExpression <: Expression {
    type: "ConditionalExpression";
    test: Expression;
    alternate: Expression;
    consequent: Expression;
}

CallExpression

ES5:

interface CallExpression <: Expression {
    type: "CallExpression";
    callee: Expression;
    arguments: [ Expression ];
}

ES2015:

extend interface CallExpression {
    callee: Expression | Super;
    arguments: [ Expression | SpreadElement ];
}

ES2020:

extend interface CallExpression <: ChainElement {}

NewExpression

ES5:

interface NewExpression <: Expression {
    type: "NewExpression";
    callee: Expression;
    arguments: [ Expression ];
}

ES2015:

extend interface NewExpression {
    arguments: [ Expression | SpreadElement ];
}

SequenceExpression

ES5:

interface SequenceExpression <: Expression {
    type: "SequenceExpression";
    expressions: [ Expression ];
}

Pattern

ES5:

interface Pattern <: Node { }

ForOfStatement

ES2015:

interface ForOfStatement <: ForInStatement {
    type: "ForOfStatement";
}

ES2018:

extend interface ForOfStatement {
  await: boolean;
}

Super

ES2015:

interface Super <: Node {
    type: "Super";
}

SpreadElement

ES2015:

interface SpreadElement <: Node {
    type: "SpreadElement";
    argument: Expression;
}

ArrowFunctionExpression

ES2015:

interface ArrowFunctionExpression <: Function, Expression {
    type: "ArrowFunctionExpression";
    body: FunctionBody | Expression;
    expression: boolean;
    generator: false;
}

YieldExpression

ES2015:

interface YieldExpression <: Expression {
    type: "YieldExpression";
    argument: Expression | null;
    delegate: boolean;
}

TemplateLiteral

ES2015:

interface TemplateLiteral <: Expression {
    type: "TemplateLiteral";
    quasis: [ TemplateElement ];
    expressions: [ Expression ];
}

TaggedTemplateExpression

ES2015:

interface TaggedTemplateExpression <: Expression {
    type: "TaggedTemplateExpression";
    tag: Expression;
    quasi: TemplateLiteral;
}

TemplateElement

ES2015:

interface TemplateElement <: Node {
    type: "TemplateElement";
    tail: boolean;
    value: {
        cooked: string;
        raw: string;
    };
}

ES2018:

extend interface TemplateElement {
    value: {
        cooked: string | null;
        raw: string;
    };
}

AssignmentProperty

ES2015:

interface AssignmentProperty <: Property {
    type: "Property"; // inherited
    value: Pattern;
    kind: "init";
    method: false;
}

ObjectPattern

ES2015:

interface ObjectPattern <: Pattern {
    type: "ObjectPattern";
    properties: [ AssignmentProperty ];
}

ES2018:

extend interface ObjectPattern {
    properties: [ AssignmentProperty | RestElement ];
}

ArrayPattern

ES2015:

interface ArrayPattern <: Pattern {
    type: "ArrayPattern";
    elements: [ Pattern | null ];
}

RestElement

ES2015:

interface RestElement <: Pattern {
    type: "RestElement";
    argument: Pattern;
}

AssignmentPattern

ES2015:

interface AssignmentPattern <: Pattern {
    type: "AssignmentPattern";
    left: Pattern;
    right: Expression;
}

Class

ES2015:

interface Class <: Node {
    id: Identifier | null;
    superClass: Expression | null;
    body: ClassBody;
}

ClassBody

ES2015:

interface ClassBody <: Node {
    type: "ClassBody";
    body: [ MethodDefinition ];
}

ES2022:

extend interface ClassBody {
    body: [ MethodDefinition | PropertyDefinition | StaticBlock ];
}

MethodDefinition

ES2015:

interface MethodDefinition <: Node {
    type: "MethodDefinition";
    key: Expression;
    value: FunctionExpression;
    kind: "constructor" | "method" | "get" | "set";
    computed: boolean;
    static: boolean;
}

ES2022:

extend interface MethodDefinition {
    key: Expression | PrivateIdentifier;
}

ClassDeclaration

ES2015:

interface ClassDeclaration <: Class, Declaration {
    type: "ClassDeclaration";
    id: Identifier;
}

ClassExpression

ES2015:

interface ClassExpression <: Class, Expression {
    type: "ClassExpression";
}

MetaProperty

ES2015:

interface MetaProperty <: Expression {
    type: "MetaProperty";
    meta: Identifier;
    property: Identifier;
}

ModuleDeclaration

ES2015:

interface ModuleDeclaration <: Node { }

ModuleSpecifier

ES2015:

interface ModuleSpecifier <: Node {
    local: Identifier;
}

ImportDeclaration

ES2015:

interface ImportDeclaration <: ModuleDeclaration {
    type: "ImportDeclaration";
    specifiers: [ ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ];
    source: Literal;
}

ImportSpecifier

ES2015:

interface ImportSpecifier <: ModuleSpecifier {
    type: "ImportSpecifier";
    imported: Identifier;
}

ES2022:

extend interface ImportSpecifier <: ModuleSpecifier {
    imported: Identifier | Literal;
}

ImportDefaultSpecifier

ES2015:

interface ImportDefaultSpecifier <: ModuleSpecifier {
    type: "ImportDefaultSpecifier";
}

ImportNamespaceSpecifier

ES2015:

interface ImportNamespaceSpecifier <: ModuleSpecifier {
    type: "ImportNamespaceSpecifier";
}

ExportNamedDeclaration

ES2015:

interface ExportNamedDeclaration <: ModuleDeclaration {
    type: "ExportNamedDeclaration";
    declaration: Declaration | null;
    specifiers: [ ExportSpecifier ];
    source: Literal | null;
}

ExportSpecifier

ES2015:

interface ExportSpecifier <: ModuleSpecifier {
    type: "ExportSpecifier";
    exported: Identifier;
}

ES2022:

extend interface ExportSpecifier <: ModuleSpecifier {
    local: Identifier | Literal;
    exported: Identifier | Literal;
}

AnonymousDefaultExportedFunctionDeclaration

ES2015:

interface AnonymousDefaultExportedFunctionDeclaration <: Function {
    type: "FunctionDeclaration";
    id: null;
}

AnonymousDefaultExportedClassDeclaration

ES2015:

interface AnonymousDefaultExportedClassDeclaration <: Class {
    type: "ClassDeclaration";
    id: null;
}

ExportDefaultDeclaration

ES2015:

interface ExportDefaultDeclaration <: ModuleDeclaration {
    type: "ExportDefaultDeclaration";
    declaration: AnonymousDefaultExportedFunctionDeclaration | FunctionDeclaration | AnonymousDefaultExportedClassDeclaration | ClassDeclaration | Expression;
}

ExportAllDeclaration

ES2015:

interface ExportAllDeclaration <: ModuleDeclaration {
    type: "ExportAllDeclaration";
    source: Literal;
}

ES2020:

extend interface ExportAllDeclaration {
  exported: Identifier | null;
}

ES2022:

extend interface ExportAllDeclaration {
    exported: Identifier | Literal | null;
}

AwaitExpression

ES2017:

interface AwaitExpression <: Expression {
    type: "AwaitExpression";
    argument: Expression;
}

BigIntLiteral

ES2020:

interface BigIntLiteral <: Literal {
  bigint: string;
}

ChainExpression

ES2020:

interface ChainExpression <: Expression {
  type: "ChainExpression";
  expression: ChainElement;
}

ChainElement

ES2020:

interface ChainElement <: Node {
  optional: boolean;
}

ImportExpression

ES2020:

interface ImportExpression <: Expression {
  type: "ImportExpression";
  source: Expression;
}

PropertyDefinition

ES2022:

interface PropertyDefinition <: Node {
    type: "PropertyDefinition";
    key: Expression | PrivateIdentifier;
    value: Expression | null;
    computed: boolean;
    static: boolean;
}

PrivateIdentifier

ES2022:

interface PrivateIdentifier <: Node {
    type: "PrivateIdentifier";
    name: string;
}

StaticBlock

ES2022:

interface StaticBlock <: BlockStatement {
    type: "StaticBlock";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment