added remaining missing placeholder defs

This commit is contained in:
Drew Wyatt
2018-11-01 10:11:42 -04:00
parent a0dcb70486
commit cb7a0a4efe
2 changed files with 34 additions and 0 deletions

View File

@@ -794,6 +794,10 @@ declare namespace R {
*/
contains(__: Placeholder, list: string): (a: string) => boolean;
contains<T>(__: Placeholder, list: T[]): (a: T) => boolean;
contains(__: Placeholder): (list: string, a: string) => boolean;
contains<T>(__: Placeholder): (list: T[], a: T) => boolean;
contains(a: string, list: string): boolean;
contains<T>(a: T, list: ReadonlyArray<T>): boolean;
contains(a: string): (list: string) => boolean;
@@ -1068,6 +1072,7 @@ declare namespace R {
* Returns true if the first parameter is greater than the second.
*/
gt(__: Placeholder, b: number): (a: number) => boolean;
gt(__: Placeholder): (b: number, a: number) => boolean;
gt(a: number, b: number): boolean;
gt(a: number): (b: number) => boolean;
@@ -1075,6 +1080,7 @@ declare namespace R {
* Returns true if the first parameter is greater than or equal to the second.
*/
gte(__: Placeholder, b: number): (a: number) => boolean;
gte(__: Placeholder): (b: number, a: number) => boolean;
gte(a: number, b: number): boolean;
gte(a: number): (b: number) => boolean;
@@ -1082,6 +1088,7 @@ declare namespace R {
* Returns whether or not an object has an own property with the specified name.
*/
has<T>(__: Placeholder, obj: T): (s: string) => boolean;
has<T>(__: Placeholder): (obj: T, s: string) => boolean;
has<T>(s: string, obj: T): boolean;
has(s: string): <T>(obj: T) => boolean;
@@ -1318,6 +1325,7 @@ declare namespace R {
* Returns true if the first parameter is less than the second.
*/
lt(__: Placeholder, b: number): (a: number) => boolean;
lt(__: Placeholder): (b: number, a: number) => boolean;
lt(a: number, b: number): boolean;
lt(a: number): (b: number) => boolean;
@@ -1325,6 +1333,7 @@ declare namespace R {
* Returns true if the first parameter is less than or equal to the second.
*/
lte(__: Placeholder, b: number): (a: number) => boolean;
lte(__: Placeholder): (b: number, a: number) => boolean;
lte(a: number, b: number): boolean;
lte(a: number): (b: number) => boolean;
@@ -1381,6 +1390,7 @@ declare namespace R {
* when the modulus is zero or negative.
*/
mathMod(__: Placeholder, b: number): (a: number) => number;
mathMod(__: Placeholder): (b: number, a: number) => number;
mathMod(a: number, b: number): number;
mathMod(a: number): (b: number) => number;
@@ -1430,6 +1440,7 @@ declare namespace R {
* This function will *not* mutate passed-in objects.
*/
merge<T2>(__: Placeholder, b: T2): <T1>(a: T1) => T1 & T2;
merge(__: Placeholder): <T1, T2>(b: T2, a: T1) => T1 & T2;
merge<T1, T2>(a: T1, b: T2): T1 & T2;
merge<T1>(a: T1): <T2>(b: T2) => T1 & T2;
@@ -1518,6 +1529,7 @@ declare namespace R {
* modulo. For mathematical modulo see `mathMod`
*/
modulo(__: Placeholder, b: number): (a: number) => number;
modulo(__: Placeholder): (b: number, a: number) => number;
modulo(a: number, b: number): number;
modulo(a: number): (b: number) => number;
@@ -2305,6 +2317,7 @@ declare namespace R {
* Subtracts two numbers. Equivalent to `a - b` but curried.
*/
subtract(__: Placeholder, b: number): (a: number) => number;
subtract(__: Placeholder): (b: number, a: number) => number;
subtract(a: number, b: number): number;
subtract(a: number): (b: number) => number;

View File

@@ -128,18 +128,39 @@ class F2 {
() => {
R.concat(R.__, [4, 5, 6])([1, 2, 3]); // [1, 2, 3, 4, 5, 6]
R.concat(R.__)([4, 5, 6], [1, 2, 3]); // [1, 2, 3, 4, 5, 6]
R.contains(R.__, [1, 2, 3])(3); // true
R.contains<number>(R.__)([1, 2, 3], 3); // true
R.divide(R.__)(2, 42); // 21
R.divide(R.__, 2)(42); // 21
R.gt(R.__, 2)(10); // true
R.gt(R.__)(2, 10); // true
R.gte(R.__, 6)(2); // false
R.gte(R.__)(6, 2); // false
R.has(R.__, {x: 0, y: 0})('x'); // true;
R.has(R.__)({x: 0, y: 0}, 'x'); // true;
R.lt(R.__, 5)(10); // false
R.lt(R.__)(5, 10); // false
R.lte(R.__, 2)(1); // true
R.lte(R.__)(2, 1); // true
R.mathMod(R.__, 12)(15); // 3
R.mathMod(R.__)(12, 15); // 3
R.modulo(R.__, 2)(42); // 0
R.modulo(R.__)(2, 42); // 0
R.merge(R.__, {x: 0})({x: 5, y: 2}); // {x: 0, y: 2}
R.merge(R.__)({x: 0}, {x: 5, y: 2}); // {x: 0, y: 2}
R.subtract(R.__, 5)(17); // 12
R.subtract(R.__)(5, 17); // 12
};
() => {