Skip to content

Commit

Permalink
Add note explaining Draft type
Browse files Browse the repository at this point in the history
  • Loading branch information
smichelJW committed Aug 15, 2022
1 parent e28b53f commit 8643945
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/types/types-external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type WeakReferences = IfAvailable<WeakMap<any, any>> | IfAvailable<WeakSet<any>>

export type WritableDraft<T> = {-readonly [K in keyof T]: Draft<T[K]>}

/** Convert a readonly type into a mutable type, if possible */
export type Draft<T> = T extends PrimitiveType
? T
: T extends AtomicObject
Expand Down

0 comments on commit 8643945

Please sign in to comment.