/** A function that returns the value of the key */ export type KeySelector = (propertyName: K) => T[K]; /** A key and value pair */ export type KeyValuePair = { readonly key: TKey; readonly value: TValue; }; /** Shortcut for T | null */ export type Nullable = T | null; /** Shortcut for T | undefined */ export type Undefinable = T | undefined; /** Shortcut for T | Promise */ export type Awaitable = T | PromiseLike; /** Helper type for representing constructors */ export type ConstructorFor = { new (...args: any[]): T; }; /** Shortcut for () => T */ export type Action = () => T; /** Shortcut for (arg1: Tin) => Tout */ export type Func1 = (arg1: Tin) => Tout; /** Shortcut for (arg1: Tin1, arg2: Tin2) => Tout */ export type Func2 = (arg1: Tin1, arg2: Tin2) => Tout; /** Shortcut for (arg1: Tin1, arg2: Tin2, arg3: Tin3) => Tout */ export type Func3 = (arg1: Tin1, arg2: Tin2, arg3: Tin3) => Tout; /** Shortcut for (arg1: Tin1, arg2: Tin2, arg3: Tin3, arg4: Tin4) => Tout */ export type Func4 = (arg1: Tin1, arg2: Tin2, arg3: Tin3, arg4: Tin4) => Tout; /** Shortcut for (arg1: Tin1, arg2: Tin2, arg3: Tin3, arg4: Tin4, arg5: Tin5) => Tout */ export type Func5 = (arg1: Tin1, arg2: Tin2, arg3: Tin3, arg4: Tin4, arg5: Tin5) => Tout; /** Shortcut for (arg1: Tin1, arg2: Tin2, arg3: Tin3, arg4: Tin4, arg5: Tin5, arg6: Tin6) => Tout */ export type Func6 = (arg1: Tin1, arg2: Tin2, arg3: Tin3, arg4: Tin4, arg5: Tin5, arg6: Tin6) => Tout; /** Takes an item and return a boolean value from an assertion on the item */ export type Predicate = (item: T) => boolean; /** Takes an item and maps it to TReturn */ export type Selector = (item: T) => TReturn; /** Represents a comparision between two items of the same type. Should return 0 if they are the same, >0 if a > b, <0 if a < b. */ export type Comparison = (a: T, y: T) => number; /** Represents any function*/ export type AnyFunction = (...args: unknown[]) => unknown; /** interface for disposable objects */ export interface IDisposable { dispose(): void; }