mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
lodash: signatures of _.findKey have been changed
This commit is contained in:
+26
-2
@@ -6008,10 +6008,9 @@ module TestExtend {
|
||||
|
||||
// _.findKey
|
||||
module TestFindKey {
|
||||
let result: string;
|
||||
|
||||
{
|
||||
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
|
||||
let result: string;
|
||||
|
||||
result = _.findKey<{a: string;}>({a: ''});
|
||||
|
||||
@@ -6038,6 +6037,7 @@ module TestFindKey {
|
||||
|
||||
{
|
||||
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
|
||||
let result: string;
|
||||
|
||||
result = _.findKey<string, {a: string;}>({a: ''}, predicateFn);
|
||||
result = _.findKey<string, {a: string;}>({a: ''}, predicateFn, any);
|
||||
@@ -6045,6 +6045,30 @@ module TestFindKey {
|
||||
result = _<{a: string;}>({a: ''}).findKey<string>(predicateFn);
|
||||
result = _<{a: string;}>({a: ''}).findKey<string>(predicateFn, any);
|
||||
}
|
||||
|
||||
{
|
||||
let predicateFn: (value: any, key?: string, object?: {}) => boolean;
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey();
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn);
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any);
|
||||
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey('');
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey('', any);
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey<{a: number;}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
let predicateFn: (value: string, key?: string, collection?: _.Dictionary<string>) => boolean;
|
||||
let result: _.LoDashExplicitWrapper<string>;
|
||||
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey<string>(predicateFn);
|
||||
result = _<{a: string;}>({a: ''}).chain().findKey<string>(predicateFn, any);
|
||||
}
|
||||
}
|
||||
|
||||
// _.findLastKey
|
||||
|
||||
Vendored
+33
@@ -10396,6 +10396,39 @@ declare module _ {
|
||||
): string;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey<TValues>(
|
||||
predicate?: DictionaryIterator<TValues, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<string>;
|
||||
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey(
|
||||
predicate?: ObjectIterator<any, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<string>;
|
||||
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<string>;
|
||||
|
||||
/**
|
||||
* @see _.findKey
|
||||
*/
|
||||
findKey<TWhere extends Dictionary<any>>(
|
||||
predicate?: TWhere
|
||||
): LoDashExplicitWrapper<string>;
|
||||
}
|
||||
|
||||
//_.findLastKey
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user