Skip to content
Myr

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 file

Take 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 back
1import {
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 back
7 DRAFT_STATE,
8 Patch,9 PatchPath

docs: Update performance.mdx (#942)anabefore adoption8571fe0

lines 10–19why, one step back
10} 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>19

Merge pull request #1028 from immerjs/immer-10Michel Weststratebefore adoption2ef9a42

line 20why, one step back
20export const enum ArchType {

docs: Update performance.mdx (#942)anabefore adoption8571fe0

lines 21–32why, one step back
21 Object,
22 Array,23 Map,24 Set25}2627export interface ImmerBaseState {28 parent_?: ImmerState29 scope_: ImmerScope30 modified_: boolean31 finalized_: boolean32 isManual_: boolean

perf: Rewrite finalization system to use a callback approach instead of tree traversal (#1183)Mark Eriksonbefore adoptiond6c1202

lines 33–36why, one step back
33 assigned_: Map<any, boolean> | undefined
34 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 back
37}
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} & Base

perf: Rewrite finalization system to use a callback approach instead of tree traversal (#1183)Mark Eriksonbefore adoptiond6c1202

lines 49–55why, one step back
49
50export type GeneratePatches = (51 state: ImmerState,52 basePath: PatchPath,53 patches: Patch[],54 inversePatches: Patch[]55) => void