import * as Shift from 'shift-ast'; export default class Scope { node: Shift.Node; type: ScopeType; parent?: Scope; children: Map>; elements: Map; /** * Creates a new scope. * @param node The node that created the scope. * @param type The type of scope. * @param parent The parent scope (optional). */ constructor(node: Shift.Node, type: ScopeType, parent?: Scope); /** * Gets an element by name. * @param name The name associated with the element. * @returns The element or null. */ get(name: string): T | null; /** * Adds an element. * @param name The name associated with the element. * @param element The element. * @param type The type of the variable. */ add(name: string, element: T, type?: VariableType): void; /** * Gets the scope for a given declaration type. * @param type The declaration type. * @returns The scope. */ getDeclarationScope(type: VariableType): Scope; /** * Finds a scope with a given type. Looks back up the scope tree. * @param types The desired scope types. * @returns The scope found or undefined. */ private findScope; } export type VariableType = 'var' | 'const' | 'let' | 'global'; export declare enum ScopeType { Global = "Global", Function = "Function", Other = "Other" }