UNPKG

1.07 kBTypeScriptView Raw
1import { BiTypedDecorator1 } from './factory';
2/**
3 * Creates a function that accepts arguments of func and either invokes func returning its result, if at least arity number of arguments have been provided, or returns a function that accepts the remaining func arguments, and so on.
4 * The arity of func may be specified if func.length is not sufficient.
5 *
6 * The _.curry.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for provided arguments.
7 *
8 * Note: This method doesn't set the "length" property of curried functions.
9 * Note: The original function invoked will not be called in the context of the instance. Use `Curry` to for using it bound.
10 * @param {number} [arity] The arity of func.
11 * @example
12 *
13 * class MyClass {
14 * @CurryAll()
15 * add(a, b) {
16 * return (a + b);
17 * }
18 * }
19 *
20 * const myClass = new MyClass();
21 *
22 * const add5 = myClass.add(5);
23 *
24 * add5AndMultiply(10); // => 15
25 */
26export declare const CurryAll: BiTypedDecorator1<number>;
27export { CurryAll as curryAll };
28export default CurryAll;