types-internal.ts
This file
Path
src/types/types-internal.ts
55 lines · 1.2 KiB · TypeScript
Last changed by
perf: Rewrite finalization system to use a callback approach instead of tree traversal (#1183)Mark Eriksonbefore adoptiond6c1202
History of this fileTake it
The walk stopped after 200 commits: lines older than 8571fe0 point at it.
docs: Update performance.mdx (#942)anabefore adoption8571fe0
lines 1–6why, one step back1import {2 SetState,3 ImmerScope,4 ProxyObjectState,5 ProxyArrayState,6 MapState,perf: Rewrite finalization system to use a callback approach instead of tree traversal (#1183)Mark Eriksonbefore adoptiond6c1202
lines 7–9why, one step back7 DRAFT_STATE,8 Patch,9 PatchPathdocs: Update performance.mdx (#942)anabefore adoption8571fe0
lines 10–19why, one step back10} 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>19Merge pull request #1028 from immerjs/immer-10Michel Weststratebefore adoption2ef9a42
line 20why, one step back20export const enum ArchType {docs: Update performance.mdx (#942)anabefore adoption8571fe0
lines 21–32why, one step back21 Object,22 Array,23 Map,24 Set25}2627export interface ImmerBaseState {28 parent_?: ImmerState29 scope_: ImmerScope30 modified_: boolean31 finalized_: boolean32 isManual_: booleanperf: Rewrite finalization system to use a callback approach instead of tree traversal (#1183)Mark Eriksonbefore adoptiond6c1202
lines 33–36why, one step back33 assigned_: Map<any, boolean> | undefined34 key_?: string | number | symbol35 callbacks_: ((scope: ImmerScope) => void)[]36 draftLocations_?: Map<any, (string | number | symbol)[]>docs: Update performance.mdx (#942)anabefore adoption8571fe0
lines 37–48why, one step back37}3839export type ImmerState =40 | ProxyObjectState41 | ProxyArrayState42 | MapState43 | SetState4445// The _internal_ type used for drafts (not to be confused with Draft, which is public facing)46export type Drafted<Base = any, T extends ImmerState = ImmerState> = {47 [DRAFT_STATE]: T48} & Baseperf: Rewrite finalization system to use a callback approach instead of tree traversal (#1183)Mark Eriksonbefore adoptiond6c1202
lines 49–55why, one step back4950export type GeneratePatches = (51 state: ImmerState,52 basePath: PatchPath,53 patches: Patch[],54 inversePatches: Patch[]55) => void