Preview:ts // define AST node structure enum NodeKind { FooStmt = 'FooStmt', BarExpr = 'BarExpr', } type FooStmt = { kind: NodeKind.FooStmt expr: Expr } type BarExpr = { kind: NodeKind.BarExpr value: number } type Stmt = FooStmt type Expr = BarExpr export type Node = Stmt | Expr ...
You can choose specific lines to embed by selecting them before copying the link.