export type InferTypeFromArray = A extends Array ? Data : never; export type Nullable = T | null; export type Maybe = Nullable | undefined; export type NonNullable = Exclude; /** Deep/recursive variant of `Partial` */ export type DeepPartial = { [P in keyof T]?: DeepPartial; }; /** * A slightly "sounder" variant of `Array` for arrays * that will likely be index-accessed, in an unbounded way. */ export type SparseArray = Array; /** * A slightly "sounder" variant of `ReadonlyArray` for arrays * that will likely be index-accessed, in an unbounded way. */ export type ReadonlySparseArray = ReadonlyArray; /** * A slightly "sounder" variant of `Record` for objects * with unbounded key signature. * * When values are read from such object, the value * may be `undefined`, and the type system should warn about that. */ export type SaneRecord = string extends K ? Record : number extends K ? Record : symbol extends K ? Record : Record; /** * Type predicate function for filtering out falsy values * * NOTE: The function implementation should probably also * filter out `NaN` and other hard-to-type values. */ export type ExcludesFalsy = (x: T | null | undefined | false) => x is T;