mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-30 05:27:30 +00:00
Merge pull request #7818 from chrootsu/lodash-nthArg
lodash: _.nthArg added
This commit is contained in:
commit
2bbc03a4e4
@ -9953,6 +9953,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 {
|
||||
{
|
||||
|
||||
25
lodash/lodash.d.ts
vendored
25
lodash/lodash.d.ts
vendored
@ -16308,6 +16308,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 {
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user