atom.io 0.6.7 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +241 -263
- package/dist/index.d.ts +241 -263
- package/dist/index.js +28 -1911
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1871
- package/dist/index.mjs.map +1 -1
- package/introspection/dist/index.d.mts +121 -176
- package/introspection/dist/index.d.ts +121 -176
- package/introspection/dist/index.js +6 -346
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/index.mjs +5 -324
- package/introspection/dist/index.mjs.map +1 -1
- package/json/dist/index.d.mts +37 -8
- package/json/dist/index.d.ts +37 -8
- package/json/dist/index.js +31 -48
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs +6 -14
- package/json/dist/index.mjs.map +1 -1
- package/package.json +30 -14
- package/react/dist/index.js +34 -83
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs +7 -43
- package/react/dist/index.mjs.map +1 -1
- package/react-devtools/dist/index.css +1 -42
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +128 -193
- package/react-devtools/dist/index.d.ts +128 -193
- package/react-devtools/dist/index.js +56 -4154
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +19 -4117
- package/react-devtools/dist/index.mjs.map +1 -1
- package/realtime/dist/index.d.mts +7 -11
- package/realtime/dist/index.d.ts +7 -11
- package/realtime/dist/index.js +26 -185
- package/realtime/dist/index.js.map +1 -1
- package/realtime/dist/index.mjs +4 -149
- package/realtime/dist/index.mjs.map +1 -1
- package/realtime-react/dist/index.d.mts +12 -16
- package/realtime-react/dist/index.d.ts +12 -16
- package/realtime-react/dist/index.js +41 -214
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/dist/index.mjs +9 -169
- package/realtime-react/dist/index.mjs.map +1 -1
- package/src/atom.ts +7 -6
- package/src/index.ts +12 -9
- package/src/logger.ts +5 -5
- package/src/selector.ts +16 -14
- package/src/silo.ts +36 -39
- package/src/subscribe.ts +25 -20
- package/src/timeline.ts +9 -4
- package/src/transaction.ts +3 -4
- package/src/internal/atom-internal.ts +0 -54
- package/src/internal/families-internal.ts +0 -141
- package/src/internal/get.ts +0 -129
- package/src/internal/index.ts +0 -15
- package/src/internal/is-default.ts +0 -35
- package/src/internal/operation.ts +0 -139
- package/src/internal/selector/create-read-write-selector.ts +0 -66
- package/src/internal/selector/create-readonly-selector.ts +0 -46
- package/src/internal/selector/index.ts +0 -4
- package/src/internal/selector/lookup-selector-sources.ts +0 -16
- package/src/internal/selector/register-selector.ts +0 -57
- package/src/internal/selector/trace-selector-atoms.ts +0 -43
- package/src/internal/selector/update-selector-atoms.ts +0 -33
- package/src/internal/selector-internal.ts +0 -58
- package/src/internal/set.ts +0 -99
- package/src/internal/store.ts +0 -151
- package/src/internal/subject.ts +0 -24
- package/src/internal/subscribe-internal.ts +0 -88
- package/src/internal/time-travel-internal.ts +0 -91
- package/src/internal/timeline/add-atom-to-timeline.ts +0 -168
- package/src/internal/timeline/index.ts +0 -1
- package/src/internal/timeline-internal.ts +0 -107
- package/src/internal/transaction/abort-transaction.ts +0 -12
- package/src/internal/transaction/apply-transaction.ts +0 -57
- package/src/internal/transaction/build-transaction.ts +0 -33
- package/src/internal/transaction/index.ts +0 -25
- package/src/internal/transaction/redo-transaction.ts +0 -23
- package/src/internal/transaction/undo-transaction.ts +0 -23
- package/src/internal/transaction-internal.ts +0 -61
- package/src/introspection/attach-atom-index.ts +0 -73
- package/src/introspection/attach-introspection-states.ts +0 -42
- package/src/introspection/attach-selector-index.ts +0 -77
- package/src/introspection/attach-timeline-family.ts +0 -59
- package/src/introspection/attach-timeline-index.ts +0 -36
- package/src/introspection/attach-transaction-index.ts +0 -38
- package/src/introspection/attach-transaction-logs.ts +0 -40
- package/src/introspection/index.ts +0 -20
- package/src/json/index.ts +0 -1
- package/src/json/select-json.ts +0 -18
- package/src/react/index.ts +0 -2
- package/src/react/store-context.tsx +0 -13
- package/src/react/store-hooks.ts +0 -47
- package/src/react-devtools/AtomIODevtools.tsx +0 -107
- package/src/react-devtools/Button.tsx +0 -24
- package/src/react-devtools/StateEditor.tsx +0 -70
- package/src/react-devtools/StateIndex.tsx +0 -153
- package/src/react-devtools/TimelineIndex.tsx +0 -92
- package/src/react-devtools/TransactionIndex.tsx +0 -70
- package/src/react-devtools/Updates.tsx +0 -145
- package/src/react-devtools/devtools.scss +0 -311
- package/src/react-devtools/index.ts +0 -72
- package/src/react-explorer/AtomIOExplorer.tsx +0 -218
- package/src/react-explorer/explorer-effects.ts +0 -20
- package/src/react-explorer/explorer-states.ts +0 -217
- package/src/react-explorer/index.ts +0 -23
- package/src/react-explorer/space-states.ts +0 -72
- package/src/react-explorer/view-states.ts +0 -41
- package/src/realtime/README.md +0 -33
- package/src/realtime/hook-composition/expose-family.ts +0 -101
- package/src/realtime/hook-composition/expose-single.ts +0 -38
- package/src/realtime/hook-composition/expose-timeline.ts +0 -60
- package/src/realtime/hook-composition/index.ts +0 -12
- package/src/realtime/hook-composition/receive-state.ts +0 -29
- package/src/realtime/hook-composition/receive-transaction.ts +0 -18
- package/src/realtime/index.ts +0 -1
- package/src/realtime-react/index.ts +0 -3
- package/src/realtime-react/realtime-context.tsx +0 -30
- package/src/realtime-react/realtime-hooks.ts +0 -39
- package/src/realtime-react/realtime-state.ts +0 -10
- package/src/realtime-react/use-pull-family-member.ts +0 -26
- package/src/realtime-react/use-pull-family.ts +0 -24
- package/src/realtime-react/use-pull.ts +0 -22
- package/src/realtime-react/use-push.ts +0 -25
- package/src/realtime-react/use-server-action.ts +0 -33
- package/src/realtime-testing/index.ts +0 -1
- package/src/realtime-testing/setup-realtime-test.tsx +0 -159
- package/src/web-effects/index.ts +0 -1
- package/src/web-effects/storage.ts +0 -30
|
@@ -1,171 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Refinement } from 'fp-ts/Refinement';
|
|
1
|
+
import { StateToken, FamilyMetadata, TimelineUpdate, StateUpdate, TransactionUpdate, ƒn, AtomToken, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, Logger, __INTERNAL__, ReadonlySelectorFamily } from 'atom.io';
|
|
3
2
|
|
|
4
|
-
type
|
|
3
|
+
type primitive = boolean | number | string | null;
|
|
5
4
|
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
type SelectorTokenIndex = StateTokenIndex<ReadonlySelectorToken$1<unknown> | SelectorToken$1<unknown>>;
|
|
9
|
-
|
|
10
|
-
type JsonInterface<T, J extends Json = Json> = {
|
|
11
|
-
toJson: (t: T) => J;
|
|
12
|
-
fromJson: (json: J) => T;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type Primitive = boolean | number | string | null;
|
|
16
|
-
type Serializable = Primitive | Readonly<{
|
|
5
|
+
type Serializable = primitive | Readonly<{
|
|
17
6
|
[key: string]: Serializable;
|
|
18
7
|
}> | ReadonlyArray<Serializable>;
|
|
19
|
-
type
|
|
20
|
-
type JsonArr<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
21
|
-
type Json = JsonArr | JsonObj | Primitive;
|
|
22
|
-
|
|
23
|
-
type Identified = {
|
|
24
|
-
id: string;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
|
|
28
|
-
type RelationType = typeof RELATION_TYPES[number];
|
|
29
|
-
type RelationData<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
30
|
-
contents: JsonObj<string, CONTENT>;
|
|
31
|
-
relations: JsonObj<string, string[]>;
|
|
32
|
-
relationType: RelationType;
|
|
33
|
-
a: A;
|
|
34
|
-
b: B;
|
|
35
|
-
};
|
|
36
|
-
type IsRelationDataOptions<CONTENT extends JsonObj | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
37
|
-
from?: A;
|
|
38
|
-
to?: B;
|
|
39
|
-
isContent?: (json: Json) => json is CONTENT;
|
|
40
|
-
};
|
|
8
|
+
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
41
9
|
|
|
42
|
-
type
|
|
43
|
-
type
|
|
10
|
+
type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
|
|
11
|
+
type Cardinality = `1:1` | `1:n` | `n:n`;
|
|
44
12
|
|
|
45
|
-
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly b: B;
|
|
49
|
-
readonly relations: Record<string, string[]>;
|
|
50
|
-
readonly contents: Record<string, CONTENT>;
|
|
51
|
-
constructor(json?: Partial<RelationData<CONTENT, A, B>>);
|
|
52
|
-
toJSON(): RelationData<CONTENT, A, B>;
|
|
53
|
-
static fromJSON<CONTENT extends JsonObj | null, A extends string, B extends string>(json: Json, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
|
|
54
|
-
from<AA extends string>(newA: AA): Join<CONTENT, AA, B>;
|
|
55
|
-
to<BB extends string>(newB: BB): Join<CONTENT, A, BB>;
|
|
56
|
-
makeJsonInterface: (...params: CONTENT extends null ? [
|
|
57
|
-
] : [Refinement<unknown, CONTENT>]) => JsonInterface<Join<CONTENT, A, B>, RelationData<CONTENT, A, B>>;
|
|
58
|
-
getRelatedId(id: string): string | undefined;
|
|
59
|
-
getRelatedIds(id: string): string[];
|
|
60
|
-
getContent(idA: string, idB: string): CONTENT | undefined;
|
|
61
|
-
getRelationEntries(id: string): [string, CONTENT][];
|
|
62
|
-
getRelationRecord(id: string): Record<string, CONTENT>;
|
|
63
|
-
getRelation(id: string): NullSafeUnion<Identified, CONTENT> | undefined;
|
|
64
|
-
getRelations(id: string): NullSafeUnion<Identified, CONTENT>[];
|
|
65
|
-
setRelations(subject: {
|
|
66
|
-
[from in A]: string;
|
|
67
|
-
} | {
|
|
68
|
-
[to in B]: string;
|
|
69
|
-
}, relations: NullSafeUnion<Identified, CONTENT>[]): Join<CONTENT, A, B>;
|
|
70
|
-
set(relation: {
|
|
71
|
-
[key in A | B]: string;
|
|
72
|
-
}, ...rest: NullSafeRest<CONTENT>): Join<CONTENT, A, B>;
|
|
73
|
-
remove(relation: Partial<Record<A | B, string>>): Join<CONTENT, A, B>;
|
|
13
|
+
interface JunctionEntries<Content extends Object$1 | null> extends Object$1 {
|
|
14
|
+
readonly relations: [string, string[]][];
|
|
15
|
+
readonly contents: [string, Content][];
|
|
74
16
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
94
|
-
type KeyedStateUpdate<T> = StateUpdate<T> & {
|
|
95
|
-
key: string;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type TimelineToken = {
|
|
99
|
-
key: string;
|
|
100
|
-
type: `timeline`;
|
|
101
|
-
};
|
|
102
|
-
type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
|
|
103
|
-
|
|
104
|
-
type AtomToken<_> = {
|
|
105
|
-
key: string;
|
|
106
|
-
type: `atom`;
|
|
107
|
-
family?: FamilyMetadata;
|
|
108
|
-
__brand?: _;
|
|
109
|
-
};
|
|
110
|
-
type SelectorToken<_> = {
|
|
111
|
-
key: string;
|
|
112
|
-
type: `selector`;
|
|
113
|
-
family?: FamilyMetadata;
|
|
114
|
-
__brand?: _;
|
|
115
|
-
};
|
|
116
|
-
type StateToken<T> = AtomToken<T> | SelectorToken<T>;
|
|
117
|
-
type ReadonlySelectorToken<_> = {
|
|
118
|
-
key: string;
|
|
119
|
-
type: `readonly_selector`;
|
|
120
|
-
family?: FamilyMetadata;
|
|
121
|
-
__brand?: _;
|
|
122
|
-
};
|
|
123
|
-
type FamilyMetadata = {
|
|
124
|
-
key: string;
|
|
125
|
-
subKey: string;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `transactions` | `valueMap`>;
|
|
129
|
-
interface Store {
|
|
130
|
-
atoms: Map<string, Atom<any>>;
|
|
131
|
-
atomsThatAreDefault: Set<string>;
|
|
132
|
-
readonlySelectors: Map<string, ReadonlySelector<any>>;
|
|
133
|
-
selectorAtoms: Join<null, `selectorKey`, `atomKey`>;
|
|
134
|
-
selectorGraph: Join<{
|
|
135
|
-
source: string;
|
|
136
|
-
}>;
|
|
137
|
-
selectors: Map<string, Selector<any>>;
|
|
138
|
-
timelineAtoms: Join<null, `timelineKey`, `atomKey`>;
|
|
139
|
-
timelines: Map<string, Timeline>;
|
|
140
|
-
transactions: Map<string, Transaction<any>>;
|
|
141
|
-
valueMap: Map<string, any>;
|
|
142
|
-
subject: {
|
|
143
|
-
atomCreation: Subject<AtomToken<unknown>>;
|
|
144
|
-
selectorCreation: Subject<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
145
|
-
transactionCreation: Subject<TransactionToken<ƒn>>;
|
|
146
|
-
timelineCreation: Subject<TimelineToken>;
|
|
147
|
-
operationStatus: Subject<OperationProgress>;
|
|
148
|
-
};
|
|
149
|
-
operation: OperationProgress;
|
|
150
|
-
transactionStatus: TransactionStatus<ƒn>;
|
|
151
|
-
config: {
|
|
152
|
-
name: string;
|
|
153
|
-
logger: Logger | null;
|
|
154
|
-
logger__INTERNAL: Logger;
|
|
17
|
+
interface JunctionSchema<ASide extends string, BSide extends string> extends Object$1 {
|
|
18
|
+
readonly between: [a: ASide, b: BSide];
|
|
19
|
+
readonly cardinality: Cardinality;
|
|
20
|
+
}
|
|
21
|
+
type JunctionAdvancedConfiguration<Content extends Object$1 | null> = {
|
|
22
|
+
externalStore?: (Content extends null ? {
|
|
23
|
+
getContent?: undefined;
|
|
24
|
+
setContent?: undefined;
|
|
25
|
+
deleteContent?: undefined;
|
|
26
|
+
} : {
|
|
27
|
+
getContent: (contentKey: string) => Content | undefined;
|
|
28
|
+
setContent: (contentKey: string, content: Content) => void;
|
|
29
|
+
deleteContent: (g: any) => void;
|
|
30
|
+
}) & {
|
|
31
|
+
addRelation: (a: string, b: string) => void;
|
|
32
|
+
deleteRelation: (a: string, b: string) => void;
|
|
33
|
+
getRelatedKeys: (key: string) => Set<string> | undefined;
|
|
34
|
+
has: (a: string, b?: string) => boolean;
|
|
155
35
|
};
|
|
36
|
+
isContent?: Refinement<unknown, Content>;
|
|
37
|
+
makeContentKey?: (a: string, b: string) => string;
|
|
38
|
+
};
|
|
39
|
+
type JunctionJSON<ASide extends string, BSide extends string, Content extends Object$1 | null> = JunctionEntries<Content> & JunctionSchema<ASide, BSide>;
|
|
40
|
+
declare class Junction<ASide extends string, BSide extends string, Content extends Object$1 | null = null> {
|
|
41
|
+
readonly a: ASide;
|
|
42
|
+
readonly b: BSide;
|
|
43
|
+
readonly cardinality: Cardinality;
|
|
44
|
+
readonly relations: Map<string, Set<string>>;
|
|
45
|
+
readonly contents: Map<string, Content>;
|
|
46
|
+
isContent: Refinement<unknown, Content> | null;
|
|
47
|
+
makeContentKey: (a: string, b: string) => string;
|
|
48
|
+
getRelatedKeys(key: string): Set<string> | undefined;
|
|
49
|
+
protected addRelation(a: string, b: string): void;
|
|
50
|
+
protected deleteRelation(a: string, b: string): void;
|
|
51
|
+
protected getContentInternal(contentKey: string): Content | undefined;
|
|
52
|
+
protected setContent(contentKey: string, content: Content): void;
|
|
53
|
+
protected deleteContent(contentKey: string): void;
|
|
54
|
+
constructor(data: JunctionSchema<ASide, BSide> & Partial<JunctionEntries<Content>>, config?: JunctionAdvancedConfiguration<Content>);
|
|
55
|
+
toJSON(): JunctionJSON<ASide, BSide, Content>;
|
|
56
|
+
set(a: string, ...rest: Content extends null ? [b: string] : [b: string, content: Content]): this;
|
|
57
|
+
set(relation: {
|
|
58
|
+
[Key in ASide | BSide]: string;
|
|
59
|
+
}, ...rest: Content extends null ? [] | [b?: undefined] : [content: Content]): this;
|
|
60
|
+
delete(a: string, b?: string): this;
|
|
61
|
+
delete(relation: Record<ASide | BSide, string> | Record<ASide, string> | Record<BSide, string>, b?: undefined): this;
|
|
62
|
+
getRelatedKey(key: string): string | undefined;
|
|
63
|
+
getContent(a: string, b: string): Content | undefined;
|
|
64
|
+
getRelationEntries(input: Record<ASide, string> | Record<BSide, string>): [string, Content][];
|
|
65
|
+
has(a: string, b?: string): boolean;
|
|
156
66
|
}
|
|
157
67
|
|
|
158
|
-
type Atom<T> = {
|
|
159
|
-
key: string;
|
|
160
|
-
type: `atom`;
|
|
161
|
-
family?: FamilyMetadata;
|
|
162
|
-
subject: Subject<{
|
|
163
|
-
newValue: T;
|
|
164
|
-
oldValue: T;
|
|
165
|
-
}>;
|
|
166
|
-
default: T;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
68
|
type OperationProgress = {
|
|
170
69
|
open: false;
|
|
171
70
|
} | {
|
|
@@ -176,6 +75,14 @@ type OperationProgress = {
|
|
|
176
75
|
token: StateToken<any>;
|
|
177
76
|
};
|
|
178
77
|
|
|
78
|
+
type Subscriber<T> = (value: T) => void;
|
|
79
|
+
declare class Subject<T> {
|
|
80
|
+
subscribers: Map<string, Subscriber<T>>;
|
|
81
|
+
subscribe(key: string, subscriber: Subscriber<T>): () => void;
|
|
82
|
+
private unsubscribe;
|
|
83
|
+
next(value: T): void;
|
|
84
|
+
}
|
|
85
|
+
|
|
179
86
|
type Selector<T> = {
|
|
180
87
|
key: string;
|
|
181
88
|
type: `selector`;
|
|
@@ -200,20 +107,11 @@ type ReadonlySelector<T> = {
|
|
|
200
107
|
get: () => T;
|
|
201
108
|
};
|
|
202
109
|
|
|
203
|
-
type Subscriber<T> = (value: T) => void;
|
|
204
|
-
declare class Subject<T> {
|
|
205
|
-
subscribers: Subscriber<T>[];
|
|
206
|
-
subscribe(subscriber: Subscriber<T>): {
|
|
207
|
-
unsubscribe: () => void;
|
|
208
|
-
};
|
|
209
|
-
private unsubscribe;
|
|
210
|
-
next(value: T): void;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
110
|
type TimelineAtomUpdate = StateUpdate<unknown> & {
|
|
214
111
|
key: string;
|
|
215
112
|
type: `atom_update`;
|
|
216
113
|
timestamp: number;
|
|
114
|
+
family?: FamilyMetadata;
|
|
217
115
|
};
|
|
218
116
|
type TimelineSelectorUpdate = {
|
|
219
117
|
key: string;
|
|
@@ -227,9 +125,10 @@ type TimelineTransactionUpdate = TransactionUpdate<ƒn> & {
|
|
|
227
125
|
timestamp: number;
|
|
228
126
|
};
|
|
229
127
|
type Timeline = {
|
|
128
|
+
type: `timeline`;
|
|
230
129
|
key: string;
|
|
231
130
|
at: number;
|
|
232
|
-
timeTraveling:
|
|
131
|
+
timeTraveling: `into_future` | `into_past` | null;
|
|
233
132
|
history: TimelineUpdate[];
|
|
234
133
|
selectorTime: number | null;
|
|
235
134
|
transactionKey: string | null;
|
|
@@ -255,19 +154,65 @@ type TransactionIdle = {
|
|
|
255
154
|
};
|
|
256
155
|
type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
|
|
257
156
|
|
|
157
|
+
type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `transactions` | `valueMap`>;
|
|
158
|
+
declare class Store {
|
|
159
|
+
valueMap: Map<string, any>;
|
|
160
|
+
atoms: Map<string, Atom<any>>;
|
|
161
|
+
selectors: Map<string, Selector<any>>;
|
|
162
|
+
readonlySelectors: Map<string, ReadonlySelector<any>>;
|
|
163
|
+
timelines: Map<string, Timeline>;
|
|
164
|
+
transactions: Map<string, Transaction<ƒn>>;
|
|
165
|
+
atomsThatAreDefault: Set<string>;
|
|
166
|
+
timelineAtoms: Junction<"timelineKey", "atomKey", null>;
|
|
167
|
+
selectorAtoms: Junction<"selectorKey", "atomKey", null>;
|
|
168
|
+
selectorGraph: Junction<"upstreamSelectorKey", "downstreamSelectorKey", {
|
|
169
|
+
source: string;
|
|
170
|
+
}>;
|
|
171
|
+
subject: {
|
|
172
|
+
atomCreation: Subject<AtomToken<unknown>>;
|
|
173
|
+
selectorCreation: Subject<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
174
|
+
transactionCreation: Subject<TransactionToken<ƒn>>;
|
|
175
|
+
timelineCreation: Subject<TimelineToken>;
|
|
176
|
+
operationStatus: Subject<OperationProgress>;
|
|
177
|
+
};
|
|
178
|
+
operation: OperationProgress;
|
|
179
|
+
transactionStatus: TransactionStatus<ƒn>;
|
|
180
|
+
config: {
|
|
181
|
+
name: string;
|
|
182
|
+
logger: Logger | null;
|
|
183
|
+
logger__INTERNAL: Logger;
|
|
184
|
+
};
|
|
185
|
+
constructor(name: string, store?: Store | null);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
type Atom<T> = {
|
|
189
|
+
key: string;
|
|
190
|
+
type: `atom`;
|
|
191
|
+
family?: FamilyMetadata;
|
|
192
|
+
subject: Subject<{
|
|
193
|
+
newValue: T;
|
|
194
|
+
oldValue: T;
|
|
195
|
+
}>;
|
|
196
|
+
default: T;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>;
|
|
200
|
+
|
|
201
|
+
type SelectorTokenIndex = StateTokenIndex<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
|
|
202
|
+
|
|
258
203
|
declare const attachIntrospectionStates: (store?: __INTERNAL__.Store) => {
|
|
259
|
-
atomIndex: ReadonlySelectorToken
|
|
260
|
-
selectorIndex: ReadonlySelectorToken
|
|
261
|
-
transactionIndex: ReadonlySelectorToken
|
|
262
|
-
findTransactionLogState: ReadonlySelectorFamily<TransactionUpdate
|
|
263
|
-
timelineIndex: ReadonlySelectorToken
|
|
204
|
+
atomIndex: ReadonlySelectorToken<AtomTokenIndex>;
|
|
205
|
+
selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>;
|
|
206
|
+
transactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>;
|
|
207
|
+
findTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>;
|
|
208
|
+
timelineIndex: ReadonlySelectorToken<TimelineToken[]>;
|
|
264
209
|
findTimelineState: ReadonlySelectorFamily<Timeline>;
|
|
265
210
|
};
|
|
266
211
|
|
|
267
|
-
type FamilyNode<Token extends AtomToken
|
|
212
|
+
type FamilyNode<Token extends AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>> = {
|
|
268
213
|
key: string;
|
|
269
214
|
familyMembers: Record<string, Token>;
|
|
270
215
|
};
|
|
271
|
-
type StateTokenIndex<Token extends AtomToken
|
|
216
|
+
type StateTokenIndex<Token extends AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>> = Record<string, FamilyNode<Token> | Token>;
|
|
272
217
|
|
|
273
218
|
export { FamilyNode, StateTokenIndex, attachIntrospectionStates };
|