diff --git a/src/immer.d.ts b/src/immer.d.ts index 8ef93663..448c18e7 100644 --- a/src/immer.d.ts +++ b/src/immer.d.ts @@ -21,19 +21,15 @@ type IsTuple> = T extends never[] ? (U[] extends T ? false : true) : never -export type DraftObject = T extends object - ? T extends AtomicObject - ? T - : {-readonly [P in keyof T]: Draft} - : T +export type DraftObject = T extends AtomicObject + ? T + : {-readonly [P in keyof T]: Draft} -export type DraftArray = T extends ReadonlyArray - ? {[P in keyof T]: Array>}[keyof T] - : Array> +export type DraftArray = {[P in U]: Array}[U] type ArrayMethod = Exclude -export type DraftTuple> = Id< +export type DraftTuple = Id< {[P in keyof T]: P extends ArrayMethod ? never : Draft} >