/** * Helper type representing a function with initial arguments pre-applied, * preserving type safety for remaining parameters. * * @template Fn - Original function type to partially apply * @template Args - Tuple type of pre-bound arguments */ type Partial = Fn extends (...args: [...Args, ...infer Rest]) => infer Return ? (...args: Rest) => Return : never; /** * Partially applies arguments to a function while maintaining type safety for remaining parameters. * * @param fn - Target function for partial application * @param args - Arguments to pre-bind to the function * @returns New function with pre-bound arguments and type-safe remaining parameters * * @example * // Basic numeric usage * const add = (a: number, b: number, c: number) => a + b + c; * const addOne = partial(add, 1); // (b: number, c: number) => number * addOne(2, 3); // 6 * * @example * // Mixed type parameters * const format = (prefix: string, value: number, suffix: string) => `${prefix}${value}${suffix}`; * const formatDollar = partial(format, "$"); // (value: number, suffix: string) => string * formatDollar(100, ".00"); // "$100.00" */ export declare function partial any, Args extends any[]>(fn: Fn, ...args: Args): Partial; export {};