Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: Overload reordering #48

Merged
merged 13 commits into from
Jun 28, 2023
2 changes: 1 addition & 1 deletion types/add.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// no need to type for __: Placeholder, because you'll never need to with addition
export function add(a: number, b: number): number;
export function add(a: number): (b: number) => number;
export function add(a: number, b: number): number;
41 changes: 29 additions & 12 deletions types/adjust.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Placeholder } from './util/tools';

// adjust(index, fn, list)
export function adjust<T>(index: number, fn: (a: T) => T, list: readonly T[]): T[];
// adjust(index, fn)(list)
export function adjust<T>(index: number, fn: (a: T) => T): (list: readonly T[]) => T[];
// adjust(index)
export function adjust(index: number): {
// adjust(index)(fn, list)
Expand All @@ -14,16 +10,37 @@ export function adjust(index: number): {
<T>(fn: (a: T) => T): (list: readonly T[]) => T[];
};

// adjust(__, fn, list)(index)
export function adjust<T>(__: Placeholder, fn: (a: T) => T, list: readonly T[]): (index: number) => T[];
// adjust(index, __, list)(fn)
export function adjust<T>(index: number, __: Placeholder, list: readonly T[]): (fn: (a: T) => T) => T[];
// adjust(__, fn)
export function adjust<T>(__: Placeholder, fn: (a: T) => T): {
// adjust(__, fn)(list)(index)
(list: readonly T[]): (index: number) => T[];
// adjust(__, fn)(__, index)(list)
(__: Placeholder, index: number): (list: readonly T[]) => T[];
// adjust(__, fn)(list, index)
(list: readonly T[], index: number): T[];
};

export function adjust<T>(index: number, fn: (a: T) => T): (list: readonly T[]) => T[];

// adjust(index, fn)(list)
export function adjust<T>(index: number, fn: (a: T) => T): (list: readonly T[]) => T[];
// adjust(index, fn)(list)
export function adjust<T>(index: number, fn: (a: T) => T): (list: readonly T[]) => T[];


// adjust(__, __, list)
export function adjust<T>(__: Placeholder, __2: Placeholder, list: readonly T[]): {
// adjust(__, __, list)(index, fn)
(index: number, fn: (a: T) => T): T[];
// adjust(__, __, list)(__, fn)(index)
(__3: Placeholder, fn: (a: T) => T): (index: number) => T[];
// adjust(__, __, list)(index)(fn)
(index: number): (fn: (a: T) => T) => T[];
// adjust(__, __, list)(__, fn)(index)
(__3: Placeholder, fn: (a: T) => T): (index: number) => T[];
// adjust(__, __, list)(index, fn)
(index: number, fn: (a: T) => T): T[];
};
// adjust(index, __, list)(fn)
export function adjust<T>(index: number, __: Placeholder, list: readonly T[]): (fn: (a: T) => T) => T[];
// adjust(__, fn, list)(index)
export function adjust<T>(__: Placeholder, fn: (a: T) => T, list: readonly T[]): (index: number) => T[];

// adjust(index, fn, list)
export function adjust<T>(index: number, fn: (a: T) => T, list: readonly T[]): T[];
24 changes: 12 additions & 12 deletions types/all.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { InferAllAType, Placeholder } from './util/tools';

// all(fn, list)
export function all<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
// all(fn, { all })
export function all<T, U extends { all: (fn: (a: T) => boolean) => boolean }>(fn: (a: T) => boolean, obj: U): boolean;

// all(__, list)(fn)
export function all<T>(__: Placeholder, list: readonly T[]): (fn: (a: T) => boolean) => boolean;
// all(__, { all })(fn)
export function all<U extends { all: (fn: (a: any) => boolean) => boolean }>(__: Placeholder, obj: U): (fn: (a: InferAllAType<U>) => boolean) => boolean;

// all (fn)
export function all<T>(fn: (a: T) => boolean): {
// all (fn)({ all })
<U extends { all: (fn: (a: T) => boolean) => boolean }>(obj: U): boolean;
// all (fn)(list)
(list: readonly T[]): boolean;
// all (fn)({ all })
// <U extends { all: (fn: (a: T) => boolean) => boolean }>(obj: U): boolean;gss
};

// all(__, { all })(fn)
export function all<U extends { all: (fn: (a: any) => boolean) => boolean }>(__: Placeholder, obj: U): (fn: (a: InferAllAType<U>) => boolean) => boolean;
// all(__, list)(fn)
export function all<T>(__: Placeholder, list: readonly T[]): (fn: (a: T) => boolean) => boolean;

// all(fn, { all })
export function all<T, U extends { all: (fn: (a: T) => boolean) => boolean }>(fn: (a: T) => boolean, obj: U): boolean;
// all(fn, list)
export function all<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
2 changes: 1 addition & 1 deletion types/and.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Placeholder } from './util/tools';

export function and<A>(a: A): <B>(b: B) => A | B;
export function and<B>(__: Placeholder, b: B): <A>(a: A) => A | B;
export function and<A, B>(a: A, b: B): A | B;
export function and<A>(a: A): <B>(b: B) => A | B;
4 changes: 2 additions & 2 deletions types/andThen.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Placeholder } from './util/tools';

export function andThen<A, B>(onSuccess: (a: A) => B | Promise<B>, promise: Promise<A>): Promise<B>;
export function andThen<A>(__: Placeholder, promise: Promise<A>): <B>(onSuccess: (a: A) => B | Promise<B>) => Promise<B>;
export function andThen<A, B>(onSuccess: (a: A) => B | Promise<B>): (promise: Promise<A>) => Promise<B>;
export function andThen<A>(__: Placeholder, promise: Promise<A>): <B>(onSuccess: (a: A) => B | Promise<B>) => Promise<B>;
export function andThen<A, B>(onSuccess: (a: A) => B | Promise<B>, promise: Promise<A>): Promise<B>;
19 changes: 9 additions & 10 deletions types/any.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { Placeholder, InferAnyAType } from './util/tools';

// any(fn, list)
export function any<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
// any(fn, { any })
export function any<T, U extends { any: (fn: (a: T) => boolean) => boolean }>(fn: (a: T) => boolean, obj: U): boolean;

// any(__, list)(fn)
export function any<T>(__: Placeholder, list: readonly T[]): (fn: (a: T) => boolean) => boolean;
// any(__, { any })(fn)
export function any<U extends { any: (fn: (a: any) => boolean) => boolean }>(___: Placeholder, obj: U): (fn: (a: InferAnyAType<U>) => boolean) => boolean;

// all(fn)
export function any<T>(fn: (a: T) => boolean): {
// any(fn)(list)
Expand All @@ -18,3 +8,12 @@ export function any<T>(fn: (a: T) => boolean): {
<U extends { any: (fn: (a: T) => boolean) => boolean }>(obj: U): boolean;
};

// any(__, list)(fn)
export function any<T>(__: Placeholder, list: readonly T[]): (fn: (a: T) => boolean) => boolean;
// any(__, { any })(fn)
export function any<U extends { any: (fn: (a: any) => boolean) => boolean }>(___: Placeholder, obj: U): (fn: (a: InferAnyAType<U>) => boolean) => boolean;

// any(fn, list)
export function any<T>(fn: (a: T) => boolean, list: readonly T[]): boolean;
// any(fn, { any })
export function any<T, U extends { any: (fn: (a: T) => boolean) => boolean }>(fn: (a: T) => boolean, obj: U): boolean;
2 changes: 1 addition & 1 deletion types/ap.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function ap<T, U>(fns: ReadonlyArray<(a: T) => U>, vs: readonly T[]): U[];
export function ap<T, U>(fns: ReadonlyArray<(a: T) => U>): (vs: readonly T[]) => U[];
export function ap<R, A, B>(fn: (r: R, a: A) => B, fn1: (r: R) => A): (r: R) => B;
export function ap<T, U>(fns: ReadonlyArray<(a: T) => U>, vs: readonly T[]): U[];
4 changes: 2 additions & 2 deletions types/aperture.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Placeholder, Tuple } from './util/tools';

export function aperture<N extends number, T>(n: N, list: readonly T[]): Array<Tuple<T, N>> | [];
export function aperture<T>(__: Placeholder, list: readonly T[]): <N extends number>(n: N) => Array<Tuple<T, N>> | [];
export function aperture<N extends number>(n: N): <T>(list: readonly T[]) => Array<Tuple<T, N>> | [];
export function aperture<T>(__: Placeholder, list: readonly T[]): <N extends number>(n: N) => Array<Tuple<T, N>> | [];
export function aperture<N extends number, T>(n: N, list: readonly T[]): Array<Tuple<T, N>> | [];
4 changes: 2 additions & 2 deletions types/append.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Placeholder } from './util/tools';

// append(el)(list)
export function append<T>(el: T): (list: readonly T[]) => T[];
// append(__, list)(el)
export function append<T>(__: Placeholder, list: readonly T[]): (el: T) => T[];
// append(el, list)
export function append<T>(el: T, list: readonly T[]): T[];
// append(el)(list)
export function append<T>(el: T): (list: readonly T[]) => T[];
4 changes: 2 additions & 2 deletions types/apply.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Placeholder } from './util/tools';

// apply(args)(fn)
export function apply<F extends (...args: readonly any[]) => any>(fn: F): (args: Parameters<F>) => ReturnType<F>;
// apply(args, fn)
// overload Placeholder options with versions for 1-to-5 args for best constraining
export function apply<A extends readonly [any]>(__: Placeholder, args: A): <F extends (...args: A) => any>(fn: F) => ReturnType<F>;
Expand All @@ -10,5 +12,3 @@ export function apply<A extends readonly [any, any, any, any, any]>(__: Placehol
export function apply<A extends readonly any[]>(__: Placeholder, args: A): <F extends (...args: A) => any>(fn: F) => ReturnType<F>;
// apply(args, fn)
export function apply<F extends (...args: readonly any[]) => any>(fn: F, args: Parameters<F>): ReturnType<F>;
// apply(args)(fn)
export function apply<F extends (...args: readonly any[]) => any>(fn: F): (args: Parameters<F>) => ReturnType<F>;
2 changes: 1 addition & 1 deletion types/applyTo.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function applyTo<T, U>(el: T, fn: (t: T) => U): U;
export function applyTo<T>(el: T): <U>(fn: (t: T) => U) => U;
export function applyTo<T, U>(el: T, fn: (t: T) => U): U;
2 changes: 1 addition & 1 deletion types/ascend.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Ord, Ordering } from './util/tools';

export function ascend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
export function ascend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
export function ascend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
4 changes: 2 additions & 2 deletions types/assocPath.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as _ from 'ts-toolbelt';
import { Placeholder, Path } from './util/tools';

export function assocPath<T, U>(path: Path): _.F.Curry<(a: T, b: U) => U>;
export function assocPath<T, U>(path: Path, val: T): (obj: U) => U;
export function assocPath<T, U>(__: Placeholder, val: T, obj: U): (path: Path) => U;
export function assocPath<T, U>(path: Path, __: Placeholder, obj: U): (val: T) => U;
export function assocPath<T, U>(path: Path, val: T, obj: U): U;
export function assocPath<T, U>(path: Path, val: T): (obj: U) => U;
export function assocPath<T, U>(path: Path): _.F.Curry<(a: T, b: U) => U>;
6 changes: 3 additions & 3 deletions types/bind.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function bind<F extends (...args: readonly any[]) => any, T>(
fn: F,
thisObj: T,
): (...args: Parameters<F>) => ReturnType<F>;
): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
export function bind<F extends (...args: readonly any[]) => any, T>(
fn: F,
): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
thisObj: T,
): (...args: Parameters<F>) => ReturnType<F>;
2 changes: 1 addition & 1 deletion types/both.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PredTypeguard, Pred } from './util/tools';

export function both<T extends Pred>(pred1: T): (pred2: T) => T;
export function both<T, TF1 extends T, TF2 extends T>(
pred1: PredTypeguard<T, TF1>,
pred2: PredTypeguard<T, TF2>,
): (a: T) => a is TF1 & TF2;
export function both<T extends Pred>(pred1: T, pred2: T): T;
export function both<T extends Pred>(pred1: T): (pred2: T) => T;
8 changes: 5 additions & 3 deletions types/clamp.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function clamp<T>(min: T, max: T, value: T): T;
export function clamp<T>(min: T): {
(max: T): (value: T) => T;
(max: T, value: T): T
};
export function clamp<T>(min: T, max: T): (value: T) => T;
export function clamp<T>(min: T): (max: T, value: T) => T;
export function clamp<T>(min: T): (max: T) => (value: T) => T;
export function clamp<T>(min: T, max: T, value: T): T;
2 changes: 1 addition & 1 deletion types/clone.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function clone<T>(value: T): T;
export function clone<T>(value: readonly T[]): T[];
export function clone<T>(value: T): T;
2 changes: 1 addition & 1 deletion types/collectBy.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K, list: readonly T[]): T[][];
export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K): (list: readonly T[]) => T[][];
export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K, list: readonly T[]): T[][];
8 changes: 4 additions & 4 deletions types/composeWith.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { AtLeastOneFunctionsFlowFromRightToLeft } from './util/tools';

export function composeWith<TArgs extends any[], TResult>(
transformer: (fn: (...args: any[]) => any, intermediatResult: any) => any,
fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
): (...args: TArgs) => TResult;
export function composeWith(
transformer: (fn: (...args: any[]) => any, intermediatResult: any) => any,
): <TArgs extends any[], TResult>(
fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
) => (...args: TArgs) => TResult;
export function composeWith<TArgs extends any[], TResult>(
transformer: (fn: (...args: any[]) => any, intermediatResult: any) => any,
fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,
): (...args: TArgs) => TResult;
2 changes: 1 addition & 1 deletion types/countBy.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function countBy<T>(fn: (a: T) => string | number, list: readonly T[]): { [index: string]: number };
export function countBy<T>(fn: (a: T) => string | number): (list: readonly T[]) => { [index: string]: number };
export function countBy<T>(fn: (a: T) => string | number, list: readonly T[]): { [index: string]: number };
8 changes: 4 additions & 4 deletions types/curryN.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as _ from 'ts-toolbelt';
import { Take } from './util/tools';

export function curryN<N extends number, F extends (...args: any) => any>(
length: N,
fn: F,
): _.F.Curry<(...a: _.T.Take<Parameters<F>, N>) => ReturnType<F>>;
export function curryN<N extends number>(
length: N,
): <F extends (...args: any) => any>(
fn: F,
) => _.F.Curry<(...a: _.T.Take<Parameters<F>, N>) => ReturnType<F>>;
export function curryN<N extends number, F extends (...args: any) => any>(
length: N,
fn: F,
): _.F.Curry<(...a: _.T.Take<Parameters<F>, N>) => ReturnType<F>>;
2 changes: 1 addition & 1 deletion types/descend.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Ord, Ordering } from './util/tools';

export function descend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
export function descend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
export function descend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;
2 changes: 1 addition & 1 deletion types/difference.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function difference<T>(list1: readonly T[], list2: readonly T[]): T[];
export function difference<T>(list1: readonly T[]): (list2: readonly T[]) => T[];
export function difference<T>(list1: readonly T[], list2: readonly T[]): T[];
10 changes: 5 additions & 5 deletions types/differenceWith.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export function differenceWith<T1, T2>(
pred: (a: T1, b: T2) => boolean,
list1: readonly T1[],
list2: readonly T2[],
): T1[];
export function differenceWith<T1, T2>(
pred: (a: T1, b: T2) => boolean,
): (list1: readonly T1[], list2: readonly T2[]) => T1[];
export function differenceWith<T1, T2>(
pred: (a: T1, b: T2) => boolean,
list1: readonly T1[],
): (list2: readonly T2[]) => T1[];
export function differenceWith<T1, T2>(
pred: (a: T1, b: T2) => boolean,
list1: readonly T1[],
list2: readonly T2[],
): T1[];
2 changes: 1 addition & 1 deletion types/dissoc.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function dissoc<T extends object, K extends keyof T>(prop: K, obj: T): Omit<T, K>;
export function dissoc<K extends string | number>(prop: K): <T extends object>(obj: T) => Omit<T, K>;
export function dissoc<T extends object, K extends keyof T>(prop: K, obj: T): Omit<T, K>;
2 changes: 1 addition & 1 deletion types/dissocPath.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Path } from './util/tools';

export function dissocPath<T>(path: Path, obj: any): T;
export function dissocPath<T>(path: Path): (obj: any) => T;
export function dissocPath<T>(path: Path, obj: any): T;
3 changes: 1 addition & 2 deletions types/divide.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Placeholder } from './util/tools';

export function divide(a: number): (b: number) => number;
export function divide(__: Placeholder, b: number): (a: number) => number;
export function divide(__: Placeholder): (b: number, a: number) => number;
export function divide(a: number, b: number): number;
export function divide(a: number): (b: number) => number;
4 changes: 2 additions & 2 deletions types/drop.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function drop<T>(n: number, xs: readonly T[]): T[];
export function drop(n: number, xs: string): string;
export function drop<T>(n: number): {
(xs: string): string;
(xs: readonly T[]): T[];
};
export function drop(n: number, xs: string): string;
export function drop<T>(n: number, xs: readonly T[]): T[];
6 changes: 3 additions & 3 deletions types/dropLast.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function dropLast<T>(n: number, xs: readonly T[]): T[];
export function dropLast(n: number, xs: string): string;
export function dropLast<T>(n: number): {
(xs: readonly T[]): T[];
(xs: string): string;
(xs: readonly T[]): T[];
};
export function dropLast<T>(n: number, xs: readonly T[]): T[];
export function dropLast(n: number, xs: string): string;
2 changes: 1 addition & 1 deletion types/dropLastWhile.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function dropLastWhile<T>(fn: (a: T) => boolean, list: readonly T[]): T[];
export function dropLastWhile<T>(fn: (a: T) => boolean): (list: readonly T[]) => T[];
export function dropLastWhile<T>(fn: (a: T) => boolean, list: readonly T[]): T[];
6 changes: 2 additions & 4 deletions types/dropRepeatsBy.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export function dropRepeatsBy<T, U>(fn: (a: T) => U): (list: readonly T[]) => T[];
export function dropRepeatsBy<T, U>(fn: (a: T) => U, list: readonly T[]): T[];
export function dropRepeatsBy<T, U>(
fn: (a: T) => U
): (list: readonly T[]) => T[];
export function dropRepeatsBy(fn: any): <T>(list: readonly T[]) => T[];

2 changes: 1 addition & 1 deletion types/dropRepeatsWith.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean, list: readonly T[]): T[];
export function dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean): (list: readonly T[]) => T[];
export function dropRepeatsWith<T>(predicate: (left: T, right: T) => boolean, list: readonly T[]): T[];
2 changes: 1 addition & 1 deletion types/dropWhile.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function dropWhile<T>(fn: (a: T) => boolean, list: readonly T[]): T[];
export function dropWhile<T>(fn: (a: T) => boolean): (list: readonly T[]) => T[];
export function dropWhile<T>(fn: (a: T) => boolean, list: readonly T[]): T[];
2 changes: 1 addition & 1 deletion types/either.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Pred } from './util/tools';

export function either<T extends Pred>(pred1: T, pred2: T): T;
export function either<T extends Pred>(pred1: T): (pred2: T) => T;
export function either<T extends Pred>(pred1: T, pred2: T): T;
4 changes: 2 additions & 2 deletions types/endsWith.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function endsWith(substr: string, str: string): boolean;
export function endsWith(substr: string): (str: string) => boolean;
export function endsWith<T>(subList: readonly T[], list: readonly T[]): boolean;
export function endsWith<T>(subList: readonly T[]): (list: readonly T[]) => boolean;
export function endsWith(substr: string, str: string): boolean;
export function endsWith<T>(subList: readonly T[], list: readonly T[]): boolean;
6 changes: 3 additions & 3 deletions types/eqBy.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function eqBy<T>(fn: (a: T) => unknown, a: T, b: T): boolean;
export function eqBy<T>(fn: (a: T) => unknown, a: T): (b: T) => boolean;
export function eqBy<T>(fn: (a: T) => unknown): {
(a: T, b: T): boolean;
(a: T): (b: T) => boolean;
(a: T, b: T): boolean;
};
export function eqBy<T>(fn: (a: T) => unknown, a: T): (b: T) => boolean;
export function eqBy<T>(fn: (a: T) => unknown, a: T, b: T): boolean;
2 changes: 1 addition & 1 deletion types/eqProps.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;
export function eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;
export function eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
export function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;
2 changes: 1 addition & 1 deletion types/equals.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Placeholder } from './util/tools';

export function equals<T>(a: T): (b: T) => boolean;
export function equals<T>(__: Placeholder, b: T): (a: T) => boolean;
export function equals<T>(a: T, b: T): boolean;
export function equals<T>(a: T): (b: T) => boolean;
2 changes: 1 addition & 1 deletion types/evolve.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Evolver, Evolvable, Evolve } from './util/tools';

export function evolve<E extends Evolver, V extends Evolvable<E>>(transformations: E, obj: V): Evolve<V, E>;
export function evolve<E extends Evolver>(transformations: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
export function evolve<E extends Evolver, V extends Evolvable<E>>(transformations: E, obj: V): Evolve<V, E>;
Loading