mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Fix chain methods to return the correct types
reduce, inject, foldl, reduceRight, and foldr should return _ChainSingle<TResult> map and collect should return _Chain<TResult>
This commit is contained in:
Vendored
+7
-7
@@ -2458,39 +2458,39 @@ interface _Chain<T> {
|
||||
/**
|
||||
* @see _.map
|
||||
**/
|
||||
collect<TResult>(iterator: _.ListIterator<T, TResult>, context?: any): _Chain<T>;
|
||||
collect<TResult>(iterator: _.ListIterator<T, TResult>, context?: any): _Chain<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.map
|
||||
**/
|
||||
collect<TResult>(iterator: _.ObjectIterator<T, TResult>, context?: any): _Chain<T>;
|
||||
collect<TResult>(iterator: _.ObjectIterator<T, TResult>, context?: any): _Chain<TResult>;
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.reduce
|
||||
**/
|
||||
reduce<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _Chain<T>;
|
||||
reduce<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
inject<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _Chain<T>;
|
||||
inject<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduce
|
||||
**/
|
||||
foldl<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _Chain<T>;
|
||||
foldl<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
* @see _.reduceRight
|
||||
**/
|
||||
reduceRight<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _Chain<T>;
|
||||
reduceRight<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.reduceRight
|
||||
**/
|
||||
foldr<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _Chain<T>;
|
||||
foldr<TResult>(iterator: _.MemoIterator<T, TResult>, memo?: TResult, context?: any): _ChainSingle<TResult>;
|
||||
|
||||
/**
|
||||
* Wrapped type `any[]`.
|
||||
|
||||
Reference in New Issue
Block a user