import type { IsAny } from '../internal/types/assertion.js'; import type { ListOf } from '../internal/types/union.js'; export type MethodKey = IsAny extends true ? PropertyKey : [T] extends [never] ? never : T extends string ? | _MethodKey< string, ListOf< Exclude< keyof string, | 'capitalize' | 'isBlank' | 'isEmpty' | 'isNotBlank' | 'isNotEmpty' | 'reverse' | 'trimIndent' > > > | 'capitalize' | 'isBlank' | 'isEmpty' | 'isNotBlank' | 'isNotEmpty' | 'reverse' | 'trimIndent' : _MethodKey>; type _MethodKey = AS extends readonly [ infer A, ...infer B, ] ? A extends keyof T ? B extends readonly PropertyKey[] ? T[A] extends () => any ? _MethodKey | A : _MethodKey : never : never : never; /** * Returns a function that when given a value invokes the specified method. `iv` is short for "invoke". * @param name The method to get. * * @example * ```typescript * const obj = { a: 1, b: 2, c: () => 3 }; * const objs = [{ a: 1, b: 2, c: () => 3 }, { a: 4, b: 5, c: () => 6 }]; * objs.map(iv('c')); // => [3, 6] * [' a', ' b', ' c'].map(iv('trim')); // => ['a', 'b', 'c'] * iv('c')(obj); // => 3 * ``` */ declare const iv: >( name: P, ) => (x: T) => ReturnType; export default iv; //# sourceMappingURL=iv.d.ts.map