bolt/treegen/snippets/ast-before.d.ts

29 lines
797 B
TypeScript
Raw Normal View History

import { Diagnostic } from "./diagnostics"
import { TextSpan } from "./text"
2020-05-30 16:06:59 +02:00
import { Package } from "./package"
import { Type } from "./types"
2020-05-30 16:06:59 +02:00
export function setParents(node: Syntax): void;
export function isSyntax(value: any): value is Syntax;
2020-05-26 20:59:44 +02:00
interface SyntaxBase {
id: number;
2020-05-26 20:59:44 +02:00
kind: SyntaxKind;
2020-05-30 16:06:59 +02:00
type?: Type;
errors: Diagnostic[]
parentNode: Syntax | null;
span: TextSpan | null;
2020-05-26 20:59:44 +02:00
visit(visitors: NodeVisitor[]): void;
preorder(): IterableIterator<Syntax>;
2020-05-26 20:59:44 +02:00
getParentOfKind<K1 extends SyntaxKind>(kind: K1): ResolveSyntaxKind<K1> | null;
getChildNodes(): IterableIterator<Syntax>,
findAllChildrenOfKind<K1 extends SyntaxKind>(kind: K1): IterableIterator<ResolveSyntaxKind<K1>>;
}
export type ResolveSyntaxKind<K extends SyntaxKind> = Extract<Syntax, { kind: K }>;