import { type TSESTree } from "@typescript-eslint/utils"; /** * Get the nearest ancestor node of a certain type. * * @example * ```typescript * const classDeclaration = getNearestNodeFrom( * node, * (node) => node.type === AST_NODE_TYPES.ClassDeclaration, * ); * ``` * * With `notInCallback` option enabled, the traversal will stop if it encounters a `CallExpression`. * This is needed for some rules because the injection context is lost when inside a callback. * * @example * ```typescript * const classDeclaration = getNearestNodeFrom( * node, * (node) => node.type === AST_NODE_TYPES.ClassDeclaration, * { notInCallback: true }, * ); * ``` */ export declare function findNearestAncestorOf({ parent }: TSESTree.Node, predicate: (parent: TSESTree.Node) => parent is T): T | undefined;