types-internal.ts
This file
Path
src/types/types-internal.ts
51 lines · 1.2 KiB · TypeScript
Last changed by
Merge pull request #536 from immerjs/multi-bundleMichel Weststratebefore adoption0d87fc8
History of this fileTake it
Merge pull request #536 from immerjs/multi-bundleMichel Weststratebefore adoption0d87fc8
lines 1–51why, one step back1import {2 SetState,3 ImmerScope,4 ProxyObjectState,5 ProxyArrayState,6 ES5ObjectState,7 ES5ArrayState,8 MapState,9 DRAFT_STATE10} from "../internal"1112export type Objectish = AnyObject | AnyArray | AnyMap | AnySet13export type ObjectishNoSet = AnyObject | AnyArray | AnyMap1415export type AnyObject = {[key: string]: any}16export type AnyArray = Array<any>17export type AnySet = Set<any>18export type AnyMap = Map<any, any>1920export const ArchtypeObject = 021export const ArchtypeArray = 122export const ArchtypeMap = 223export const ArchtypeSet = 32425export const ProxyTypeProxyObject = 026export const ProxyTypeProxyArray = 127export const ProxyTypeES5Object = 428export const ProxyTypeES5Array = 529export const ProxyTypeMap = 230export const ProxyTypeSet = 33132export interface ImmerBaseState {33 parent_?: ImmerState34 scope_: ImmerScope35 modified_: boolean36 finalized_: boolean37 isManual_: boolean38}3940export type ImmerState =41 | ProxyObjectState42 | ProxyArrayState43 | ES5ObjectState44 | ES5ArrayState45 | MapState46 | SetState4748// The _internal_ type used for drafts (not to be confused with Draft, which is public facing)49export type Drafted<Base = any, T extends ImmerState = ImmerState> = {50 [DRAFT_STATE]: T51} & Base