types-internal.ts
This file
Path
src/types/types-internal.ts
51 lines · 1.2 KiB · TypeScript
Last changed by
Moving files into foldersMichel Weststratebefore adoptionab49edc
History of this fileTake it
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152import { SetState, ImmerScope, ProxyObjectState, ProxyArrayState, ES5ObjectState, ES5ArrayState, MapState, DRAFT_STATE} from "../internal"
export type Objectish = AnyObject | AnyArray | AnyMap | AnySetexport type ObjectishNoSet = AnyObject | AnyArray | AnyMap
export type AnyObject = {[key: string]: any}export type AnyArray = Array<any>export type AnySet = Set<any>export type AnyMap = Map<any, any>
export const ArchtypeObject = 0export const ArchtypeArray = 1export const ArchtypeMap = 2export const ArchtypeSet = 3
export const ProxyTypeProxyObject = 0export const ProxyTypeProxyArray = 1export const ProxyTypeES5Object = 4export const ProxyTypeES5Array = 5export const ProxyTypeMap = 2export const ProxyTypeSet = 3
export interface ImmerBaseState { parent_?: ImmerState scope_: ImmerScope modified_: boolean finalized_: boolean isManual_: boolean}
export type ImmerState = | ProxyObjectState | ProxyArrayState | ES5ObjectState | ES5ArrayState | MapState | SetState
// The _internal_ type used for drafts (not to be confused with Draft, which is public facing)export type Drafted<Base = any, T extends ImmerState = ImmerState> = { [DRAFT_STATE]: T} & Base