mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-29 11:12:23 +08:00
lodash: signatures of the method _.times changed
This commit is contained in:
+44
-15
@@ -4406,6 +4406,50 @@ module TestMixin {
|
||||
result = _({}).runInContext();
|
||||
}
|
||||
|
||||
// _.times
|
||||
module TestTimes {
|
||||
let iteratee: (num: number) => TResult;
|
||||
|
||||
{
|
||||
let result: number[];
|
||||
|
||||
result = _.times(42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.times(42, iteratee);
|
||||
result = _.times(42, iteratee, any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<number>;
|
||||
|
||||
result = _(42).times();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(42).times(iteratee);
|
||||
result = _(42).times(iteratee, any);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<number>;
|
||||
|
||||
result = _(42).chain().times();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(42).chain().times(iteratee);
|
||||
result = _(42).chain().times(iteratee, any);
|
||||
}
|
||||
}
|
||||
|
||||
// _.uniqueId
|
||||
result = <string>_.uniqueId();
|
||||
result = <string>_.uniqueId('');
|
||||
@@ -4415,21 +4459,6 @@ result = <string>_.VERSION;
|
||||
result = <_.Support>_.support;
|
||||
result = <_.TemplateSettings>_.templateSettings;
|
||||
|
||||
// _.times
|
||||
{
|
||||
let result: number[];
|
||||
result = _.times(42);
|
||||
result = _(42).times().value();
|
||||
}
|
||||
{
|
||||
let testTimesFn: (num: number) => TResult;
|
||||
let result: TResult[];
|
||||
result = _.times(42, testTimesFn);
|
||||
result = _.times(42, testTimesFn, any);
|
||||
result = _(42).times(testTimesFn).value();
|
||||
result = _(42).times(testTimesFn, any).value();
|
||||
}
|
||||
|
||||
// _.partial & _.partialRight
|
||||
{
|
||||
function func0(): number {
|
||||
|
||||
Vendored
+15
@@ -10303,6 +10303,21 @@ declare module _ {
|
||||
times(): LoDashImplicitArrayWrapper<number>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.times
|
||||
*/
|
||||
times<TResult>(
|
||||
iteratee: (num: number) => TResult,
|
||||
thisArgs?: any
|
||||
): LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
/**
|
||||
* @see _.times
|
||||
*/
|
||||
times(): LoDashExplicitArrayWrapper<number>;
|
||||
}
|
||||
|
||||
//_.uniqueId
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user