import * as Shift from 'shift-ast'; import { Variable } from './variable'; export declare class Scope { node: Shift.Node; type: ScopeType; parent?: Scope; children: Scope[]; variables: Map; /** * Creates a new scope. * @param node The AST node that created the scope. * @param type The scope type. * @param parent The parent scope (if it exists). */ constructor(node: Shift.Node, type: ScopeType, parent?: Scope); /** * Searches for a variable by name. * @param name The variable name. * @returns The variable or null if not found. */ lookupVariable(name: string): Variable | null; /** * Adds a variable to the scope (or a parent scope). * @param variable The variable. */ addVariable(variable: Variable): void; /** * Gets the scope for a declaration. * @param type The declaration type. * @returns The scope. */ getDeclarationScope(type: 'const' | 'let' | 'var'): Scope; /** * Finds a scope with a given type. * @param types The desired scope types. * @returns The scope found or undefined. */ private findScope; } export declare enum ScopeType { Global = "Global", Function = "Function", Other = "Other" }