import { Binding, NodePath } from '@babel/traverse'; import * as t from '@babel/types'; export declare abstract class ConstantVariable { readonly name: string; readonly binding: Binding; readonly expression: T; /** * Creates a new constant variable. * @param name The name of the variable. * @param binding The binding. * @param expression The value the variable holds. */ constructor(name: string, binding: Binding, expression: T); /** * Removes the variable and any declarations. */ abstract remove(): void; } export declare class ConstantDeclarationVariable extends ConstantVariable { private readonly declaratorPath; /** * Creates a new constant variable that is declared and initialised immediately. * @param declaratorPath The path of the variable declarator. * @param name The name of the variable. * @param binding The binding. * @param expression The value the variable holds. */ constructor(declaratorPath: NodePath, name: string, binding: Binding, expression: T); /** * Removes the variable. */ remove(): void; } export declare class ConstantAssignmentVariable extends ConstantVariable { private readonly declaratorPath; private readonly assignmentPath; /** * Creates a new constant variable that is declared with no value then assigned to later. * @param declaratorPath The path of the variable declarator. * @param assignmentPath The path of the assignment to the variable. * @param name The name of the variable. * @param binding The binding. * @param expression The value the variable holds. */ constructor(declaratorPath: NodePath, assignmentPath: NodePath, name: string, binding: Binding, expression: T); /** * Removes the variable. */ remove(): void; } export type isTypeFunction = (node: t.Node) => node is T; /** * Checks whether a node is initialising a 'constant' variable and returns the variable if so. * @param path The path. * @param isType The function that determines whether the expression is of the desired type. * @returns The constant variable or undefined. */ export declare function findConstantVariable(path: NodePath, isType: isTypeFunction, canBeFunction?: boolean): ConstantVariable | undefined;