From 09d65e8358dfcecea03e44a5d991279dc0be326f Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Tue, 3 Nov 2015 05:30:10 +0500 Subject: [PATCH] lodash: signatures of the method _.callback have been changed --- lodash/lodash-tests.ts | 166 +++++++++++++++++++++++++++++++---------- lodash/lodash.d.ts | 38 ++++++++++ 2 files changed, 164 insertions(+), 40 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index f12ca23c42..8fe89725b5 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4765,26 +4765,69 @@ module TestAttempt { } // _.callback -{ - let result: (...args: any[]) => TResult; - result = _.callback(Function); - result = _.callback(Function, any); - result = _(Function).callback().value(); - result = _(Function).callback(any).value(); -} -{ - let result: (object: any) => TResult; - result = _.callback(''); - result = _.callback('', any); - result = _('').callback().value(); - result = _('').callback(any).value(); -} -{ - let result: (object: any) => boolean; - result = _.callback({}); - result = _.callback({}, any); - result = _({}).callback().value(); - result = _({}).callback(any).value(); +module TestCallback { + { + let result: (...args: any[]) => TResult; + + result = _.callback(Function); + result = _.callback(Function, any); + } + + { + let result: (object: any) => TResult; + + result = _.callback(''); + result = _.callback('', any); + } + + { + let result: (object: any) => boolean; + + result = _.callback({}); + result = _.callback({}, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + + result = _(Function).callback(); + result = _(Function).callback(any); + } + + { + let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; + + result = _('').callback(); + result = _('').callback(any); + } + + { + let result: _.LoDashImplicitObjectWrapper<(object: any) => boolean>; + + result = _({}).callback(); + result = _({}).callback(any); + } + + { + let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + + result = _(Function).chain().callback(); + result = _(Function).chain().callback(any); + } + + { + let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; + + result = _('').chain().callback(); + result = _('').chain().callback(any); + } + + { + let result: _.LoDashExplicitObjectWrapper<(object: any) => boolean>; + + result = _({}).chain().callback(); + result = _({}).chain().callback(any); + } } // _.constant @@ -4882,26 +4925,69 @@ module TestConstant { } // _.iteratee -{ - let result: (...args: any[]) => TResult; - result = _.iteratee(Function); - result = _.iteratee(Function, any); - result = _(Function).iteratee().value(); - result = _(Function).iteratee(any).value(); -} -{ - let result: (object: any) => TResult; - result = _.iteratee(''); - result = _.iteratee('', any); - result = _('').iteratee().value(); - result = _('').iteratee(any).value(); -} -{ - let result: (object: any) => boolean; - result = _.iteratee({}); - result = _.iteratee({}, any); - result = _({}).iteratee().value(); - result = _({}).iteratee(any).value(); +module TestIteratee { + { + let result: (...args: any[]) => TResult; + + result = _.iteratee(Function); + result = _.iteratee(Function, any); + } + + { + let result: (object: any) => TResult; + + result = _.iteratee(''); + result = _.iteratee('', any); + } + + { + let result: (object: any) => boolean; + + result = _.iteratee({}); + result = _.iteratee({}, any); + } + + { + let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + + result = _(Function).iteratee(); + result = _(Function).iteratee(any); + } + + { + let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; + + result = _('').iteratee(); + result = _('').iteratee(any); + } + + { + let result: _.LoDashImplicitObjectWrapper<(object: any) => boolean>; + + result = _({}).iteratee(); + result = _({}).iteratee(any); + } + + { + let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + + result = _(Function).chain().iteratee(); + result = _(Function).chain().iteratee(any); + } + + { + let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; + + result = _('').chain().iteratee(); + result = _('').chain().iteratee(any); + } + + { + let result: _.LoDashExplicitObjectWrapper<(object: any) => boolean>; + + result = _({}).chain().iteratee(); + result = _({}).chain().iteratee(any); + } } // _.matches diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 141ad993cd..e6c22b4bf6 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10460,6 +10460,25 @@ declare module _ { callback(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; } + interface LoDashExplicitWrapper { + /** + * @see _.callback + */ + callback(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.callback + */ + callback(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>; + + /** + * @see _.callback + */ + callback(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + } + //_.constant interface LoDashStatic { /** @@ -10567,6 +10586,25 @@ declare module _ { iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; } + interface LoDashExplicitWrapper { + /** + * @see _.callback + */ + iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.callback + */ + iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>; + + /** + * @see _.callback + */ + iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + } + //_.matches interface LoDashStatic { /**