1import { 2 SetState, 3 ImmerScope, 4 ProxyObjectState, 5 ProxyArrayState, 6 ES5ObjectState, 7 ES5ArrayState, 8 MapState, 9 DRAFT_STATE 10} from "../internal" 11 12export type Objectish = AnyObject | AnyArray | AnyMap | AnySet 13export type ObjectishNoSet = AnyObject | AnyArray | AnyMap 14 15export type AnyObject = {[key: string]: any} 16export type AnyArray = Array<any> 17export type AnySet = Set<any> 18export type AnyMap = Map<any, any> 19 20export const enum Archtype { 21 Object, 22 Array, 23 Map, 24 Set 25} 26 27export const enum ProxyType { 28 ProxyObject, 29 ProxyArray, 30 Map, 31 Set, 32 ES5Object, 33 ES5Array 34} 35 36export interface ImmerBaseState { 37 parent_?: ImmerState 38 scope_: ImmerScope 39 modified_: boolean 40 finalized_: boolean 41 isManual_: boolean 42} 43 44export type ImmerState = 45 | ProxyObjectState 46 | ProxyArrayState 47 | ES5ObjectState 48 | ES5ArrayState 49 | MapState 50 | SetState 51 52// The _internal_ type used for drafts (not to be confused with Draft, which is public facing) 53export type Drafted<Base = any, T extends ImmerState = ImmerState> = { 54 [DRAFT_STATE]: T 55} & Base 56