mirror of
https://github.com/wassname/talk.git
synced 2026-07-24 13:20:47 +08:00
feat: initial implementation (#2409)
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user