UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

16 lines (15 loc) 559 B
import * as ts from "typescript"; import { Node } from "./../compiler"; import { KeyValueCache } from "./../utils"; /** * Extension of KeyValueCache that allows for "forget points." */ export declare class ForgetfulNodeCache extends KeyValueCache<ts.Node, Node> { private readonly forgetStack; getOrCreate<TCreate extends Node>(key: ts.Node, createFunc: () => TCreate): TCreate; setForgetPoint(): void; forgetLastPoint(): void; rememberNode(node: Node): boolean; private rememberParentOfNode(node); private forgetNodes(nodes); }