feat: initial implementation (#2409)

This commit is contained in:
Wyatt Johnson
2019-07-23 17:20:40 +00:00
committed by GitHub
parent fc464bd7c9
commit b1732f8a00
24 changed files with 646 additions and 70 deletions
+12
View File
@@ -20,6 +20,18 @@ export type Writeable<T> = { -readonly [P in keyof T]: T[P] };
*/
export type Promiseable<T> = Promise<T> | T;
export type Nullable<T> = { [P in keyof T]: T[P] | null };
export type DeepNullable<T> = T extends object
? {
[P in keyof T]: T[P] extends Array<infer U>
? Array<DeepNullable<U>>
: T[P] extends ReadonlyArray<infer V>
? ReadonlyArray<DeepNullable<V>>
: DeepNullable<T[P]>
}
: T | null;
/**
* Like Partial, but recurses down the object marking each field as Partial.
*/