mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
lodash: signatures of the method _.findIndex changed
This commit is contained in:
+46
-25
@@ -313,35 +313,56 @@ module TestFindIndex {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let predicateFn: (value: TResult, index?: number, collection?: _.List<TResult>) => boolean;
|
||||
let result: number;
|
||||
|
||||
result = _.findIndex<TResult>(array);
|
||||
result = _.findIndex<TResult>(array, predicateFn);
|
||||
result = _.findIndex<TResult>(array, predicateFn, any);
|
||||
result = _.findIndex<TResult>(array, '');
|
||||
result = _.findIndex<TResult>(array, '', any);
|
||||
result = _.findIndex<{a: number}, TResult>(array, {a: 42});
|
||||
{
|
||||
let result: number;
|
||||
|
||||
result = _.findIndex<TResult>(list);
|
||||
result = _.findIndex<TResult>(list, predicateFn);
|
||||
result = _.findIndex<TResult>(list, predicateFn, any);
|
||||
result = _.findIndex<TResult>(list, '');
|
||||
result = _.findIndex<TResult>(list, '', any);
|
||||
result = _.findIndex<{a: number}, TResult>(list, {a: 42});
|
||||
result = _.findIndex<TResult>(array);
|
||||
result = _.findIndex<TResult>(array, predicateFn);
|
||||
result = _.findIndex<TResult>(array, predicateFn, any);
|
||||
result = _.findIndex<TResult>(array, '');
|
||||
result = _.findIndex<TResult>(array, '', any);
|
||||
result = _.findIndex<{a: number}, TResult>(array, {a: 42});
|
||||
|
||||
result = _<TResult>(array).findIndex();
|
||||
result = _<TResult>(array).findIndex(predicateFn);
|
||||
result = _<TResult>(array).findIndex(predicateFn, any);
|
||||
result = _<TResult>(array).findIndex('');
|
||||
result = _<TResult>(array).findIndex('', any);
|
||||
result = _<TResult>(array).findIndex<{a: number}>({a: 42});
|
||||
result = _.findIndex<TResult>(list);
|
||||
result = _.findIndex<TResult>(list, predicateFn);
|
||||
result = _.findIndex<TResult>(list, predicateFn, any);
|
||||
result = _.findIndex<TResult>(list, '');
|
||||
result = _.findIndex<TResult>(list, '', any);
|
||||
result = _.findIndex<{a: number}, TResult>(list, {a: 42});
|
||||
|
||||
result = _(list).findIndex();
|
||||
result = _(list).findIndex<TResult>(predicateFn);
|
||||
result = _(list).findIndex<TResult>(predicateFn, any);
|
||||
result = _(list).findIndex('');
|
||||
result = _(list).findIndex('', any);
|
||||
result = _(list).findIndex<{a: number}>({a: 42});
|
||||
result = _<TResult>(array).findIndex();
|
||||
result = _<TResult>(array).findIndex(predicateFn);
|
||||
result = _<TResult>(array).findIndex(predicateFn, any);
|
||||
result = _<TResult>(array).findIndex('');
|
||||
result = _<TResult>(array).findIndex('', any);
|
||||
result = _<TResult>(array).findIndex<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).findIndex();
|
||||
result = _(list).findIndex<TResult>(predicateFn);
|
||||
result = _(list).findIndex<TResult>(predicateFn, any);
|
||||
result = _(list).findIndex('');
|
||||
result = _(list).findIndex('', any);
|
||||
result = _(list).findIndex<{a: number}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<number>;
|
||||
|
||||
result = _<TResult>(array).chain().findIndex();
|
||||
result = _<TResult>(array).chain().findIndex(predicateFn);
|
||||
result = _<TResult>(array).chain().findIndex(predicateFn, any);
|
||||
result = _<TResult>(array).chain().findIndex('');
|
||||
result = _<TResult>(array).chain().findIndex('', any);
|
||||
result = _<TResult>(array).chain().findIndex<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).chain().findIndex();
|
||||
result = _(list).chain().findIndex<TResult>(predicateFn);
|
||||
result = _(list).chain().findIndex<TResult>(predicateFn, any);
|
||||
result = _(list).chain().findIndex('');
|
||||
result = _(list).chain().findIndex('', any);
|
||||
result = _(list).chain().findIndex<{a: number}>({a: 42});
|
||||
}
|
||||
}
|
||||
|
||||
// _.findLastIndex
|
||||
|
||||
Vendored
+50
@@ -673,6 +673,56 @@ declare module _ {
|
||||
): number;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.findIndex
|
||||
*/
|
||||
findIndex(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<number>;
|
||||
|
||||
/**
|
||||
* @see _.findIndex
|
||||
*/
|
||||
findIndex(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<number>;
|
||||
|
||||
/**
|
||||
* @see _.findIndex
|
||||
*/
|
||||
findIndex<W>(
|
||||
predicate?: W
|
||||
): LoDashExplicitWrapper<number>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.findIndex
|
||||
*/
|
||||
findIndex<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<number>;
|
||||
|
||||
/**
|
||||
* @see _.findIndex
|
||||
*/
|
||||
findIndex(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<number>;
|
||||
|
||||
/**
|
||||
* @see _.findIndex
|
||||
*/
|
||||
findIndex<W>(
|
||||
predicate?: W
|
||||
): LoDashExplicitWrapper<number>;
|
||||
}
|
||||
|
||||
//_.findLastIndex
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user