mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
lodash: sugnatures of _.zip have been changed
This commit is contained in:
+37
-2
@@ -1615,8 +1615,43 @@ module TestXor {
|
||||
}
|
||||
}
|
||||
|
||||
result = <any[][]>_.zip(['moe', 'larry'], [30, 40], [true, false]);
|
||||
result = <any[][]>_(['moe', 'larry']).zip([30, 40], [true, false]).value();
|
||||
// _.zip
|
||||
module TestZip {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
|
||||
{
|
||||
let result: TResult[][];
|
||||
|
||||
result = _.zip<TResult>(array);
|
||||
result = _.zip<TResult>(array, list);
|
||||
result = _.zip<TResult>(array, list, array);
|
||||
|
||||
result = _.zip<TResult>(list);
|
||||
result = _.zip<TResult>(list, array);
|
||||
result = _.zip<TResult>(list, array, list);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult[]>;
|
||||
|
||||
result = _(array).zip<TResult>(list);
|
||||
result = _(array).zip<TResult>(list, array);
|
||||
|
||||
result = _(list).zip<TResult>(array);
|
||||
result = _(list).zip<TResult>(array, list);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult[]>;
|
||||
|
||||
result = _(array).chain().zip<TResult>(list);
|
||||
result = _(array).chain().zip<TResult>(list, array);
|
||||
|
||||
result = _(list).chain().zip<TResult>(array);
|
||||
result = _(list).chain().zip<TResult>(array, list);
|
||||
}
|
||||
}
|
||||
|
||||
// _.zipObject
|
||||
module TestZipObject {
|
||||
|
||||
Vendored
+31
-15
@@ -2931,25 +2931,41 @@ declare module _ {
|
||||
//_.zip
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array of grouped elements, the first of which contains the first
|
||||
* elements of the given arrays, the second of which contains the second elements
|
||||
* of the given arrays, and so on.
|
||||
* @param arrays Arrays to process.
|
||||
* @return A new array of grouped elements.
|
||||
**/
|
||||
zip(...arrays: any[][]): any[][];
|
||||
|
||||
/**
|
||||
* @see _.zip
|
||||
**/
|
||||
zip(...arrays: any[]): any[];
|
||||
* Creates an array of grouped elements, the first of which contains the first elements of the given arrays,
|
||||
* the second of which contains the second elements of the given arrays, and so on.
|
||||
*
|
||||
* @param arrays The arrays to process.
|
||||
* @return Returns the new array of grouped elements.
|
||||
*/
|
||||
zip<T>(...arrays: List<T>[]): T[][];
|
||||
}
|
||||
|
||||
interface LoDashImplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.zip
|
||||
**/
|
||||
zip(...arrays: any[][]): _.LoDashImplicitArrayWrapper<any[][]>;
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>;
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.zip
|
||||
*/
|
||||
zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>;
|
||||
}
|
||||
|
||||
//_.zipObject
|
||||
|
||||
Reference in New Issue
Block a user