types-internal.ts
This file
Path
src/types/types-internal.ts
55 lines · 1.0 KiB · TypeScript
Last changed by
chore: reduce size by using TS const enum (#812)houfengbefore adoptionb1fac9d
History of this fileTake it
The walk stopped after 200 commits: lines older than 497d1a0 point at it.
fix: Don't recurse into non-enumerable members when freezing tree. Fixes #590Michel Weststratebefore adoption497d1a0
lines 1–19why, 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>19chore: reduce size by using TS const enum (#812)houfengbefore adoptionb1fac9d
lines 20–25why, one step back20export const enum Archtype {21 Object,22 Array,23 Map,24 Set25}fix: Don't recurse into non-enumerable members when freezing tree. Fixes #590Michel Weststratebefore adoption497d1a0
line 26why, one step back26chore: reduce size by using TS const enum (#812)houfengbefore adoptionb1fac9d
lines 27–34why, one step back27export const enum ProxyType {28 ProxyObject,29 ProxyArray,30 Map,31 Set,32 ES5Object,33 ES5Array34}fix: Don't recurse into non-enumerable members when freezing tree. Fixes #590Michel Weststratebefore adoption497d1a0
lines 35–55why, one step back3536export interface ImmerBaseState {37 parent_?: ImmerState38 scope_: ImmerScope39 modified_: boolean40 finalized_: boolean41 isManual_: boolean42}4344export type ImmerState =45 | ProxyObjectState46 | ProxyArrayState47 | ES5ObjectState48 | ES5ArrayState49 | MapState50 | SetState5152// 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]: T55} & Base