import type ts from "typescript"; import { type TSESTree } from "@typescript-eslint/utils"; /** * Shared inputs required to evaluate whether an ESTree expression is array-like * using TypeScript type information. */ interface ArrayLikeExpressionCheckerOptions { /** * TypeScript checker instance used for type resolution. */ readonly checker: ts.TypeChecker; /** * Parser services map for converting ESTree nodes to TypeScript nodes. */ readonly parserServices: { readonly esTreeNodeToTSNodeMap: { readonly get: (key: Readonly) => ts.Node | undefined; }; }; /** * Optional file path used by telemetry counters. */ readonly telemetryFilePath?: string; /** * How union members should be matched. * * Default: `"some"`. */ readonly unionMatchMode?: UnionArrayLikeMatchMode; } /** * Determines how union member types are evaluated for array-likeness. */ type UnionArrayLikeMatchMode = "every" | "some"; /** * Determine whether a TypeScript type resolves to an array-like shape. * * @param checker - Type checker used to inspect and unwrap candidate types. * @param type - Candidate type to evaluate. * @param unionMatchMode - Strategy for union members (`"some"` or `"every"`). * * @returns `true` when the candidate resolves to an array/tuple-like type. */ export declare const isArrayLikeType: (checker: Readonly, type: Readonly, unionMatchMode?: UnionArrayLikeMatchMode) => boolean; /** * Build a safe ESTree expression predicate for array-like type checks. * * @param options - Type checker and parser-service dependencies. * * @returns Function that returns `true` when the expression is array-like. */ export declare const createIsArrayLikeExpressionChecker: ({ checker, parserServices, telemetryFilePath, unionMatchMode, }: Readonly) => (expression: Readonly) => boolean; /** * Check whether a member expression is used as a write target. * * @param node - Member expression candidate. * * @returns `true` for assignment LHS, `delete` target, or update operand. */ export declare const isWriteTargetMemberExpression: (node: Readonly) => boolean; export {}; //# sourceMappingURL=array-like-expression.d.ts.map