File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -154,16 +154,22 @@ export function setUseProxies(useProxies: boolean): void
154154 */
155155export function applyPatches < S > ( base : S , patches : Patch [ ] ) : S
156156
157+ /** Get the underlying object that is represented by the given draft */
157158export function original < T > ( value : T ) : T | void
158159
160+ /** For detecting an Immer draft */
159161export function isDraft ( value : any ) : boolean
160162
161163export class Immer {
162164 constructor ( config : {
163165 useProxies ?: boolean
164166 autoFreeze ?: boolean
165- onAssign ?: ( state : ImmerState , prop : keyof any , value : any ) => void
166- onDelete ?: ( state : ImmerState , prop : keyof any ) => void
167+ onAssign ?: (
168+ state : ImmerState ,
169+ prop : string | number ,
170+ value : unknown
171+ ) => void
172+ onDelete ?: ( state : ImmerState , prop : string | number ) => void
167173 onCopy ?: ( state : ImmerState ) => void
168174 } )
169175 /**
@@ -213,5 +219,5 @@ export interface ImmerState<T = any> {
213219 parent ?: ImmerState
214220 base : T
215221 copy : T
216- assigned : { [ prop : string ] : boolean }
222+ assigned : { [ prop : string ] : boolean ; [ index : number ] : boolean }
217223}
You can’t perform that action at this time.
0 commit comments