/** * The type of all values; nothing is known about it a priori * except that it exists. The same idea as Flow's `mixed` type. * * @see https://github.com/Microsoft/TypeScript/issues/10715 */ export type unknown = {} | undefined | null; /** * Remove the variants of the second union of string literals from * the first. * * @see https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458 */ export type Diff = ( & { [P in T]: P } & { [P in U]: never } & { [x: string]: never } )[T]; /** * Find the overlapping variants between two string unions. */ export type Overlap = Diff>; /** * Drop keys `K` from `T`. * * @see https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458 */ export type Omit = Pick>; /** * Like `T & U`, but where there are overlapping properties using the * type from U only. * * @see https://github.com/pelotom/type-zoo/issues/2 * @see https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458 */ export type Overwrite = Omit>> & U; /** * `T` without the possibility of `undefined` or `null`. * * @see https://github.com/Microsoft/TypeScript/issues/15012#issuecomment-346499713 */ export type NonNullable = T & {}; /** * Make all properties of `T` required and non-nullable. * * @see https://github.com/Microsoft/TypeScript/issues/15012#issuecomment-346499713 */ export type Required = { [P in Purify]: NonNullable; }; type Purify = { [P in T]: T; }[T];