Skip to content
Myr

types-internal.ts

This file

Path

src/types/types-internal.ts

42 lines · 866 bytes · TypeScript

Last changed by

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

History of this file

Take it

The walk stopped after 200 commits: lines older than 6555173 point at it.

fix: #785 fix type inference for produce incorrectly inferring promise (#786)hardfistbefore adoption6555173

lines 1–17why, one step back
1import {
2 SetState,3 ImmerScope,4 ProxyObjectState,5 ProxyArrayState,6 MapState,7 DRAFT_STATE8} from "../internal"910export type Objectish = AnyObject | AnyArray | AnyMap | AnySet11export type ObjectishNoSet = AnyObject | AnyArray | AnyMap1213export type AnyObject = {[key: string]: any}14export type AnyArray = Array<any>15export type AnySet = Set<any>16export type AnyMap = Map<any, any>17

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

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

chore: reduce size by using TS const enum (#812)houfengbefore adoptionb1fac9d

lines 19–23why, one step back
19 Object,
20 Array,21 Map,22 Set23}

fix: #785 fix type inference for produce incorrectly inferring promise (#786)hardfistbefore adoption6555173

lines 24–42why, one step back
24
25export interface ImmerBaseState {26 parent_?: ImmerState27 scope_: ImmerScope28 modified_: boolean29 finalized_: boolean30 isManual_: boolean31}3233export type ImmerState =34 | ProxyObjectState35 | ProxyArrayState36 | MapState37 | SetState3839// The _internal_ type used for drafts (not to be confused with Draft, which is public facing)40export type Drafted<Base = any, T extends ImmerState = ImmerState> = {41 [DRAFT_STATE]: T42} & Base