import type { Binding, NodePath } from '@babel/traverse'; import * as t from '@babel/types'; import * as m from '@codemod/matchers'; /** * Matches any literal except for template literals with expressions (that could have side effects) */ export declare const safeLiteral: m.Matcher; export declare function infiniteLoop(body?: m.Matcher): m.Matcher; export declare function constKey(name?: string | m.Matcher): m.Matcher; export declare function constObjectProperty(value?: m.Matcher): m.Matcher; export declare function matchIife(body?: m.Matcher | m.Matcher[]): m.Matcher; export declare const iife: m.Matcher; export declare const emptyIife: m.Matcher; /** * Matches either `object.property` or `object['property']` */ export declare function constMemberExpression(object: string | m.Matcher, property?: string | m.Matcher): m.Matcher; export declare const undefinedMatcher: m.Matcher; export declare const trueMatcher: m.Matcher; export declare const falseMatcher: m.Matcher; export declare const truthyMatcher: m.Matcher; /** * Starting at the parent path of the current `NodePath` and going up the * tree, return the first `NodePath` that causes the provided `matcher` * to return true, or `null` if the `matcher` never returns true. */ export declare function findParent(path: NodePath, matcher: m.Matcher): NodePath | null; /** * Starting at current `NodePath` and going up the tree, return the first * `NodePath` that causes the provided `matcher` to return true, * or `null` if the `matcher` never returns true. */ export declare function findPath(path: NodePath, matcher: m.Matcher): NodePath | null; /** * Matches a function expression or arrow function expression with a block body. */ export declare function anyFunctionExpression(params?: m.Matcher<(t.Identifier | t.Pattern | t.RestElement)[]> | (m.Matcher | m.Matcher | m.Matcher)[], body?: m.Matcher): m.Matcher; /** * Function expression matcher that captures the parameters * and allows them to be referenced in the body. */ export declare function createFunctionMatcher(params: number, body: (...captures: m.Matcher[]) => m.Matcher | m.Matcher[]): m.Matcher; /** * Returns true if every reference is a member expression whose value is read */ export declare function isReadonlyObject(binding: Binding, memberAccess: m.Matcher): boolean; /** * Checks if the binding is a temporary variable that is only assigned * once and has limited references. Often created by transpilers. * * Example with 1 reference to `_tmp`: * ```js * var _tmp; x[_tmp = y] || (x[_tmp] = z); * ``` */ export declare function isTemporaryVariable(binding: Binding | undefined, references: number, kind?: 'var' | 'param'): binding is Binding; //# sourceMappingURL=matcher.d.ts.map