export type Optional = Omit & Partial; export type ExtractKeys = T[K] extends U ? K : never; export type ValueOf = T[keyof T]; export type UnionToIntersection = (T extends any ? (x: T) => void : never) extends (x: infer U) => void ? U : never; export type Awaited = T extends PromiseLike ? Awaited : T; // `T extends any` is a trick to apply a operator to each member of a union export type KeyOfEach = T extends any ? keyof T : never; // Taken from https://effectivetypescript.com/2020/04/09/jsonify/ export type Jsonify = T extends Date ? string : T extends object ? { [k in keyof T]: Jsonify; } : T; export type AtLeast = Partial & Pick; export type RequiredField = T & Required>;