/** * @packageDocumentation * Utilities for detecting nodes that live inside `.filter(...)` callbacks. */ import { type TSESTree } from "@typescript-eslint/utils"; /** * Narrows call expressions to direct `.filter(...)` calls. */ export declare const isFilterCallExpression: (expression: Readonly) => expression is TSESTree.CallExpression & { callee: TSESTree.MemberExpression & { computed: false; optional: false; property: TSESTree.Identifier; }; optional: false; }; /** * Extract the first callback argument from a direct `.filter(...)` call. * * @param expression - Candidate call expression to inspect. * * @returns Callback expression when the call is a supported `.filter(...)` * invocation and the first argument is an arrow/function expression; * otherwise `null`. */ export declare const getFilterCallbackFunctionArgument: (expression: Readonly) => null | Readonly; /** * Structured match for `.filter(...)` calls with a single identifier parameter * arrow callback that uses an expression body. */ export type SingleParameterExpressionArrowFilterCallbackMatch = Readonly<{ callback: TSESTree.ArrowFunctionExpression & { body: TSESTree.Expression; params: [TSESTree.Identifier]; }; parameter: TSESTree.Identifier; }>; /** * Extract a strict callback shape from direct `.filter(...)` calls. * * @param expression - Candidate call expression to inspect. * * @returns Structured callback match when supported; otherwise `null`. */ export declare const getSingleParameterExpressionArrowFilterCallback: (expression: Readonly) => null | SingleParameterExpressionArrowFilterCallbackMatch; /** * Checks whether a node appears inside a callback passed as the first argument * to a direct `.filter(...)` call. * * @param node - Node to inspect. * * @returns `true` when the node is inside a `.filter(...)` callback; otherwise * `false`. */ export declare const isWithinFilterCallback: (node: Readonly) => boolean; //# sourceMappingURL=filter-callback.d.ts.map