1 | import {
|
2 | SetState,
|
3 | ImmerScope,
|
4 | ProxyObjectState,
|
5 | ProxyArrayState,
|
6 | MapState,
|
7 | DRAFT_STATE
|
8 | } from "../internal"
|
9 |
|
10 | export type Objectish = AnyObject | AnyArray | AnyMap | AnySet
|
11 | export type ObjectishNoSet = AnyObject | AnyArray | AnyMap
|
12 |
|
13 | export type AnyObject = {[key: string]: any}
|
14 | export type AnyArray = Array<any>
|
15 | export type AnySet = Set<any>
|
16 | export type AnyMap = Map<any, any>
|
17 |
|
18 | export const enum ArchType {
|
19 | Object,
|
20 | Array,
|
21 | Map,
|
22 | Set
|
23 | }
|
24 |
|
25 | export interface ImmerBaseState {
|
26 | parent_?: ImmerState
|
27 | scope_: ImmerScope
|
28 | modified_: boolean
|
29 | finalized_: boolean
|
30 | isManual_: boolean
|
31 | }
|
32 |
|
33 | export type ImmerState =
|
34 | | ProxyObjectState
|
35 | | ProxyArrayState
|
36 | | MapState
|
37 | | SetState
|
38 |
|
39 |
|
40 | export type Drafted<Base = any, T extends ImmerState = ImmerState> = {
|
41 | [DRAFT_STATE]: T
|
42 | } & Base
|