mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-04 16:04:45 +08:00
Merge pull request #7215 from chrootsu/lodash-some
lodash: signatures of _.some have been changed
This commit is contained in:
@@ -2694,9 +2694,11 @@ module TestAny {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let dictionary: _.Dictionary<TResult>;
|
||||
let numericDictionary: _.NumericDictionary<TResult>;
|
||||
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => boolean;
|
||||
let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary<TResult>) => boolean;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
@@ -2719,6 +2721,12 @@ module TestAny {
|
||||
result = _.any<TResult>(dictionary, '');
|
||||
result = _.any<{a: number}, TResult>(dictionary, {a: 42});
|
||||
|
||||
result = _.any<TResult>(numericDictionary);
|
||||
result = _.any<TResult>(numericDictionary, numericDictionaryIterator);
|
||||
result = _.any<TResult>(numericDictionary, numericDictionaryIterator, any);
|
||||
result = _.any<TResult>(numericDictionary, '');
|
||||
result = _.any<{a: number}, TResult>(numericDictionary, {a: 42});
|
||||
|
||||
result = _(array).any();
|
||||
result = _(array).any(listIterator);
|
||||
result = _(array).any(listIterator, any);
|
||||
@@ -2736,6 +2744,12 @@ module TestAny {
|
||||
result = _(dictionary).any<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).any('');
|
||||
result = _(dictionary).any<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).any<TResult>();
|
||||
result = _(numericDictionary).any<TResult>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).any<TResult>(numericDictionaryIterator, any);
|
||||
result = _(numericDictionary).any('');
|
||||
result = _(numericDictionary).any<{a: number}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
@@ -2758,6 +2772,12 @@ module TestAny {
|
||||
result = _(dictionary).chain().any<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).chain().any('');
|
||||
result = _(dictionary).chain().any<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).chain().any<TResult>();
|
||||
result = _(numericDictionary).chain().any<TResult>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).chain().any<TResult>(numericDictionaryIterator, any);
|
||||
result = _(numericDictionary).chain().any('');
|
||||
result = _(numericDictionary).chain().any<{a: number}>({a: 42});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4378,9 +4398,11 @@ module TestSome {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let dictionary: _.Dictionary<TResult>;
|
||||
let numericDictionary: _.NumericDictionary<TResult>;
|
||||
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => boolean;
|
||||
let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary<TResult>) => boolean;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
@@ -4403,6 +4425,12 @@ module TestSome {
|
||||
result = _.some<TResult>(dictionary, '');
|
||||
result = _.some<{a: number}, TResult>(dictionary, {a: 42});
|
||||
|
||||
result = _.some<TResult>(numericDictionary);
|
||||
result = _.some<TResult>(numericDictionary, numericDictionaryIterator);
|
||||
result = _.some<TResult>(numericDictionary, numericDictionaryIterator, any);
|
||||
result = _.some<TResult>(numericDictionary, '');
|
||||
result = _.some<{a: number}, TResult>(numericDictionary, {a: 42});
|
||||
|
||||
result = _(array).some();
|
||||
result = _(array).some(listIterator);
|
||||
result = _(array).some(listIterator, any);
|
||||
@@ -4420,6 +4448,12 @@ module TestSome {
|
||||
result = _(dictionary).some<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).some('');
|
||||
result = _(dictionary).some<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).some<TResult>();
|
||||
result = _(numericDictionary).some<TResult>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).some<TResult>(numericDictionaryIterator, any);
|
||||
result = _(numericDictionary).some('');
|
||||
result = _(numericDictionary).some<{a: number}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
@@ -4442,6 +4476,12 @@ module TestSome {
|
||||
result = _(dictionary).chain().some<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).chain().some('');
|
||||
result = _(dictionary).chain().some<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).chain().some<TResult>();
|
||||
result = _(numericDictionary).chain().some<TResult>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).chain().some<TResult>(numericDictionaryIterator, any);
|
||||
result = _(numericDictionary).chain().some('');
|
||||
result = _(numericDictionary).chain().some<{a: number}>({a: 42});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+38
-12
@@ -4062,7 +4062,16 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
any<T>(
|
||||
collection: List<T>|Dictionary<T>,
|
||||
collection: NumericDictionary<T>,
|
||||
predicate?: NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
any<T>(
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
@@ -4071,7 +4080,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
any<TObject extends {}, T>(
|
||||
collection: List<T>|Dictionary<T>,
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: TObject
|
||||
): boolean;
|
||||
}
|
||||
@@ -4081,7 +4090,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
any(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
|
||||
@@ -4106,7 +4115,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
any<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
|
||||
@@ -4131,7 +4140,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
any(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
@@ -4156,7 +4165,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
any<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
@@ -7477,7 +7486,16 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some<T>(
|
||||
collection: List<T>|Dictionary<T>,
|
||||
collection: NumericDictionary<T>,
|
||||
predicate?: NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
some<T>(
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
@@ -7486,7 +7504,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some<TObject extends {}, T>(
|
||||
collection: List<T>|Dictionary<T>,
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: TObject
|
||||
): boolean;
|
||||
}
|
||||
@@ -7496,7 +7514,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
|
||||
@@ -7521,7 +7539,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): boolean;
|
||||
|
||||
@@ -7546,7 +7564,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
@@ -7571,7 +7589,7 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
@@ -13751,6 +13769,10 @@ declare module _ {
|
||||
(value: T, key?: string, collection?: Dictionary<T>): TResult;
|
||||
}
|
||||
|
||||
interface NumericDictionaryIterator<T, TResult> {
|
||||
(value: T, key?: number, collection?: Dictionary<T>): TResult;
|
||||
}
|
||||
|
||||
interface ObjectIterator<T, TResult> {
|
||||
(element: T, key?: string, collection?: any): TResult;
|
||||
}
|
||||
@@ -13785,6 +13807,10 @@ declare module _ {
|
||||
[index: string]: T;
|
||||
}
|
||||
|
||||
interface NumericDictionary<T> {
|
||||
[index: number]: T;
|
||||
}
|
||||
|
||||
interface StringRepresentable {
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user