/** * Value that can be awaited */ export type Awaitable = T | PromiseLike; /** * Defines an assertion function */ export type AssertionFn = (data: D) => asserts data is R; /** * Build type as intersection of all map's value types * MapValueIntersection<{ a: 'a', b: 'b' }> => 'a' & 'b' */ export type MapValueIntersection = UnionToIntersection; export interface NonNullObject extends Record { } /** * Defines a predicate function */ export type PredicateFn = (data: D) => data is R; /** * Transforms a union into an intersection: * UnionToIntersection<'a' | 'b'> => 'a' & 'b' */ export type UnionToIntersection = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;