// Looks horrible, but recursively makes all the properties in T optional // https://stackoverflow.com/a/49936686 export type DeepPartial = { [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends ReadonlyArray ? ReadonlyArray> : DeepPartial; };