import { NodePath } from "./path"; import * as t from "./ast"; import { ParserContext } from "./context"; export declare type BindingKind = "var" | "let" | "const" | "module" | "param" | "hoisted"; /** * Holds information about the binding and references of a variable. */ declare class Binding { path: NodePath; kind: BindingKind; referencePaths: NodePath[]; constructor(path: NodePath, kind: BindingKind); get identifier(): N; get references(): number; get referenced(): boolean; } /** * Represents a scope layer in JavaScript. */ export declare class Scope { path: NodePath; parent: Scope | null; bindings: Map>; references: Set; constructor(path: NodePath, parent?: Scope | null); get block(): N; getBinding(name: string): Binding | undefined; hasBinding(name: string): boolean; generateUidIdentifier(name: string): t.Identifier; generateUid(name?: string): string; getFunctionParent(): Scope | null; getProgramParent(): Scope; getBlockParent(): Scope; push({ id, init, kind, }: { id: t.LVal; init: t.Expression | null; kind?: "var" | "let"; }): void; } export declare function registerScope(node: t.AstNode, parent: t.AstNode | undefined, prevScope: Scope | undefined, ctx: ParserContext): void; export {};