mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
lodash: _.nthArg added
This commit is contained in:
@@ -9881,6 +9881,29 @@ module TestNoop {
|
||||
}
|
||||
}
|
||||
|
||||
namespace TestNthArg {
|
||||
type SampleFunc = (...args: any[]) => any;
|
||||
|
||||
{
|
||||
let result: SampleFunc;
|
||||
|
||||
result = _.nthArg<SampleFunc>();
|
||||
result = _.nthArg<SampleFunc>(1);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<SampleFunc>;
|
||||
|
||||
result = _(1).nthArg<SampleFunc>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<SampleFunc>;
|
||||
|
||||
result = _(1).chain().nthArg<SampleFunc>();
|
||||
}
|
||||
}
|
||||
|
||||
// _.over
|
||||
namespace TestOver {
|
||||
{
|
||||
|
||||
Vendored
+25
@@ -16195,6 +16195,31 @@ declare module _ {
|
||||
noop(...args: any[]): _.LoDashExplicitWrapper<void>;
|
||||
}
|
||||
|
||||
//_.nthArg
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates a function that returns its nth argument.
|
||||
*
|
||||
* @param n The index of the argument to return.
|
||||
* @return Returns the new function.
|
||||
*/
|
||||
nthArg<TResult extends Function>(n?: number): TResult;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.nthArg
|
||||
*/
|
||||
nthArg<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.nthArg
|
||||
*/
|
||||
nthArg<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.over
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user