import _ = require("../index"); declare module "../index" { interface LoDashStatic { /** * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. * * @param n The number of calls before func is invoked. * @param func The function to restrict. * @return Returns the new restricted function. */ after any>(n: number, func: TFunc): TFunc; } interface Primitive { /** * @see _.after */ after any>(func: TFunc): Function; } interface PrimitiveChain { /** * @see _.after */ after any>(func: TFunc): FunctionChain; } interface LoDashStatic { /** * Creates a function that accepts up to n arguments ignoring any additional arguments. * * @param func The function to cap arguments for. * @param n The arity cap. * @returns Returns the new function. */ ary(func: (...args: any[]) => any, n?: number): (...args: any[]) => any; } interface Function any> { /** * @see _.ary */ ary(n?: number): Function<(...args: any[]) => any>; } interface FunctionChain any> { /** * @see _.ary */ ary(n?: number): FunctionChain<(...args: any[]) => any>; } interface LoDashStatic { /** * Creates a function that invokes func, with the this binding and arguments of the created function, while * it’s called less than n times. Subsequent calls to the created function return the result of the last func * invocation. * * @param n The number of calls at which func is no longer invoked. * @param func The function to restrict. * @return Returns the new restricted function. */ before any>(n: number, func: TFunc): TFunc; } interface Primitive { /** * @see _.before */ before any>(func: TFunc): Function; } interface PrimitiveChain { /** * @see _.before */ before any>(func: TFunc): FunctionChain; } interface FunctionBind { /** * @see _.placeholder */ placeholder: __; (func: (...args: any[]) => any, thisArg: any, ...partials: any[]): (...args: any[]) => any; } interface LoDashStatic { /** * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind * arguments to those provided to the bound function. * * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for * partially applied arguments. * * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. * * @param func The function to bind. * @param thisArg The this binding of func. * @param partials The arguments to be partially applied. * @return Returns the new bound function. */ bind: FunctionBind; } interface LoDashImplicitWrapper { /** * @see _.bind */ bind(thisArg: any, ...partials: any[]): Function<(...args: any[]) => any>; } interface LoDashExplicitWrapper { /** * @see _.bind */ bind(thisArg: any, ...partials: any[]): FunctionChain<(...args: any[]) => any>; } interface FunctionBindKey { placeholder: __; (object: object, key: string, ...partials: any[]): (...args: any[]) => any; } interface LoDashStatic { /** * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments * to those provided to the bound function. * * This method differs from _.bind by allowing bound functions to reference methods that may be redefined * or don’t yet exist. See Peter Michaux’s article for more details. * * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder * for partially applied arguments. * * @param object The object the method belongs to. * @param key The key of the method. * @param partials The arguments to be partially applied. * @return Returns the new bound function. */ bindKey: FunctionBindKey; } interface LoDashImplicitWrapper { /** * @see _.bindKey */ bindKey(key: string, ...partials: any[]): Function<(...args: any[]) => any>; } interface LoDashExplicitWrapper { /** * @see _.bindKey */ bindKey(key: string, ...partials: any[]): FunctionChain<(...args: any[]) => any>; } interface Curry { (func: (t1: T1) => R, arity?: number): CurriedFunction1; (func: (t1: T1, t2: T2) => R, arity?: number): CurriedFunction2; (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): CurriedFunction3; (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): CurriedFunction4; (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): CurriedFunction5; (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; placeholder: __; } interface LoDashStatic { curry: Curry; } interface CurriedFunction1 { (): CurriedFunction1; (t1: T1): R; } interface CurriedFunction2 { (): CurriedFunction2; (t1: T1): CurriedFunction1; (t1: __, t2: T2): CurriedFunction1; (t1: T1, t2: T2): R; } interface CurriedFunction3 { (): CurriedFunction3; (t1: T1): CurriedFunction2; (t1: __, t2: T2): CurriedFunction2; (t1: T1, t2: T2): CurriedFunction1; (t1: __, t2: __, t3: T3): CurriedFunction2; (t1: T1, t2: __, t3: T3): CurriedFunction1; (t1: __, t2: T2, t3: T3): CurriedFunction1; (t1: T1, t2: T2, t3: T3): R; } interface CurriedFunction4 { (): CurriedFunction4; (t1: T1): CurriedFunction3; (t1: __, t2: T2): CurriedFunction3; (t1: T1, t2: T2): CurriedFunction2; (t1: __, t2: __, t3: T3): CurriedFunction3; (t1: __, t2: __, t3: T3): CurriedFunction2; (t1: __, t2: T2, t3: T3): CurriedFunction2; (t1: T1, t2: T2, t3: T3): CurriedFunction1; (t1: __, t2: __, t3: __, t4: T4): CurriedFunction3; (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction2; (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction2; (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction2; (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction1; (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction1; (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4): R; } interface CurriedFunction5 { (): CurriedFunction5; (t1: T1): CurriedFunction4; (t1: __, t2: T2): CurriedFunction4; (t1: T1, t2: T2): CurriedFunction3; (t1: __, t2: __, t3: T3): CurriedFunction4; (t1: T1, t2: __, t3: T3): CurriedFunction3; (t1: __, t2: T2, t3: T3): CurriedFunction3; (t1: T1, t2: T2, t3: T3): CurriedFunction2; (t1: __, t2: __, t3: __, t4: T4): CurriedFunction4; (t1: T1, t2: __, t3: __, t4: T4): CurriedFunction3; (t1: __, t2: T2, t3: __, t4: T4): CurriedFunction3; (t1: __, t2: __, t3: T3, t4: T4): CurriedFunction3; (t1: T1, t2: T2, t3: __, t4: T4): CurriedFunction2; (t1: T1, t2: __, t3: T3, t4: T4): CurriedFunction2; (t1: __, t2: T2, t3: T3, t4: T4): CurriedFunction2; (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; (t1: __, t2: __, t3: __, t4: __, t5: T5): CurriedFunction4; (t1: T1, t2: __, t3: __, t4: __, t5: T5): CurriedFunction3; (t1: __, t2: T2, t3: __, t4: __, t5: T5): CurriedFunction3; (t1: __, t2: __, t3: T3, t4: __, t5: T5): CurriedFunction3; (t1: __, t2: __, t3: __, t4: T4, t5: T5): CurriedFunction3; (t1: T1, t2: T2, t3: __, t4: __, t5: T5): CurriedFunction2; (t1: T1, t2: __, t3: T3, t4: __, t5: T5): CurriedFunction2; (t1: T1, t2: __, t3: __, t4: T4, t5: T5): CurriedFunction2; (t1: __, t2: T2, t3: T3, t4: __, t5: T5): CurriedFunction2; (t1: __, t2: T2, t3: __, t4: T4, t5: T5): CurriedFunction2; (t1: __, t2: __, t3: T3, t4: T4, t5: T5): CurriedFunction2; (t1: T1, t2: T2, t3: T3, t4: __, t5: T5): CurriedFunction1; (t1: T1, t2: T2, t3: __, t4: T4, t5: T5): CurriedFunction1; (t1: T1, t2: __, t3: T3, t4: T4, t5: T5): CurriedFunction1; (t1: __, t2: T2, t3: T3, t4: T4, t5: T5): CurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } interface RightCurriedFunction1 { (): RightCurriedFunction1; (t1: T1): R; } interface RightCurriedFunction2 { (): RightCurriedFunction2; (t2: T2): RightCurriedFunction1; (t1: T1, t2: __): RightCurriedFunction1; (t1: T1, t2: T2): R; } interface RightCurriedFunction3 { (): RightCurriedFunction3; (t3: T3): RightCurriedFunction2; (t2: T2, t3: __): RightCurriedFunction2; (t2: T2, t3: T3): RightCurriedFunction1; (t1: T1, t2: __, t3: __): RightCurriedFunction2; (t1: T1, t2: T2, t3: __): RightCurriedFunction1; (t1: T1, t2: __, t3: T3): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3): R; } interface RightCurriedFunction4 { (): RightCurriedFunction4; (t4: T4): RightCurriedFunction3; (t3: T3, t4: __): RightCurriedFunction3; (t3: T3, t4: T4): RightCurriedFunction2; (t2: T2, t3: __, t4: __): RightCurriedFunction3; (t2: T2, t3: T3, t4: __): RightCurriedFunction2; (t2: T2, t3: __, t4: T4): RightCurriedFunction2; (t2: T2, t3: T3, t4: T4): RightCurriedFunction1; (t1: T1, t2: __, t3: __, t4: __): RightCurriedFunction3; (t1: T1, t2: T2, t3: __, t4: __): RightCurriedFunction2; (t1: T1, t2: __, t3: T3, t4: __): RightCurriedFunction2; (t1: T1, t2: __, t3: __, t4: T4): RightCurriedFunction2; (t1: T1, t2: T2, t3: T3, t4: __): RightCurriedFunction1; (t1: T1, t2: T2, t3: __, t4: T4): RightCurriedFunction1; (t1: T1, t2: __, t3: T3, t4: T4): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4): R; } interface RightCurriedFunction5 { (): RightCurriedFunction5; (t5: T5): RightCurriedFunction4; (t4: T4, t5: __): RightCurriedFunction4; (t4: T4, t5: T5): RightCurriedFunction3; (t3: T3, t4: __, t5: __): RightCurriedFunction4; (t3: T3, t4: T4, t5: __): RightCurriedFunction3; (t3: T3, t4: __, t5: T5): RightCurriedFunction3; (t3: T3, t4: T4, t5: T5): RightCurriedFunction2; (t2: T2, t3: __, t4: __, t5: __): RightCurriedFunction4; (t2: T2, t3: T3, t4: __, t5: __): RightCurriedFunction3; (t2: T2, t3: __, t4: T4, t5: __): RightCurriedFunction3; (t2: T2, t3: __, t4: __, t5: T5): RightCurriedFunction3; (t2: T2, t3: T3, t4: T4, t5: __): RightCurriedFunction2; (t2: T2, t3: T3, t4: __, t5: T5): RightCurriedFunction2; (t2: T2, t3: __, t4: T4, t5: T5): RightCurriedFunction2; (t2: T2, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; (t1: T1, t2: __, t3: __, t4: __, t5: __): RightCurriedFunction4; (t1: T1, t2: T2, t3: __, t4: __, t5: __): RightCurriedFunction3; (t1: T1, t2: __, t3: T3, t4: __, t5: __): RightCurriedFunction3; (t1: T1, t2: __, t3: __, t4: T4, t5: __): RightCurriedFunction3; (t1: T1, t2: __, t3: __, t4: __, t5: T5): RightCurriedFunction3; (t1: T1, t2: T2, t3: T3, t4: __, t5: __): RightCurriedFunction2; (t1: T1, t2: T2, t3: __, t4: T4, t5: __): RightCurriedFunction2; (t1: T1, t2: T2, t3: __, t4: __, t5: T5): RightCurriedFunction2; (t1: T1, t2: __, t3: T3, t4: T4, t5: __): RightCurriedFunction2; (t1: T1, t2: __, t3: T3, t4: __, t5: T5): RightCurriedFunction2; (t1: T1, t2: __, t3: __, t4: T4, t5: T5): RightCurriedFunction2; (t1: T1, t2: T2, t3: T3, t4: T4, t5: __): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: __, t5: T5): RightCurriedFunction1; (t1: T1, t2: T2, t3: __, t4: T4, t5: T5): RightCurriedFunction1; (t1: T1, t2: __, t3: T3, t4: T4, t5: T5): RightCurriedFunction1; (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; } interface Function any> { /** * @see _.curry */ curry(arity?: number): T extends (arg1: infer T1) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4, arg5: infer T5) => infer R ? Function> : Function<(...args: any[]) => any>; } interface FunctionChain any> { /** * @see _.curry */ curry(arity?: number): T extends (arg1: infer T1) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4, arg5: infer T5) => infer R ? FunctionChain> : FunctionChain<(...args: any[]) => any>; } interface CurryRight { (func: (t1: T1) => R, arity?: number): RightCurriedFunction1; (func: (t1: T1, t2: T2) => R, arity?: number): RightCurriedFunction2; (func: (t1: T1, t2: T2, t3: T3) => R, arity?: number): RightCurriedFunction3; (func: (t1: T1, t2: T2, t3: T3, t4: T4) => R, arity?: number): RightCurriedFunction4; (func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R, arity?: number): RightCurriedFunction5; (func: (...args: any[]) => any, arity?: number): (...args: any[]) => any; placeholder: __; } interface LoDashStatic { curryRight: CurryRight; } interface Function any> { /** * @see _.curryRight */ curryRight(arity?: number): T extends (arg1: infer T1) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4) => infer R ? Function> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4, arg5: infer T5) => infer R ? Function> : Function<(...args: any[]) => any>; } interface FunctionChain any> { /** * @see _.curryRight */ curryRight(arity?: number): T extends (arg1: infer T1) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4) => infer R ? FunctionChain> : T extends (arg1: infer T1, arg2: infer T2, arg3: infer T3, arg4: infer T4, arg5: infer T5) => infer R ? FunctionChain> : FunctionChain<(...args: any[]) => any>; } interface DebounceSettings { /** * @see _.leading */ leading?: boolean | undefined; /** * @see _.maxWait */ maxWait?: number | undefined; /** * @see _.trailing */ trailing?: boolean | undefined; } interface DebounceSettingsLeading extends DebounceSettings { leading: true; } interface DebouncedFunc any> { /** * Call the original function, but applying the debounce rules. * * If the debounced function can be run immediately, this calls it and returns its return * value. * * Otherwise, it returns the return value of the last invocation, or undefined if the debounced * function was not invoked yet. */ (...args: Parameters): ReturnType | undefined; /** * Throw away any pending invocation of the debounced function. */ cancel(): void; /** * If there is a pending invocation of the debounced function, invoke it immediately and return * its return value. * * Otherwise, return the value from the last invocation, or undefined if the debounced function * was never invoked. */ flush(): ReturnType | undefined; } interface DebouncedFuncLeading any> extends DebouncedFunc { (...args: Parameters): ReturnType; flush(): ReturnType; } interface LoDashStatic { /** * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since * the last time the debounced function was invoked. The debounced function comes with a cancel method to * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent * calls to the debounced function return the result of the last func invocation. * * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only * if the the debounced function is invoked more than once during the wait timeout. * * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. * * @param func The function to debounce. * @param wait The number of milliseconds to delay. * @param options The options object. * @param options.leading Specify invoking on the leading edge of the timeout. * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. * @param options.trailing Specify invoking on the trailing edge of the timeout. * @return Returns the new debounced function. */ debounce any>(func: T, wait: number | undefined, options: DebounceSettingsLeading): DebouncedFuncLeading; debounce any>(func: T, wait?: number, options?: DebounceSettings): DebouncedFunc; } interface Function any> { /** * @see _.debounce */ debounce( wait: number | undefined, options: DebounceSettingsLeading ): T extends (...args: any[]) => any ? Function> : never; debounce( wait?: number, options?: DebounceSettings ): T extends (...args: any[]) => any ? Function> : never; } interface FunctionChain any> { /** * @see _.debounce */ debounce( wait: number | undefined, options: DebounceSettingsLeading ): T extends (...args: any[]) => any ? FunctionChain> : never; debounce( wait?: number, options?: DebounceSettings ): T extends (...args: any[]) => any ? FunctionChain> : never; } interface LoDashStatic { /** * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to * func when it’s invoked. * * @param func The function to defer. * @param args The arguments to invoke the function with. * @return Returns the timer id. */ defer(func: (...args: any[]) => any, ...args: any[]): number; } interface LoDashImplicitWrapper { /** * @see _.defer */ defer(...args: any[]): Primitive; } interface LoDashExplicitWrapper { /** * @see _.defer */ defer(...args: any[]): PrimitiveChain; } interface LoDashStatic { /** * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. * * @param func The function to delay. * @param wait The number of milliseconds to delay invocation. * @param args The arguments to invoke the function with. * @return Returns the timer id. */ delay(func: (...args: any[]) => any, wait: number, ...args: any[]): number; } interface LoDashImplicitWrapper { /** * @see _.delay */ delay(wait: number, ...args: any[]): Primitive; } interface LoDashExplicitWrapper { /** * @see _.delay */ delay(wait: number, ...args: any[]): PrimitiveChain; } interface LoDashStatic { /** * Creates a function that invokes `func` with arguments reversed. * * @category Function * @param func The function to flip arguments for. * @returns Returns the new function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ flip any>(func: T): T; } interface Function any> { /** * @see _.flip */ flip(): this; } interface FunctionChain any> { /** * @see _.flip */ flip(): this; } interface MemoizedFunction { /** * @see _.cache */ cache: MapCache; } interface LoDashStatic { /** * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for * storing the result based on the arguments provided to the memoized function. By default, the first argument * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with * the this binding of the memoized function. * * @param func The function to have its output memoized. * @param resolver The function to resolve the cache key. * @return Returns the new memoizing function. */ memoize: { any>(func: T, resolver?: (...args: Parameters) => any): T & MemoizedFunction; Cache: MapCacheConstructor; }; } interface Function any> { /** * @see _.memoize */ memoize(resolver?: (...args: any[]) => any): Function; } interface FunctionChain any> { /** * @see _.memoize */ memoize(resolver?: (...args: any[]) => any): FunctionChain; } interface LoDashStatic { /** * Creates a function that negates the result of the predicate func. The func predicate is invoked with * the this binding and arguments of the created function. * * @param predicate The predicate to negate. * @return Returns the new function. */ negate(predicate: (...args: T) => boolean): (...args: T) => boolean; } interface Function any> { /** * @see _.negate */ negate(): Function<(...args: Parameters) => boolean>; } interface FunctionChain any> { /** * @see _.negate */ negate(): FunctionChain<(...args: Parameters) => boolean>; } interface LoDashStatic { /** * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value * of the first call. The func is invoked with the this binding and arguments of the created function. * * @param func The function to restrict. * @return Returns the new restricted function. */ once any>(func: T): T; } interface Function any> { /** * @see _.once */ once(): Function; } interface FunctionChain any> { /** * @see _.once */ once(): FunctionChain; } interface LoDashStatic { /** * Creates a function that runs each argument through a corresponding transform function. * * @param func The function to wrap. * @param transforms The functions to transform arguments, specified as individual functions or arrays * of functions. * @return Returns the new function. */ overArgs(func: (...args: any[]) => any, ...transforms: Array any>>): (...args: any[]) => any; } interface Function any> { /** * @see _.overArgs */ overArgs(...transforms: Array any>>): Function<(...args: any[]) => any>; } interface FunctionChain any> { /** * @see _.overArgs */ overArgs(...transforms: Array any>>): FunctionChain<(...args: any[]) => any>; } interface LoDashStatic { /** * Creates a function that, when called, invokes func with any additional partial arguments * prepended to those provided to the new function. This method is similar to _.bind except * it does not alter the this binding. * @param func The function to partially apply arguments to. * @param args Arguments to be partially applied. * @return The new partially applied function. */ partial: Partial; } type __ = LoDashStatic; type Function0 = () => R; type Function1 = (t1: T1) => R; type Function2 = (t1: T1, t2: T2) => R; type Function3 = (t1: T1, t2: T2, t3: T3) => R; type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; interface Partial { (func: Function2, plc1: __, arg2: T2): Function1; (func: Function3, plc1: __, arg2: T2): Function2; (func: Function3, plc1: __, plc2: __, arg3: T3): Function2; (func: Function3, arg1: T1, plc2: __, arg3: T3): Function1; (func: Function3, plc1: __, arg2: T2, arg3: T3): Function1; (func: Function4, plc1: __, arg2: T2): Function3; (func: Function4, plc1: __, plc2: __, arg3: T3): Function3; (func: Function4, arg1: T1, plc2: __, arg3: T3): Function2; (func: Function4, plc1: __, arg2: T2, arg3: T3): Function2; (func: Function4, plc1: __, plc2: __, plc3: __, arg4: T4): Function3; (func: Function4, arg1: T1, plc2: __, plc3: __, arg4: T4): Function2; (func: Function4, plc1: __, arg2: T2, plc3: __, arg4: T4): Function2; (func: Function4, arg1: T1, arg2: T2, plc3: __, arg4: T4): Function1; (func: Function4, plc1: __, plc2: __, arg3: T3, arg4: T4): Function2; (func: Function4, arg1: T1, plc2: __, arg3: T3, arg4: T4): Function1; (func: Function4, plc1: __, arg2: T2, arg3: T3, arg4: T4): Function1; (func: (...ts: TS) => R): (...ts: TS) => R; (func: (t1: T1, ...ts: TS) => R, arg1: T1): (...ts: TS) => R; (func: (t1: T1, t2: T2, ...ts: TS) => R, t1: T1, t2: T2): (...ts: TS) => R; (func: (t1: T1, t2: T2, t3: T3, ...ts: TS) => R, t1: T1, t2: T2, t3: T3): (...ts: TS) => R; (func: (t1: T1, t2: T2, t3: T3, t4: T4, ...ts: TS) => R, t1: T1, t2: T2, t3: T3, t4: T4): (...ts: TS) => R; placeholder: __; } interface Function any> { /** * @see _.partial */ partial(plc1: __, arg2: T2): Function< T extends Function2 ? Function1 : T extends Function3 ? Function2 : T extends Function4 ? Function3 : any >; /** * @see _.partial */ partial(plc1: __, plc2: __, arg3: T3): Function< T extends Function3 ? Function2 : T extends Function4 ? Function3 : any >; /** * @see _.partial */ partial(arg1: T1, plc2: __, arg3: T3): Function< T extends Function3 ? Function1 : T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(plc1: __, arg2: T2, arg3: T3): Function< T extends Function3 ? Function1 : T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(plc1: __, plc2: __, arg3: T3): Function< T extends Function4 ? Function3 : any >; /** * @see _.partial */ partial(arg1: T1, plc2: __, plc3: __, arg4: T4): Function< T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(plc1: __, arg2: T2, plc3: __, arg4: T4): Function< T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2, plc3: __, arg4: T4): Function< T extends Function4 ? Function1 : any >; /** * @see _.partial */ partial(plc1: __, plc2: __, arg3: T3, arg4: T4): Function< T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(arg1: T1, plc2: __, arg3: T3, arg4: T4): Function< T extends Function4 ? Function1 : any >; /** * @see _.partial */ partial(plc1: __, arg2: T2, arg3: T3, arg4: T4): Function< T extends Function4 ? Function1 : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function< T extends (t1: T1, t2: T2, t3: T3, t4: T4, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2, arg3: T3): Function< T extends (t1: T1, t2: T2, t3: T3, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2): Function< T extends (t1: T1, t2: T2, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(arg1: T1): Function< T extends (t1: T1, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(): Function any ? T : any>; } interface FunctionChain any> { /** * @see _.partial */ partial(plc1: __, arg2: T2): FunctionChain< T extends Function2 ? Function1 : T extends Function3 ? Function2 : T extends Function4 ? Function3 : any >; /** * @see _.partial */ partial(plc1: __, plc2: __, arg3: T3): FunctionChain< T extends Function3 ? Function2 : T extends Function4 ? Function3 : any >; /** * @see _.partial */ partial(arg1: T1, plc2: __, arg3: T3): FunctionChain< T extends Function3 ? Function1 : T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(plc1: __, arg2: T2, arg3: T3): FunctionChain< T extends Function3 ? Function1 : T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(plc1: __, plc2: __, arg3: T3): FunctionChain< T extends Function4 ? Function3 : any >; /** * @see _.partial */ partial(arg1: T1, plc2: __, plc3: __, arg4: T4): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(plc1: __, arg2: T2, plc3: __, arg4: T4): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2, plc3: __, arg4: T4): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partial */ partial(plc1: __, plc2: __, arg3: T3, arg4: T4): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partial */ partial(arg1: T1, plc2: __, arg3: T3, arg4: T4): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partial */ partial(plc1: __, arg2: T2, arg3: T3, arg4: T4): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2, arg3: T3, arg4: T4): FunctionChain< T extends (t1: T1, t2: T2, t3: T3, t4: T4, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2, arg3: T3): FunctionChain< T extends (t1: T1, t2: T2, t3: T3, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(arg1: T1, arg2: T2): FunctionChain< T extends (t1: T1, t2: T2, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(arg1: T1): FunctionChain< T extends (t1: T1, ...ts: infer TS) => infer R ? (...ts: TS) => R : any >; /** * @see _.partial */ partial(): FunctionChain any ? T : any>; } interface LoDashStatic { /** * This method is like _.partial except that partial arguments are appended to those provided * to the new function. * @param func The function to partially apply arguments to. * @param args Arguments to be partially applied. * @return The new partially applied function. */ partialRight: PartialRight; } interface PartialRight { (func: Function0): Function0; (func: Function1): Function1; (func: Function1, arg1: T1): Function0; (func: Function2): Function2; (func: Function2, arg1: T1, plc2: __): Function1; (func: Function2, arg2: T2): Function1; (func: Function2, arg1: T1, arg2: T2): Function0; (func: Function3): Function3; (func: Function3, arg1: T1, plc2: __, plc3: __): Function2; (func: Function3, arg2: T2, plc3: __): Function2; (func: Function3, arg1: T1, arg2: T2, plc3: __): Function1; (func: Function3, arg3: T3): Function2; (func: Function3, arg1: T1, plc2: __, arg3: T3): Function1; (func: Function3, arg2: T2, arg3: T3): Function1; (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0; (func: Function4): Function4; (func: Function4, arg1: T1, plc2: __, plc3: __, plc4: __): Function3; (func: Function4, arg2: T2, plc3: __, plc4: __): Function3; (func: Function4, arg1: T1, arg2: T2, plc3: __, plc4: __): Function2; (func: Function4, arg3: T3, plc4: __): Function3; (func: Function4, arg1: T1, plc2: __, arg3: T3, plc4: __): Function2; (func: Function4, arg2: T2, arg3: T3, plc4: __): Function2; (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: __): Function1; (func: Function4, arg4: T4): Function3; (func: Function4, arg1: T1, plc2: __, plc3: __, arg4: T4): Function2; (func: Function4, arg2: T2, plc3: __, arg4: T4): Function2; (func: Function4, arg1: T1, arg2: T2, plc3: __, arg4: T4): Function1; (func: Function4, arg3: T3, arg4: T4): Function2; (func: Function4, arg1: T1, plc2: __, arg3: T3, arg4: T4): Function1; (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0; (func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any; placeholder: __; } interface Function any> { /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __): Function< T extends Function2 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg2: T2): Function< T extends Function2 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, plc3: __): Function< T extends Function3 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, plc3: __): Function< T extends Function3 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, plc3: __): Function< T extends Function3 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg3: T3): Function< T extends Function3 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, arg3: T3): Function< T extends Function3 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, arg3: T3): Function< T extends Function3 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, plc3: __, plc4: __): Function< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, plc3: __, plc4: __): Function< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, plc3: __, plc4: __): Function< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg3: T3, plc4: __): Function< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, arg3: T3, plc4: __): Function< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, arg3: T3, plc4: __): Function< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, arg3: T3, plc4: __): Function< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg4: T4): Function< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, plc3: __, arg4: T4): Function< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, plc3: __, arg4: T4): Function< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, plc3: __, arg4: T4): Function< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg3: T3, arg4: T4): Function< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, arg3: T3, arg4: T4): Function< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, arg3: T3, arg4: T4): Function< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(...ts: TS): Function infer R ? () => R : any>; /** * @see _.partialRight */ partialRight(): Function any ? T : any>; } interface FunctionChain any> { /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __): FunctionChain< T extends Function2 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg2: T2): FunctionChain< T extends Function2 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, plc3: __): FunctionChain< T extends Function3 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, plc3: __): FunctionChain< T extends Function3 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, plc3: __): FunctionChain< T extends Function3 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg3: T3): FunctionChain< T extends Function3 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, arg3: T3): FunctionChain< T extends Function3 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, arg3: T3): FunctionChain< T extends Function3 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, plc3: __, plc4: __): FunctionChain< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, plc3: __, plc4: __): FunctionChain< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, plc3: __, plc4: __): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg3: T3, plc4: __): FunctionChain< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, arg3: T3, plc4: __): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, arg3: T3, plc4: __): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, arg3: T3, plc4: __): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg4: T4): FunctionChain< T extends Function4 ? Function3 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, plc3: __, arg4: T4): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, plc3: __, arg4: T4): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, arg2: T2, plc3: __, arg4: T4): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg3: T3, arg4: T4): FunctionChain< T extends Function4 ? Function2 : any >; /** * @see _.partialRight */ partialRight(arg1: T1, plc2: __, arg3: T3, arg4: T4): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(arg2: T2, arg3: T3, arg4: T4): FunctionChain< T extends Function4 ? Function1 : any >; /** * @see _.partialRight */ partialRight(...ts: TS): FunctionChain infer R ? () => R : any>; /** * @see _.partialRight */ partialRight(): FunctionChain any ? T : any>; } interface LoDashStatic { /** * Creates a function that invokes func with arguments arranged according to the specified indexes where the * argument value at the first index is provided as the first argument, the argument value at the second index * is provided as the second argument, and so on. * @param func The function to rearrange arguments for. * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. * @return Returns the new function. */ rearg(func: (...args: any[]) => any, ...indexes: Array>): (...args: any[]) => any; } interface Function any> { /** * @see _.rearg */ rearg(...indexes: Array>): Function<(...args: any[]) => any>; } interface FunctionChain any> { /** * @see _.rearg */ rearg(...indexes: Array>): FunctionChain<(...args: any[]) => any>; } interface LoDashStatic { /** * Creates a function that invokes func with the this binding of the created function and arguments from start * and beyond provided as an array. * * Note: This method is based on the rest parameter. * * @param func The function to apply a rest parameter to. * @param start The start position of the rest parameter. * @return Returns the new function. */ rest(func: (...args: any[]) => any, start?: number): (...args: any[]) => any; } interface Function any> { /** * @see _.rest */ rest(start?: number): Function<(...args: any[]) => any>; } interface FunctionChain any> { /** * @see _.rest */ rest(start?: number): FunctionChain<(...args: any[]) => any>; } interface LoDashStatic { /** * Creates a function that invokes func with the this binding of the created function and an array of arguments * much like Function#apply. * * Note: This method is based on the spread operator. * * @param func The function to spread arguments over. * @return Returns the new function. */ spread(func: (...args: any[]) => TResult, start?: number): (...args: any[]) => TResult; } interface Function any> { /** * @see _.spread */ spread(start?: number): Function<(...args: any[]) => ReturnType>; } interface FunctionChain any> { /** * @see _.spread */ spread(start?: number): FunctionChain<(...args: any[]) => ReturnType>; } interface ThrottleSettings { /** * @see _.leading */ leading?: boolean | undefined; /** * @see _.trailing */ trailing?: boolean | undefined; } type ThrottleSettingsLeading = (ThrottleSettings & { leading: true }) | Omit interface LoDashStatic { /** * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. * * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if * the the throttled function is invoked more than once during the wait timeout. * * @param func The function to throttle. * @param wait The number of milliseconds to throttle invocations to. * @param options The options object. * @param options.leading Specify invoking on the leading edge of the timeout. * @param options.trailing Specify invoking on the trailing edge of the timeout. * @return Returns the new throttled function. */ throttle any>(func: T, wait?: number, options?: ThrottleSettingsLeading): DebouncedFuncLeading; throttle any>(func: T, wait?: number, options?: ThrottleSettings): DebouncedFunc; } interface Function any> { /** * @see _.throttle */ throttle( wait?: number, options?: ThrottleSettingsLeading ): T extends (...args: any[]) => any ? Function> : never; throttle( wait?: number, options?: ThrottleSettings ): T extends (...args: any[]) => any ? Function> : never; } interface FunctionChain any> { /** * @see _.throttle */ throttle( wait?: number, options?: ThrottleSettingsLeading ): T extends (...args: any[]) => any ? FunctionChain> : never; throttle( wait?: number, options?: ThrottleSettings ): T extends (...args: any[]) => any ? FunctionChain> : never; } interface LoDashStatic { /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @category Function * @param func The function to cap arguments for. * @returns Returns the new function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ unary(func: (arg1: T, ...args: any[]) => TResult): (arg1: T) => TResult; } interface Function any> { /** * @see _.unary */ unary(): Function<(arg1: Parameters['0']) => ReturnType>; } interface FunctionChain any> { /** * @see _.unary */ unary(): FunctionChain<(arg1: Parameters['0']) => ReturnType>; } interface LoDashStatic { /** * Creates a function that provides value to the wrapper function as its first argument. Any additional * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is * invoked with the this binding of the created function. * * @param value The value to wrap. * @param wrapper The wrapper function. * @return Returns the new function. */ wrap(value: T, wrapper: (value: T, ...args: TArgs[]) => TResult): (...args: TArgs[]) => TResult; } interface LoDashImplicitWrapper { /** * @see _.wrap */ wrap(wrapper: (value: TValue, ...args: TArgs[]) => TResult): Function<(...args: TArgs[]) => TResult>; } interface LoDashExplicitWrapper { /** * @see _.wrap */ wrap(wrapper: (value: TValue, ...args: TArgs[]) => TResult): FunctionChain<(...args: TArgs[]) => TResult>; } }