mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-24 13:59:25 +08:00
(feature) Removed aliases _.all, _.any, _.backflow, _.callback, _.collect, _.compose, _.contains, _.detect, _.foldl, _.foldr, _.include, _.inject, _.methods, _.object
This commit is contained in:
@@ -1008,134 +1008,6 @@ module TestLastIndexOf {
|
||||
}
|
||||
}
|
||||
|
||||
// _.object
|
||||
module TestObject {
|
||||
let arrayOfKeys: string[];
|
||||
let arrayOfValues: number[];
|
||||
let arrayOfKeyValuePairs: (string|number)[][]
|
||||
|
||||
let listOfKeys: _.List<string>;
|
||||
let listOfValues: _.List<number>;
|
||||
let listOfKeyValuePairs: _.List<_.List<string|number>>;
|
||||
|
||||
{
|
||||
let result: _.Dictionary<void>;
|
||||
|
||||
result = _.object<_.Dictionary<void>>(arrayOfKeys);
|
||||
result = _.object<_.Dictionary<void>>(listOfKeys);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.Dictionary<number>;
|
||||
|
||||
result = _.object<_.Dictionary<number>>(arrayOfKeys, arrayOfValues);
|
||||
result = _.object<_.Dictionary<number>>(arrayOfKeys, listOfValues);
|
||||
result = _.object<_.Dictionary<number>>(listOfKeys, listOfValues);
|
||||
result = _.object<_.Dictionary<number>>(listOfKeys, arrayOfValues);
|
||||
|
||||
result = _.object<number, _.Dictionary<number>>(arrayOfKeys, arrayOfValues);
|
||||
result = _.object<number, _.Dictionary<number>>(arrayOfKeys, listOfValues);
|
||||
result = _.object<number, _.Dictionary<number>>(listOfKeys, listOfValues);
|
||||
result = _.object<number, _.Dictionary<number>>(listOfKeys, arrayOfValues);
|
||||
|
||||
result = _.object<_.Dictionary<number>>(arrayOfKeyValuePairs);
|
||||
result = _.object<_.Dictionary<number>>(listOfKeyValuePairs);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.Dictionary<any>;
|
||||
|
||||
result = _.object(arrayOfKeys);
|
||||
result = _.object(arrayOfKeys, arrayOfValues);
|
||||
result = _.object(arrayOfKeys, listOfValues);
|
||||
|
||||
result = _.object(listOfKeys);
|
||||
result = _.object(listOfKeys, listOfValues);
|
||||
result = _.object(listOfKeys, arrayOfValues);
|
||||
|
||||
result = _.object<_.Dictionary<number>>(arrayOfKeyValuePairs);
|
||||
result = _.object<_.Dictionary<number>>(listOfKeyValuePairs);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<_.Dictionary<void>>;
|
||||
|
||||
result = _(arrayOfKeys).object<_.Dictionary<void>>();
|
||||
result = _(listOfKeys).object<_.Dictionary<void>>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<_.Dictionary<number>>;
|
||||
|
||||
result = _(arrayOfKeys).object<_.Dictionary<number>>(arrayOfValues);
|
||||
result = _(arrayOfKeys).object<_.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).object<_.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).object<_.Dictionary<number>>(arrayOfValues);
|
||||
|
||||
result = _(arrayOfKeys).object<number, _.Dictionary<number>>(arrayOfValues);
|
||||
result = _(arrayOfKeys).object<number, _.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).object<number, _.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).object<number, _.Dictionary<number>>(arrayOfValues);
|
||||
|
||||
result = _(listOfKeys).object<_.Dictionary<number>>(arrayOfKeyValuePairs);
|
||||
result = _(listOfKeys).object<_.Dictionary<number>>(listOfKeyValuePairs);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
|
||||
|
||||
result = _(arrayOfKeys).object();
|
||||
result = _(arrayOfKeys).object(arrayOfValues);
|
||||
result = _(arrayOfKeys).object(listOfValues);
|
||||
|
||||
result = _(listOfKeys).object();
|
||||
result = _(listOfKeys).object(listOfValues);
|
||||
result = _(listOfKeys).object(arrayOfValues);
|
||||
|
||||
result = _(listOfKeys).object(arrayOfKeyValuePairs);
|
||||
result = _(listOfKeys).object(listOfKeyValuePairs);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<_.Dictionary<void>>;
|
||||
|
||||
result = _(arrayOfKeys).chain().object<_.Dictionary<void>>();
|
||||
result = _(listOfKeys).chain().object<_.Dictionary<void>>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<_.Dictionary<number>>;
|
||||
|
||||
result = _(arrayOfKeys).chain().object<_.Dictionary<number>>(arrayOfValues);
|
||||
result = _(arrayOfKeys).chain().object<_.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).chain().object<_.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).chain().object<_.Dictionary<number>>(arrayOfValues);
|
||||
|
||||
result = _(arrayOfKeys).chain().object<number, _.Dictionary<number>>(arrayOfValues);
|
||||
result = _(arrayOfKeys).chain().object<number, _.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).chain().object<number, _.Dictionary<number>>(listOfValues);
|
||||
result = _(listOfKeys).chain().object<number, _.Dictionary<number>>(arrayOfValues);
|
||||
|
||||
result = _(listOfKeys).chain().object<_.Dictionary<number>>(arrayOfKeyValuePairs);
|
||||
result = _(listOfKeys).chain().object<_.Dictionary<number>>(listOfKeyValuePairs);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
|
||||
|
||||
result = _(arrayOfKeys).chain().object();
|
||||
result = _(arrayOfKeys).chain().object(arrayOfValues);
|
||||
result = _(arrayOfKeys).chain().object(listOfValues);
|
||||
|
||||
result = _(listOfKeys).chain().object();
|
||||
result = _(listOfKeys).chain().object(listOfValues);
|
||||
result = _(listOfKeys).chain().object(arrayOfValues);
|
||||
|
||||
result = _(listOfKeys).chain().object(arrayOfKeyValuePairs);
|
||||
result = _(listOfKeys).chain().object(listOfKeyValuePairs);
|
||||
}
|
||||
}
|
||||
|
||||
// _.pull
|
||||
module TestPull {
|
||||
let array: TResult[];
|
||||
@@ -2879,170 +2751,6 @@ module TestValueOf {
|
||||
* Collection *
|
||||
**************/
|
||||
|
||||
// _.all
|
||||
module TestAll {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let dictionary: _.Dictionary<TResult>;
|
||||
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => boolean;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.all<TResult>(array);
|
||||
result = _.all<TResult>(array, listIterator);
|
||||
result = _.all<TResult>(array, listIterator, any);
|
||||
result = _.all<TResult>(array, '');
|
||||
result = _.all<{a: number}, TResult>(array, {a: 42});
|
||||
|
||||
result = _.all<TResult>(list);
|
||||
result = _.all<TResult>(list, listIterator);
|
||||
result = _.all<TResult>(list, listIterator, any);
|
||||
result = _.all<TResult>(list, '');
|
||||
result = _.all<{a: number}, TResult>(list, {a: 42});
|
||||
|
||||
result = _.all<TResult>(dictionary);
|
||||
result = _.all<TResult>(dictionary, dictionaryIterator);
|
||||
result = _.all<TResult>(dictionary, dictionaryIterator, any);
|
||||
result = _.all<TResult>(dictionary, '');
|
||||
result = _.all<{a: number}, TResult>(dictionary, {a: 42});
|
||||
|
||||
result = _(array).all();
|
||||
result = _(array).all(listIterator);
|
||||
result = _(array).all(listIterator, any);
|
||||
result = _(array).all('');
|
||||
result = _(array).all<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).all<TResult>();
|
||||
result = _(list).all<TResult>(listIterator);
|
||||
result = _(list).all<TResult>(listIterator, any);
|
||||
result = _(list).all('');
|
||||
result = _(list).all<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).all<TResult>();
|
||||
result = _(dictionary).all<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).all<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).all('');
|
||||
result = _(dictionary).all<{a: number}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(array).chain().all();
|
||||
result = _(array).chain().all(listIterator);
|
||||
result = _(array).chain().all(listIterator, any);
|
||||
result = _(array).chain().all('');
|
||||
result = _(array).chain().all<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).chain().all<TResult>();
|
||||
result = _(list).chain().all<TResult>(listIterator);
|
||||
result = _(list).chain().all<TResult>(listIterator, any);
|
||||
result = _(list).chain().all('');
|
||||
result = _(list).chain().all<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).chain().all<TResult>();
|
||||
result = _(dictionary).chain().all<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).chain().all<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).chain().all('');
|
||||
result = _(dictionary).chain().all<{a: number}>({a: 42});
|
||||
}
|
||||
}
|
||||
|
||||
// _.any
|
||||
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;
|
||||
|
||||
result = _.any<TResult>(array);
|
||||
result = _.any<TResult>(array, listIterator);
|
||||
result = _.any<TResult>(array, listIterator, any);
|
||||
result = _.any<TResult>(array, '');
|
||||
result = _.any<{a: number}, TResult>(array, {a: 42});
|
||||
|
||||
result = _.any<TResult>(list);
|
||||
result = _.any<TResult>(list, listIterator);
|
||||
result = _.any<TResult>(list, listIterator, any);
|
||||
result = _.any<TResult>(list, '');
|
||||
result = _.any<{a: number}, TResult>(list, {a: 42});
|
||||
|
||||
result = _.any<TResult>(dictionary);
|
||||
result = _.any<TResult>(dictionary, dictionaryIterator);
|
||||
result = _.any<TResult>(dictionary, dictionaryIterator, any);
|
||||
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);
|
||||
result = _(array).any('');
|
||||
result = _(array).any<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).any<TResult>();
|
||||
result = _(list).any<TResult>(listIterator);
|
||||
result = _(list).any<TResult>(listIterator, any);
|
||||
result = _(list).any('');
|
||||
result = _(list).any<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).any<TResult>();
|
||||
result = _(dictionary).any<TResult>(dictionaryIterator);
|
||||
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});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(array).chain().any();
|
||||
result = _(array).chain().any(listIterator);
|
||||
result = _(array).chain().any(listIterator, any);
|
||||
result = _(array).chain().any('');
|
||||
result = _(array).chain().any<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).chain().any<TResult>();
|
||||
result = _(list).chain().any<TResult>(listIterator);
|
||||
result = _(list).chain().any<TResult>(listIterator, any);
|
||||
result = _(list).chain().any('');
|
||||
result = _(list).chain().any<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).chain().any<TResult>();
|
||||
result = _(dictionary).chain().any<TResult>(dictionaryIterator);
|
||||
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});
|
||||
}
|
||||
}
|
||||
|
||||
// _.at
|
||||
module TestAt {
|
||||
let array: TResult[];
|
||||
@@ -3074,143 +2782,6 @@ module TestAt {
|
||||
}
|
||||
}
|
||||
|
||||
// _.collect
|
||||
module TestCollect {
|
||||
let array: number[];
|
||||
let list: _.List<number>;
|
||||
let dictionary: _.Dictionary<number>;
|
||||
|
||||
let listIterator: (value: number, index: number, collection: _.List<number>) => TResult;
|
||||
let dictionaryIterator: (value: number, key: string, collection: _.Dictionary<number>) => TResult;
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.collect<number, TResult>(array);
|
||||
result = _.collect<number, TResult>(array, listIterator);
|
||||
result = _.collect<number, TResult>(array, listIterator, any);
|
||||
result = _.collect<number, TResult>(array, '');
|
||||
|
||||
result = _.collect<number, TResult>(list);
|
||||
result = _.collect<number, TResult>(list, listIterator);
|
||||
result = _.collect<number, TResult>(list, listIterator, any);
|
||||
result = _.collect<number, TResult>(list, '');
|
||||
|
||||
result = _.collect<number, TResult>(dictionary);
|
||||
result = _.collect<number, TResult>(dictionary, dictionaryIterator);
|
||||
result = _.collect<number, TResult>(dictionary, dictionaryIterator, any);
|
||||
result = _.collect<number, TResult>(dictionary, '');
|
||||
}
|
||||
|
||||
{
|
||||
let result: boolean[];
|
||||
|
||||
result = _.collect<number, {}>(array, {});
|
||||
result = _.collect<number, {}>(list, {});
|
||||
result = _.collect<number, {}>(dictionary, {});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _<number>(array).collect<TResult>();
|
||||
result = _<number>(array).collect<TResult>(listIterator);
|
||||
result = _<number>(array).collect<TResult>(listIterator, any);
|
||||
result = _<number>(array).collect<TResult>('');
|
||||
|
||||
result = _(list).collect<number, TResult>();
|
||||
result = _(list).collect<number, TResult>(listIterator);
|
||||
result = _(list).collect<number, TResult>(listIterator, any);
|
||||
result = _(list).collect<number, TResult>('');
|
||||
|
||||
result = _(dictionary).collect<number, TResult>();
|
||||
result = _(dictionary).collect<number, TResult>(dictionaryIterator);
|
||||
result = _(dictionary).collect<number, TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).collect<number, TResult>('');
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<boolean>;
|
||||
|
||||
result = _<number>(array).collect<{}>({});
|
||||
result = _(list).collect<{}>({});
|
||||
result = _(dictionary).collect<{}>({});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _<number>(array).chain().collect<TResult>();
|
||||
result = _<number>(array).chain().collect<TResult>(listIterator);
|
||||
result = _<number>(array).chain().collect<TResult>(listIterator, any);
|
||||
result = _<number>(array).chain().collect<TResult>('');
|
||||
|
||||
result = _(list).chain().collect<number, TResult>();
|
||||
result = _(list).chain().collect<number, TResult>(listIterator);
|
||||
result = _(list).chain().collect<number, TResult>(listIterator, any);
|
||||
result = _(list).chain().collect<number, TResult>('');
|
||||
|
||||
result = _(dictionary).chain().collect<number, TResult>();
|
||||
result = _(dictionary).chain().collect<number, TResult>(dictionaryIterator);
|
||||
result = _(dictionary).chain().collect<number, TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).chain().collect<number, TResult>('');
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<boolean>;
|
||||
|
||||
result = _<number>(array).chain().collect<{}>({});
|
||||
result = _(list).chain().collect<{}>({});
|
||||
result = _(dictionary).chain().collect<{}>({});
|
||||
}
|
||||
}
|
||||
|
||||
// _.contains
|
||||
module TestContains {
|
||||
type SampleType = {a: string; b: number; c: boolean;};
|
||||
|
||||
let array: SampleType[];
|
||||
let list: _.List<SampleType>;
|
||||
let dictionary: _.Dictionary<SampleType>;
|
||||
|
||||
let target: SampleType;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.contains<SampleType>(array, target);
|
||||
result = _.contains<SampleType>(array, target, 42);
|
||||
|
||||
result = _.contains<SampleType>(list, target);
|
||||
result = _.contains<SampleType>(list, target, 42);
|
||||
|
||||
result = _.contains<SampleType>(dictionary, target);
|
||||
result = _.contains<SampleType>(dictionary, target, 42);
|
||||
|
||||
result = _(array).contains(target);
|
||||
result = _(array).contains(target, 42);
|
||||
|
||||
result = _(list).contains<SampleType>(target);
|
||||
result = _(list).contains<SampleType>(target, 42);
|
||||
|
||||
result = _(dictionary).contains<SampleType>(target);
|
||||
result = _(dictionary).contains<SampleType>(target, 42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(array).chain().contains(target);
|
||||
result = _(array).chain().contains(target, 42);
|
||||
|
||||
result = _(list).chain().contains<SampleType>(target);
|
||||
result = _(list).chain().contains<SampleType>(target, 42);
|
||||
|
||||
result = _(dictionary).chain().contains<SampleType>(target);
|
||||
result = _(dictionary).chain().contains<SampleType>(target, 42);
|
||||
}
|
||||
}
|
||||
|
||||
// _.countBy
|
||||
module TestCountBy {
|
||||
let array: TResult[];
|
||||
@@ -3344,54 +2915,6 @@ module TestCountBy {
|
||||
}
|
||||
}
|
||||
|
||||
// _.detect
|
||||
module TestDetect {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let dictionary: _.Dictionary<TResult>;
|
||||
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => boolean;
|
||||
|
||||
let result: TResult;
|
||||
|
||||
result = _.detect<TResult>(array);
|
||||
result = _.detect<TResult>(array, listIterator);
|
||||
result = _.detect<TResult>(array, listIterator, any);
|
||||
result = _.detect<TResult>(array, '');
|
||||
result = _.detect<{a: number}, TResult>(array, {a: 42});
|
||||
|
||||
result = _.detect<TResult>(list);
|
||||
result = _.detect<TResult>(list, listIterator);
|
||||
result = _.detect<TResult>(list, listIterator, any);
|
||||
result = _.detect<TResult>(list, '');
|
||||
result = _.detect<{a: number}, TResult>(list, {a: 42});
|
||||
|
||||
result = _.detect<TResult>(dictionary);
|
||||
result = _.detect<TResult>(dictionary, dictionaryIterator);
|
||||
result = _.detect<TResult>(dictionary, dictionaryIterator, any);
|
||||
result = _.detect<TResult>(dictionary, '');
|
||||
result = _.detect<{a: number}, TResult>(dictionary, {a: 42});
|
||||
|
||||
result = _(array).detect();
|
||||
result = _(array).detect(listIterator);
|
||||
result = _(array).detect(listIterator, any);
|
||||
result = _(array).detect('');
|
||||
result = _(array).detect<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).detect<TResult>();
|
||||
result = _(list).detect<TResult>(listIterator);
|
||||
result = _(list).detect<TResult>(listIterator, any);
|
||||
result = _(list).detect<TResult>('');
|
||||
result = _(list).detect<{a: number}, TResult>({a: 42});
|
||||
|
||||
result = _(dictionary).detect<TResult>();
|
||||
result = _(dictionary).detect<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).detect<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).detect<TResult>('');
|
||||
result = _(dictionary).detect<{a: number}, TResult>({a: 42});
|
||||
}
|
||||
|
||||
// _.each
|
||||
module TestEach {
|
||||
let array: TResult[];
|
||||
@@ -4151,52 +3674,6 @@ module TestGroupBy {
|
||||
}
|
||||
}
|
||||
|
||||
// _.include
|
||||
module TestInclude {
|
||||
type SampleType = {a: string; b: number; c: boolean;};
|
||||
|
||||
let array: SampleType[];
|
||||
let list: _.List<SampleType>;
|
||||
let dictionary: _.Dictionary<SampleType>;
|
||||
|
||||
let target: SampleType;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.include<SampleType>(array, target);
|
||||
result = _.include<SampleType>(array, target, 42);
|
||||
|
||||
result = _.include<SampleType>(list, target);
|
||||
result = _.include<SampleType>(list, target, 42);
|
||||
|
||||
result = _.include<SampleType>(dictionary, target);
|
||||
result = _.include<SampleType>(dictionary, target, 42);
|
||||
|
||||
result = _(array).include(target);
|
||||
result = _(array).include(target, 42);
|
||||
|
||||
result = _(list).include<SampleType>(target);
|
||||
result = _(list).include<SampleType>(target, 42);
|
||||
|
||||
result = _(dictionary).include<SampleType>(target);
|
||||
result = _(dictionary).include<SampleType>(target, 42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<boolean>;
|
||||
|
||||
result = _(array).chain().include(target);
|
||||
result = _(array).chain().include(target, 42);
|
||||
|
||||
result = _(list).chain().include<SampleType>(target);
|
||||
result = _(list).chain().include<SampleType>(target, 42);
|
||||
|
||||
result = _(dictionary).chain().include<SampleType>(target);
|
||||
result = _(dictionary).chain().include<SampleType>(target, 42);
|
||||
}
|
||||
}
|
||||
|
||||
// _.includes
|
||||
module TestIncludes {
|
||||
type SampleType = {a: string; b: number; c: boolean;};
|
||||
@@ -4589,22 +4066,6 @@ result = <ABC>_.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
result = <number>_.foldl([1, 2, 3], function (sum: number, num: number) {
|
||||
return sum + num;
|
||||
});
|
||||
result = <ABC>_.foldl({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) {
|
||||
r[key] = num * 3;
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
result = <number>_.inject([1, 2, 3], function (sum: number, num: number) {
|
||||
return sum + num;
|
||||
});
|
||||
result = <ABC>_.inject({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) {
|
||||
r[key] = num * 3;
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
result = <number>_([1, 2, 3]).reduce<number>(function (sum: number, num: number) {
|
||||
return sum + num;
|
||||
});
|
||||
@@ -4613,24 +4074,7 @@ result = <ABC>_({ 'a': 1, 'b': 2, 'c': 3 }).reduce<number, ABC>(function (r: ABC
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
result = <number>_([1, 2, 3]).foldl<number>(function (sum: number, num: number) {
|
||||
return sum + num;
|
||||
});
|
||||
result = <ABC>_({ 'a': 1, 'b': 2, 'c': 3 }).foldl<number, ABC>(function (r: ABC, num: number, key: string) {
|
||||
r[key] = num * 3;
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
result = <number>_([1, 2, 3]).inject<number>(function (sum: number, num: number) {
|
||||
return sum + num;
|
||||
});
|
||||
result = <ABC>_({ 'a': 1, 'b': 2, 'c': 3 }).inject<number, ABC>(function (r: ABC, num: number, key: string) {
|
||||
r[key] = num * 3;
|
||||
return r;
|
||||
}, {});
|
||||
|
||||
result = <number[]>_.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, <number[]>[]);
|
||||
result = <number[]>_.foldr([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, <number[]>[]);
|
||||
|
||||
// _.reject
|
||||
module TestReject {
|
||||
@@ -5229,36 +4673,6 @@ module TestAry {
|
||||
}
|
||||
}
|
||||
|
||||
// _.backflow
|
||||
module TestBackflow {
|
||||
let Fn1: (n: number) => number;
|
||||
let Fn2: (m: number, n: number) => number;
|
||||
|
||||
{
|
||||
let result: (m: number, n: number) => number;
|
||||
|
||||
result = _.backflow<(m: number, n: number) => number>(Fn1, Fn2);
|
||||
result = _.backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn2);
|
||||
result = _.backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>;
|
||||
|
||||
result = _(Fn1).backflow<(m: number, n: number) => number>(Fn2);
|
||||
result = _(Fn1).backflow<(m: number, n: number) => number>(Fn1, Fn2);
|
||||
result = _(Fn1).backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn2);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>;
|
||||
|
||||
result = _(Fn1).chain().backflow<(m: number, n: number) => number>(Fn2);
|
||||
result = _(Fn1).chain().backflow<(m: number, n: number) => number>(Fn1, Fn2);
|
||||
result = _(Fn1).chain().backflow<(m: number, n: number) => number>(Fn1, Fn1, Fn2);
|
||||
}
|
||||
}
|
||||
|
||||
// _.before
|
||||
module TestBefore {
|
||||
interface Func {
|
||||
@@ -5488,36 +4902,6 @@ module TestBindKey {
|
||||
}
|
||||
}
|
||||
|
||||
// _.compose
|
||||
module TestCompose {
|
||||
let Fn1: (n: number) => number;
|
||||
let Fn2: (m: number, n: number) => number;
|
||||
|
||||
{
|
||||
let result: (m: number, n: number) => number;
|
||||
|
||||
result = _.compose<(m: number, n: number) => number>(Fn1, Fn2);
|
||||
result = _.compose<(m: number, n: number) => number>(Fn1, Fn1, Fn2);
|
||||
result = _.compose<(m: number, n: number) => number>(Fn1, Fn1, Fn1, Fn2);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<(m: number, n: number) => number>;
|
||||
|
||||
result = _(Fn1).compose<(m: number, n: number) => number>(Fn2);
|
||||
result = _(Fn1).compose<(m: number, n: number) => number>(Fn1, Fn2);
|
||||
result = _(Fn1).compose<(m: number, n: number) => number>(Fn1, Fn1, Fn2);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<(m: number, n: number) => number>;
|
||||
|
||||
result = _(Fn1).chain().compose<(m: number, n: number) => number>(Fn2);
|
||||
result = _(Fn1).chain().compose<(m: number, n: number) => number>(Fn1, Fn2);
|
||||
result = _(Fn1).chain().compose<(m: number, n: number) => number>(Fn1, Fn1, Fn2);
|
||||
}
|
||||
}
|
||||
|
||||
var createCallbackObj: { [index: string]: string; } = { name: 'Joe' };
|
||||
result = <() => any>_.createCallback('name');
|
||||
result = <() => boolean>_.createCallback(createCallbackObj);
|
||||
@@ -8345,31 +7729,6 @@ module TestMerge {
|
||||
}
|
||||
}
|
||||
|
||||
// _.methods
|
||||
module TestFunctions {
|
||||
type SampleObject = {a: number; b: string; c: boolean;};
|
||||
|
||||
let object: SampleObject;
|
||||
|
||||
{
|
||||
let result: string[];
|
||||
|
||||
result = _.methods<SampleObject>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<string>;
|
||||
|
||||
result = _(object).methods();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string>;
|
||||
|
||||
result = _(object).chain().methods();
|
||||
}
|
||||
}
|
||||
|
||||
// _.omit
|
||||
module TestOmit {
|
||||
let predicate: (element: any, key: string, collection: any) => boolean;
|
||||
@@ -9147,72 +8506,6 @@ module TestAttempt {
|
||||
}
|
||||
}
|
||||
|
||||
// _.callback
|
||||
module TestCallback {
|
||||
{
|
||||
let result: (...args: any[]) => TResult;
|
||||
|
||||
result = _.callback<TResult>(Function);
|
||||
result = _.callback<TResult>(Function, any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: (object: any) => TResult;
|
||||
|
||||
result = _.callback<TResult>('');
|
||||
result = _.callback<TResult>('', any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: (object: any) => boolean;
|
||||
|
||||
result = _.callback({});
|
||||
result = _.callback({}, any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
|
||||
|
||||
result = _(Function).callback<TResult>();
|
||||
result = _(Function).callback<TResult>(any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>;
|
||||
|
||||
result = _('').callback<TResult>();
|
||||
result = _('').callback<TResult>(any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<(object: any) => boolean>;
|
||||
|
||||
result = _({}).callback();
|
||||
result = _({}).callback(any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>;
|
||||
|
||||
result = _(Function).chain().callback<TResult>();
|
||||
result = _(Function).chain().callback<TResult>(any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>;
|
||||
|
||||
result = _('').chain().callback<TResult>();
|
||||
result = _('').chain().callback<TResult>(any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<(object: any) => boolean>;
|
||||
|
||||
result = _({}).chain().callback();
|
||||
result = _({}).chain().callback(any);
|
||||
}
|
||||
}
|
||||
|
||||
// _.constant
|
||||
module TestConstant {
|
||||
{
|
||||
|
||||
1236
lodash/lodash.d.ts
vendored
1236
lodash/lodash.d.ts
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user