sync local repositories
add booleanish predicates enable custom inspection default to sequence of any when sequence type is unknown
This commit is contained in:
@@ -2,6 +2,7 @@ import { AsyncSequence } from "./async/types.js";
|
||||
import { Sequence } from "./sync/types.js";
|
||||
|
||||
export type Predicate<T> = (obj: T) => boolean;
|
||||
export type AnyPredicate<T> = (obj: T) => unknown;
|
||||
export type FilterPredicate<TElement, TFiltered extends TElement> = (obj: TElement) => obj is TFiltered;
|
||||
export type Converter<TFrom, TTo> = (obj: TFrom) => TTo;
|
||||
export type BiConverter<TFromFirst, TFromSecond, TTo> = (first: TFromFirst, second: TFromSecond) => TTo;
|
||||
@@ -20,7 +21,9 @@ export type MaybeAsyncFunction<TFunc extends (...args: any) => any> = TFunc exte
|
||||
export type MaybeAsyncSequence<T> = Sequence<T> | AsyncSequence<T>;
|
||||
|
||||
export type AsyncPredicate<T> = AsyncFunction<Predicate<T>>;
|
||||
export type AsyncAnyPredicate<T> = AsyncFunction<AnyPredicate<T>>;
|
||||
export type MaybeAsyncPredicate<T> = MaybeAsyncFunction<Predicate<T>>;
|
||||
export type MaybeAsyncAnyPredicate<T> = MaybeAsyncFunction<AnyPredicate<T>>;
|
||||
export type AsyncConverter<TFrom, TTo> = AsyncFunction<Converter<TFrom, TTo>>;
|
||||
export type MaybeAsyncConverter<TFrom, TTo> = MaybeAsyncFunction<Converter<TFrom, TTo>>;
|
||||
export type AsyncBiConverter<TFromFirst, TFromSecond, TTo> = AsyncFunction<BiConverter<TFromFirst, TFromSecond, TTo>>;
|
||||
|
||||
Reference in New Issue
Block a user