mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-29 15:44:13 +00:00
Add UnwrappedPromise and DeepPartial types
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
adf6d427fc
commit
5a95613dd7
6
typings/global.d.ts
vendored
6
typings/global.d.ts
vendored
@ -6,3 +6,9 @@ type Callback<T> = (err?: Error, res?: T) => void;
|
||||
|
||||
type Nullable<T> = T | null | undefined;
|
||||
type Resolvable<T> = T | Promise<T>;
|
||||
|
||||
type UnwrappedPromise = T extends PromiseLike<infer U> ? U : T;
|
||||
|
||||
type DeepPartial<T> = T extends object
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: T;
|
||||
|
Loading…
x
Reference in New Issue
Block a user