mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
lodash: signatures of _.negate have been changed
This commit is contained in:
+31
-10
@@ -4925,17 +4925,38 @@ module TestModArgs {
|
||||
}
|
||||
|
||||
// _.negate
|
||||
interface TestNegatePredicate {
|
||||
(a1: number, a2: number): boolean;
|
||||
module TestNegate {
|
||||
interface PredicateFn {
|
||||
(a1: number, a2: number): boolean;
|
||||
}
|
||||
|
||||
interface ResultFn {
|
||||
(a1: number, a2: number): boolean;
|
||||
}
|
||||
|
||||
var predicate = (a1: number, a2: number) => a1 > a2;
|
||||
|
||||
{
|
||||
let result: ResultFn;
|
||||
|
||||
result = _.negate<PredicateFn>(predicate);
|
||||
result = _.negate<PredicateFn, ResultFn>(predicate);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitObjectWrapper<ResultFn>;
|
||||
|
||||
result = _(predicate).negate();
|
||||
result = _(predicate).negate<ResultFn>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitObjectWrapper<ResultFn>;
|
||||
|
||||
result = _(predicate).chain().negate();
|
||||
result = _(predicate).chain().negate<ResultFn>();
|
||||
}
|
||||
}
|
||||
interface TestNegateResult {
|
||||
(a1: number, a2: number): boolean;
|
||||
}
|
||||
var testNegatePredicate = (a1: number, a2: number) => a1 > a2;
|
||||
result = <TestNegateResult>_.negate<TestNegatePredicate>(testNegatePredicate);
|
||||
result = <TestNegateResult>_.negate<TestNegatePredicate, TestNegateResult>(testNegatePredicate);
|
||||
result = <TestNegateResult>_(testNegatePredicate).negate().value();
|
||||
result = <TestNegateResult>_(testNegatePredicate).negate<TestNegateResult>().value();
|
||||
|
||||
// _.once
|
||||
module TestOnce {
|
||||
|
||||
Vendored
+13
@@ -8462,6 +8462,7 @@ declare module _ {
|
||||
/**
|
||||
* Creates a function that negates the result of the predicate func. The func predicate is invoked with
|
||||
* the this binding and arguments of the created function.
|
||||
*
|
||||
* @param predicate The predicate to negate.
|
||||
* @return Returns the new function.
|
||||
*/
|
||||
@@ -8485,6 +8486,18 @@ declare module _ {
|
||||
negate<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.negate
|
||||
*/
|
||||
negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
|
||||
|
||||
/**
|
||||
* @see _.negate
|
||||
*/
|
||||
negate<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.once
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user