import { Identifier } from 'estree-jsx'; import { NodeT } from './helpers'; import { NodePath, NodePathT } from './nodepath'; import { Binding, BindingKind, BindingPathT, GlobalBinding } from './binding'; declare const scopedNodeTypes: readonly ["ArrowFunctionExpression", "BlockStatement", "CatchClause", "ClassDeclaration", "ClassExpression", "DoWhileStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FunctionDeclaration", "FunctionExpression", "Program", "SwitchStatement", "WhileStatement"]; type ScopedNode = typeof scopedNodeTypes[number]; export type Label = { path: NodePath>; references: NodePath>[]; }; export declare class Scope { readonly path: NodePathT; readonly parent: Scope | null; readonly children: Scope[]; private initialized; bindings: Record; globalBindings: Record; labels: Record; private priv; private constructor(); static for(path: NodePath, parentScope: Scope | null): Scope | null; init(): void; private getMemoBinding; private getMemoLabel; private clearMemo; getProgramScope(): Scope; crawl(): void; /** Rollback all the changes contributed by this scope * @internal */ static rollbackState(scope: Scope): void; /** @internal */ static recursiveRollback(scope: Scope): void; /** @internal */ static handleRemoval(scope: Scope, path: NodePath): void; /** @internal */ registerBinding(kind: T, identifierPath: NodePath, bindingPath: BindingPathT): void; hasOwnBinding(name: string): boolean; getOwnBinding(name: string): Binding | undefined; hasBinding(name: string): boolean; getBinding(name: string): Binding | undefined; getAllBindings(...kind: BindingKind[]): Record; hasGlobalBinding(name: string): boolean; getGlobalBinding(name: string): GlobalBinding | undefined; /** @internal */ registerLabel(path: NodePath>): void; hasLabel(name: string): boolean; getLabel(name: string): Label | undefined; generateUid(name?: string): string; generateUidIdentifier(name?: string): Identifier; generateDeclaredUidIdentifier(name?: string): NodeT<'Identifier'>; /** @internal */ private renameConsideringParent; renameBinding(oldName: string, newName: string): void; } export {};