export type Nullable = { [P in keyof T]: T[P] | null; }; /** * Allows support for TS 4.5's `exactOptionalPropertyTypes` option by ensuring a property present and undefined is valid * (since JSON.stringify ignores undefined properties) */ export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface = { [K in keyof Base]: Base[K] extends Exclude ? AddUndefinedToPossiblyUndefinedPropertiesOfInterface : AddUndefinedToPossiblyUndefinedPropertiesOfInterface | undefined; }; export type StrictPartial = AddUndefinedToPossiblyUndefinedPropertiesOfInterface>; export type StrictRequired = Required<{ [K in keyof Base]: Exclude }>; export type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; type Keys = keyof T; type DistributiveKeys = T extends unknown ? Keys : never; /** * Allows picking of keys from unions that are disjoint */ export type DistributivePick> = T extends unknown ? keyof Pick_ extends never ? never : { [P in keyof Pick_]: Pick_[P] } : never; type Pick_ = Pick>; /** * Allows omitting of keys from unions that are disjoint */ export type DistributiveOmit> = T extends unknown ? { [P in keyof Omit_]: Omit_[P] } : never; type Omit_ = Omit>;