import * as t from '@babel/types'; import { isTypeFunction } from './variable'; export type DeclarationOrAssignmentStatement = (t.VariableDeclaration & { declarations: [t.VariableDeclarator & { id: T; init: V; }]; }) | (t.ExpressionStatement & { expression: t.AssignmentExpression & { left: T; right: V; }; }); /** * Checks whether a node is a variable declaration or assignment expression * within an expression statement that is initialising a variable that * satisfies the provided constraints. * @param node The AST node. * @param isId The function that determines whether the variable being declared matches. * @param isValue The function that determines whether the value the variable is initialised to matches. * @returns Whether. */ export declare function isDeclarationOrAssignmentStatement(node: t.Node, isId: isTypeFunction | ((node: t.Node) => boolean), isValue: isTypeFunction | ((node: t.Node) => boolean)): node is DeclarationOrAssignmentStatement; /** * Checks whether a node is a variable declaration or assignment expression * that is initialising a variable that satisfies the provided constraints. * @param node The AST node. * @param isId The function that determines whether the variable being declared matches. * @param isValue The function that determines whether the value the variable is initialised to matches. * @returns Whether. */ export type DeclarationOrAssignmentExpression = (t.VariableDeclaration & { declarations: [t.VariableDeclarator & { id: T; init: V; }]; }) | (t.AssignmentExpression & { left: T; right: V; }); export declare function isDeclarationOrAssignmentExpression(node: t.Node, isId: isTypeFunction | ((node: t.Node) => boolean), isValue: isTypeFunction | ((node: t.Node) => boolean)): node is DeclarationOrAssignmentExpression;