atom.io 0.14.4 → 0.14.6
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/data/dist/index.cjs +47 -1416
- package/data/dist/index.cjs.map +1 -1
- package/data/dist/index.d.cts +16 -317
- package/data/dist/index.d.ts +16 -317
- package/data/dist/index.js +4 -6
- package/data/dist/index.js.map +1 -1
- package/dist/chunk-NYTGCPHB.js +261 -0
- package/dist/chunk-NYTGCPHB.js.map +1 -0
- package/dist/chunk-PZLG2HP3.js +36 -0
- package/dist/chunk-PZLG2HP3.js.map +1 -0
- package/dist/chunk-XACXFU3B.js +46 -0
- package/dist/chunk-XACXFU3B.js.map +1 -0
- package/dist/index.cjs +55 -2330
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -269
- package/dist/index.d.ts +21 -269
- package/dist/index.js +152 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/internal/dist/index.cjs +30 -159
- package/internal/dist/index.cjs.map +1 -1
- package/internal/dist/index.d.cts +28 -229
- package/internal/dist/index.d.ts +28 -229
- package/internal/dist/index.js +2027 -1
- package/internal/dist/index.js.map +1 -1
- package/introspection/dist/index.cjs +45 -1565
- package/introspection/dist/index.cjs.map +1 -1
- package/introspection/dist/index.d.cts +4 -376
- package/introspection/dist/index.d.ts +4 -376
- package/introspection/dist/index.js +298 -2
- package/introspection/dist/index.js.map +1 -1
- package/json/dist/index.cjs +5 -1502
- package/json/dist/index.cjs.map +1 -1
- package/json/dist/index.d.cts +7 -373
- package/json/dist/index.d.ts +7 -373
- package/json/dist/index.js +37 -1
- package/json/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/react/dist/index.cjs +14 -1549
- package/react/dist/index.cjs.map +1 -1
- package/react/dist/index.d.cts +4 -377
- package/react/dist/index.d.ts +4 -377
- package/react/dist/index.js +62 -2
- package/react/dist/index.js.map +1 -1
- package/react-devtools/dist/index.cjs +135 -2153
- package/react-devtools/dist/index.cjs.map +1 -1
- package/react-devtools/dist/index.d.cts +24 -149
- package/react-devtools/dist/index.d.ts +24 -149
- package/react-devtools/dist/index.js +5 -3
- package/react-devtools/dist/index.js.map +1 -1
- package/realtime-client/dist/index.cjs +34 -1529
- package/realtime-client/dist/index.cjs.map +1 -1
- package/realtime-client/dist/index.d.cts +12 -384
- package/realtime-client/dist/index.d.ts +12 -384
- package/realtime-client/dist/index.js +165 -2
- package/realtime-client/dist/index.js.map +1 -1
- package/realtime-react/dist/index.cjs +35 -1727
- package/realtime-react/dist/index.cjs.map +1 -1
- package/realtime-react/dist/index.d.cts +9 -49
- package/realtime-react/dist/index.d.ts +9 -49
- package/realtime-react/dist/index.js +66 -4
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-server/dist/index.cjs +57 -1548
- package/realtime-server/dist/index.cjs.map +1 -1
- package/realtime-server/dist/index.d.cts +11 -394
- package/realtime-server/dist/index.d.ts +11 -394
- package/realtime-server/dist/index.js +21 -27
- package/realtime-server/dist/index.js.map +1 -1
- package/realtime-testing/dist/index.cjs +15 -2376
- package/realtime-testing/dist/index.cjs.map +1 -1
- package/realtime-testing/dist/index.d.cts +3 -489
- package/realtime-testing/dist/index.d.ts +3 -489
- package/realtime-testing/dist/index.js +10 -9
- package/realtime-testing/dist/index.js.map +1 -1
- package/transceivers/set-rtx/dist/index.cjs +9 -31
- package/transceivers/set-rtx/dist/index.cjs.map +1 -1
- package/transceivers/set-rtx/dist/index.d.cts +3 -29
- package/transceivers/set-rtx/dist/index.d.ts +3 -29
- package/transceivers/set-rtx/dist/index.js +3 -2
- package/transceivers/set-rtx/dist/index.js.map +1 -1
- package/dist/chunk-GMN5KH6A.js +0 -309
- package/dist/chunk-GMN5KH6A.js.map +0 -1
- package/dist/chunk-HQWWV67P.js +0 -62
- package/dist/chunk-HQWWV67P.js.map +0 -1
- package/dist/chunk-MK4OJD24.js +0 -67
- package/dist/chunk-MK4OJD24.js.map +0 -1
- package/dist/chunk-N7ADBQJG.js +0 -176
- package/dist/chunk-N7ADBQJG.js.map +0 -1
- package/dist/chunk-PURABO5G.js +0 -2581
- package/dist/chunk-PURABO5G.js.map +0 -1
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as atom_io from 'atom.io';
|
|
2
|
+
import { FamilyMetadata, ƒn, TransactionUpdate, MutableAtomToken, AtomToken, StateToken, TimelineUpdate, StateUpdate, AtomFamily, ReadonlySelectorFamily, SelectorFamily, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, AtomIOLogger, Logger } from 'atom.io';
|
|
3
|
+
import { Json } from 'atom.io/json';
|
|
4
|
+
|
|
1
5
|
type ClassSignature = abstract new (...args: any) => any;
|
|
2
6
|
|
|
3
7
|
type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
|
|
@@ -20,142 +24,6 @@ interface Refinement$1<A, B extends A> {
|
|
|
20
24
|
|
|
21
25
|
type PlainObject = Record<keyof any, unknown>;
|
|
22
26
|
|
|
23
|
-
type primitive = boolean | number | string | null;
|
|
24
|
-
|
|
25
|
-
type Serializable = primitive | Readonly<{
|
|
26
|
-
[key: string]: Serializable;
|
|
27
|
-
}> | ReadonlyArray<Serializable>;
|
|
28
|
-
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
29
|
-
|
|
30
|
-
type AtomFamily<T, K extends Serializable = Serializable> = ((key: K) => AtomToken<T>) & {
|
|
31
|
-
key: string;
|
|
32
|
-
type: `atom_family`;
|
|
33
|
-
subject: Subject<AtomToken<T>>;
|
|
34
|
-
mutable?: boolean;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
declare const LoggerIconDictionary: {
|
|
38
|
-
readonly "\u231B": "Timeline event fully captured";
|
|
39
|
-
readonly "\u23E9": "Timeline redo";
|
|
40
|
-
readonly "\u23EA": "Timeline undo";
|
|
41
|
-
readonly "\u23ED\uFE0F": "Transaction redo";
|
|
42
|
-
readonly "\u23EE\uFE0F": "Transaction undo";
|
|
43
|
-
readonly "\u23F3": "Timeline event partially captured";
|
|
44
|
-
readonly "\u23F9\uFE0F": "Time-travel complete";
|
|
45
|
-
readonly "\uD83D\uDC81": "Notice";
|
|
46
|
-
readonly "\uD83D\uDD04": "Realtime transaction synchronized";
|
|
47
|
-
readonly "\u2705": "Realtime transaction success";
|
|
48
|
-
readonly "\u2728": "Computation complete";
|
|
49
|
-
readonly "\u274C": "Conflict prevents attempted action";
|
|
50
|
-
readonly "\u2B55": "Operation start";
|
|
51
|
-
readonly "\uD83D\uDC1E": "Possible bug in AtomIO";
|
|
52
|
-
readonly "\uD83D\uDC40": "Subscription added";
|
|
53
|
-
readonly "\uD83D\uDC6A": "Family member added";
|
|
54
|
-
readonly "\uD83D\uDCC1": "Stow update";
|
|
55
|
-
readonly "\uD83D\uDCC3": "Copy mutable";
|
|
56
|
-
readonly "\uD83D\uDCD6": "Read state";
|
|
57
|
-
readonly "\uD83D\uDCDD": "Write state";
|
|
58
|
-
readonly "\uD83D\uDCE2": "Notify subscribers";
|
|
59
|
-
readonly "\uD83D\uDD0C": "Register dependency";
|
|
60
|
-
readonly "\uD83D\uDD0D": "Discover root";
|
|
61
|
-
readonly "\uD83D\uDD25": "Delete state";
|
|
62
|
-
readonly "\uD83D\uDD27": "Create mutable atom";
|
|
63
|
-
readonly "\uD83D\uDD28": "Create immutable atom";
|
|
64
|
-
readonly "\uD83D\uDD34": "Operation complete";
|
|
65
|
-
readonly "\uD83D\uDDD1": "Evict cached value";
|
|
66
|
-
readonly "\uD83D\uDCA5": "Caught";
|
|
67
|
-
readonly "\uD83D\uDE48": "Subscription canceled";
|
|
68
|
-
readonly "\uD83D\uDEC4": "Apply transaction";
|
|
69
|
-
readonly "\uD83D\uDEE0\uFE0F": "Install atom into store";
|
|
70
|
-
readonly "\uD83D\uDEEB": "Begin transaction";
|
|
71
|
-
readonly "\uD83D\uDEEC": "Complete transaction";
|
|
72
|
-
readonly "\uD83E\uDDEE": "Computing selector";
|
|
73
|
-
readonly "\uD83E\uDDF9": "Prepare to evict";
|
|
74
|
-
readonly "\uD83E\uDE82": "Abort transaction";
|
|
75
|
-
};
|
|
76
|
-
type LoggerIcon = keyof typeof LoggerIconDictionary;
|
|
77
|
-
declare const LOG_LEVELS: readonly ["info", "warn", "error"];
|
|
78
|
-
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
79
|
-
type LogFn = (icon: LoggerIcon, tokenType: `atom` | `readonly_selector` | `selector` | `state` | `timeline` | `transaction` | `unknown`, tokenKey: string, message: string, ...rest: unknown[]) => void;
|
|
80
|
-
type LogFilter = (...params: Parameters<LogFn>) => boolean;
|
|
81
|
-
type Logger = Record<LogLevel, LogFn>;
|
|
82
|
-
declare class AtomIOLogger implements Logger {
|
|
83
|
-
logLevel: `error` | `info` | `warn` | null;
|
|
84
|
-
private readonly filter?;
|
|
85
|
-
private readonly logger;
|
|
86
|
-
constructor(logLevel: `error` | `info` | `warn` | null, filter?: LogFilter | undefined, logger?: Logger);
|
|
87
|
-
error: LogFn;
|
|
88
|
-
info: LogFn;
|
|
89
|
-
warn: LogFn;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
type TransactionToken<_> = {
|
|
93
|
-
key: string;
|
|
94
|
-
type: `transaction`;
|
|
95
|
-
__brand?: _;
|
|
96
|
-
};
|
|
97
|
-
type TransactionUpdate<ƒ extends ƒn> = {
|
|
98
|
-
key: string;
|
|
99
|
-
updates: (KeyedStateUpdate<unknown> | TransactionUpdate<ƒn>)[];
|
|
100
|
-
params: Parameters<ƒ>;
|
|
101
|
-
output: ReturnType<ƒ>;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
type SelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => SelectorToken<T>) & {
|
|
105
|
-
key: string;
|
|
106
|
-
type: `selector_family`;
|
|
107
|
-
subject: Subject<SelectorToken<T>>;
|
|
108
|
-
};
|
|
109
|
-
type ReadonlySelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => ReadonlySelectorToken<T>) & {
|
|
110
|
-
key: string;
|
|
111
|
-
type: `readonly_selector_family`;
|
|
112
|
-
subject: Subject<ReadonlySelectorToken<T>>;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
type StateUpdate<T> = {
|
|
116
|
-
newValue: T;
|
|
117
|
-
oldValue: T;
|
|
118
|
-
};
|
|
119
|
-
type KeyedStateUpdate<T> = StateUpdate<T> & {
|
|
120
|
-
key: string;
|
|
121
|
-
family?: FamilyMetadata;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
type TimelineToken = {
|
|
125
|
-
key: string;
|
|
126
|
-
type: `timeline`;
|
|
127
|
-
};
|
|
128
|
-
type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
|
|
129
|
-
|
|
130
|
-
type ƒn = (...parameters: any[]) => any;
|
|
131
|
-
type AtomToken<_> = {
|
|
132
|
-
key: string;
|
|
133
|
-
type: `atom`;
|
|
134
|
-
family?: FamilyMetadata;
|
|
135
|
-
__brand?: _;
|
|
136
|
-
};
|
|
137
|
-
interface MutableAtomToken<T extends Transceiver<any>, J extends Serializable> extends AtomToken<T> {
|
|
138
|
-
__asJSON?: J;
|
|
139
|
-
__update?: T extends Transceiver<infer Update> ? Update : never;
|
|
140
|
-
}
|
|
141
|
-
type SelectorToken<_> = {
|
|
142
|
-
key: string;
|
|
143
|
-
type: `selector`;
|
|
144
|
-
family?: FamilyMetadata;
|
|
145
|
-
__brand?: _;
|
|
146
|
-
};
|
|
147
|
-
type StateToken<T> = AtomToken<T> | SelectorToken<T>;
|
|
148
|
-
type ReadonlySelectorToken<_> = {
|
|
149
|
-
key: string;
|
|
150
|
-
type: `readonly_selector`;
|
|
151
|
-
family?: FamilyMetadata;
|
|
152
|
-
__brand?: _;
|
|
153
|
-
};
|
|
154
|
-
type FamilyMetadata = {
|
|
155
|
-
key: string;
|
|
156
|
-
subKey: string;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
27
|
declare class Subject<T> {
|
|
160
28
|
Subscriber: (value: T) => void;
|
|
161
29
|
subscribers: Map<string, this[`Subscriber`]>;
|
|
@@ -207,6 +75,13 @@ type TransactionMeta<ƒ extends ƒn> = {
|
|
|
207
75
|
update: TransactionUpdate<ƒ>;
|
|
208
76
|
};
|
|
209
77
|
|
|
78
|
+
type primitive = boolean | number | string | null;
|
|
79
|
+
|
|
80
|
+
type Serializable = primitive | Readonly<{
|
|
81
|
+
[key: string]: Serializable;
|
|
82
|
+
}> | ReadonlyArray<Serializable>;
|
|
83
|
+
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
84
|
+
|
|
210
85
|
type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
|
|
211
86
|
type Cardinality = `1:1` | `1:n` | `n:n`;
|
|
212
87
|
|
|
@@ -279,7 +154,7 @@ interface Lineage {
|
|
|
279
154
|
child: typeof this | null;
|
|
280
155
|
}
|
|
281
156
|
|
|
282
|
-
interface Transceiver<Signal extends Serializable> {
|
|
157
|
+
interface Transceiver<Signal extends Json.Serializable> {
|
|
283
158
|
do: (update: Signal) => void;
|
|
284
159
|
undo: (update: Signal) => void;
|
|
285
160
|
subscribe: (key: string, fn: (update: Signal) => void) => () => void;
|
|
@@ -298,9 +173,9 @@ declare class Tracker<Mutable extends Transceiver<any>> {
|
|
|
298
173
|
private unsubscribeFromInnerValue;
|
|
299
174
|
private observeCore;
|
|
300
175
|
private updateCore;
|
|
301
|
-
mutableState: MutableAtomToken<Mutable, Serializable>;
|
|
176
|
+
mutableState: MutableAtomToken<Mutable, Json.Serializable>;
|
|
302
177
|
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
303
|
-
constructor(mutableState: MutableAtomToken<Mutable, Serializable>, store: Store);
|
|
178
|
+
constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store: Store);
|
|
304
179
|
}
|
|
305
180
|
|
|
306
181
|
interface MutableAtom<T> extends Atom<T> {
|
|
@@ -433,17 +308,17 @@ declare class Differ<Leaf extends Record<string, any>, Tree extends Record<strin
|
|
|
433
308
|
|
|
434
309
|
declare const AtomIODevtools: () => JSX.Element;
|
|
435
310
|
|
|
436
|
-
declare const atomIndex: ReadonlySelectorToken<AtomTokenIndex>;
|
|
437
|
-
declare const selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>;
|
|
438
|
-
declare const transactionIndex: ReadonlySelectorToken<TransactionToken
|
|
439
|
-
declare const findTransactionLogState: ReadonlySelectorFamily<TransactionUpdate
|
|
440
|
-
declare const timelineIndex: ReadonlySelectorToken<TimelineToken[]>;
|
|
441
|
-
declare const findTimelineState: ReadonlySelectorFamily<Timeline>;
|
|
442
|
-
declare const devtoolsAreOpenState: AtomToken<boolean>;
|
|
311
|
+
declare const atomIndex: atom_io.ReadonlySelectorToken<AtomTokenIndex>;
|
|
312
|
+
declare const selectorIndex: atom_io.ReadonlySelectorToken<SelectorTokenIndex>;
|
|
313
|
+
declare const transactionIndex: atom_io.ReadonlySelectorToken<atom_io.TransactionToken<atom_io.ƒn>[]>;
|
|
314
|
+
declare const findTransactionLogState: atom_io.ReadonlySelectorFamily<atom_io.TransactionUpdate<atom_io.ƒn>[]>;
|
|
315
|
+
declare const timelineIndex: atom_io.ReadonlySelectorToken<atom_io.TimelineToken[]>;
|
|
316
|
+
declare const findTimelineState: atom_io.ReadonlySelectorFamily<Timeline>;
|
|
317
|
+
declare const devtoolsAreOpenState: atom_io.AtomToken<boolean>;
|
|
443
318
|
type DevtoolsView = `atoms` | `selectors` | `timelines` | `transactions`;
|
|
444
|
-
declare const devtoolsViewSelectionState: AtomToken<DevtoolsView>;
|
|
445
|
-
declare const devtoolsViewOptionsState: AtomToken<DevtoolsView[]>;
|
|
446
|
-
declare const findViewIsOpenState: AtomFamily<boolean, string>;
|
|
319
|
+
declare const devtoolsViewSelectionState: atom_io.AtomToken<DevtoolsView>;
|
|
320
|
+
declare const devtoolsViewOptionsState: atom_io.AtomToken<DevtoolsView[]>;
|
|
321
|
+
declare const findViewIsOpenState: atom_io.AtomFamily<boolean, string>;
|
|
447
322
|
declare const primitiveRefinery: Refinery<{
|
|
448
323
|
number: (input: unknown) => input is number;
|
|
449
324
|
string: (input: unknown) => input is string;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as atom_io from 'atom.io';
|
|
2
|
+
import { FamilyMetadata, ƒn, TransactionUpdate, MutableAtomToken, AtomToken, StateToken, TimelineUpdate, StateUpdate, AtomFamily, ReadonlySelectorFamily, SelectorFamily, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, AtomIOLogger, Logger } from 'atom.io';
|
|
3
|
+
import { Json } from 'atom.io/json';
|
|
4
|
+
|
|
1
5
|
type ClassSignature = abstract new (...args: any) => any;
|
|
2
6
|
|
|
3
7
|
type RefinementStrategy = ClassSignature | Refinement$1<unknown, any>;
|
|
@@ -20,142 +24,6 @@ interface Refinement$1<A, B extends A> {
|
|
|
20
24
|
|
|
21
25
|
type PlainObject = Record<keyof any, unknown>;
|
|
22
26
|
|
|
23
|
-
type primitive = boolean | number | string | null;
|
|
24
|
-
|
|
25
|
-
type Serializable = primitive | Readonly<{
|
|
26
|
-
[key: string]: Serializable;
|
|
27
|
-
}> | ReadonlyArray<Serializable>;
|
|
28
|
-
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
29
|
-
|
|
30
|
-
type AtomFamily<T, K extends Serializable = Serializable> = ((key: K) => AtomToken<T>) & {
|
|
31
|
-
key: string;
|
|
32
|
-
type: `atom_family`;
|
|
33
|
-
subject: Subject<AtomToken<T>>;
|
|
34
|
-
mutable?: boolean;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
declare const LoggerIconDictionary: {
|
|
38
|
-
readonly "\u231B": "Timeline event fully captured";
|
|
39
|
-
readonly "\u23E9": "Timeline redo";
|
|
40
|
-
readonly "\u23EA": "Timeline undo";
|
|
41
|
-
readonly "\u23ED\uFE0F": "Transaction redo";
|
|
42
|
-
readonly "\u23EE\uFE0F": "Transaction undo";
|
|
43
|
-
readonly "\u23F3": "Timeline event partially captured";
|
|
44
|
-
readonly "\u23F9\uFE0F": "Time-travel complete";
|
|
45
|
-
readonly "\uD83D\uDC81": "Notice";
|
|
46
|
-
readonly "\uD83D\uDD04": "Realtime transaction synchronized";
|
|
47
|
-
readonly "\u2705": "Realtime transaction success";
|
|
48
|
-
readonly "\u2728": "Computation complete";
|
|
49
|
-
readonly "\u274C": "Conflict prevents attempted action";
|
|
50
|
-
readonly "\u2B55": "Operation start";
|
|
51
|
-
readonly "\uD83D\uDC1E": "Possible bug in AtomIO";
|
|
52
|
-
readonly "\uD83D\uDC40": "Subscription added";
|
|
53
|
-
readonly "\uD83D\uDC6A": "Family member added";
|
|
54
|
-
readonly "\uD83D\uDCC1": "Stow update";
|
|
55
|
-
readonly "\uD83D\uDCC3": "Copy mutable";
|
|
56
|
-
readonly "\uD83D\uDCD6": "Read state";
|
|
57
|
-
readonly "\uD83D\uDCDD": "Write state";
|
|
58
|
-
readonly "\uD83D\uDCE2": "Notify subscribers";
|
|
59
|
-
readonly "\uD83D\uDD0C": "Register dependency";
|
|
60
|
-
readonly "\uD83D\uDD0D": "Discover root";
|
|
61
|
-
readonly "\uD83D\uDD25": "Delete state";
|
|
62
|
-
readonly "\uD83D\uDD27": "Create mutable atom";
|
|
63
|
-
readonly "\uD83D\uDD28": "Create immutable atom";
|
|
64
|
-
readonly "\uD83D\uDD34": "Operation complete";
|
|
65
|
-
readonly "\uD83D\uDDD1": "Evict cached value";
|
|
66
|
-
readonly "\uD83D\uDCA5": "Caught";
|
|
67
|
-
readonly "\uD83D\uDE48": "Subscription canceled";
|
|
68
|
-
readonly "\uD83D\uDEC4": "Apply transaction";
|
|
69
|
-
readonly "\uD83D\uDEE0\uFE0F": "Install atom into store";
|
|
70
|
-
readonly "\uD83D\uDEEB": "Begin transaction";
|
|
71
|
-
readonly "\uD83D\uDEEC": "Complete transaction";
|
|
72
|
-
readonly "\uD83E\uDDEE": "Computing selector";
|
|
73
|
-
readonly "\uD83E\uDDF9": "Prepare to evict";
|
|
74
|
-
readonly "\uD83E\uDE82": "Abort transaction";
|
|
75
|
-
};
|
|
76
|
-
type LoggerIcon = keyof typeof LoggerIconDictionary;
|
|
77
|
-
declare const LOG_LEVELS: readonly ["info", "warn", "error"];
|
|
78
|
-
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
79
|
-
type LogFn = (icon: LoggerIcon, tokenType: `atom` | `readonly_selector` | `selector` | `state` | `timeline` | `transaction` | `unknown`, tokenKey: string, message: string, ...rest: unknown[]) => void;
|
|
80
|
-
type LogFilter = (...params: Parameters<LogFn>) => boolean;
|
|
81
|
-
type Logger = Record<LogLevel, LogFn>;
|
|
82
|
-
declare class AtomIOLogger implements Logger {
|
|
83
|
-
logLevel: `error` | `info` | `warn` | null;
|
|
84
|
-
private readonly filter?;
|
|
85
|
-
private readonly logger;
|
|
86
|
-
constructor(logLevel: `error` | `info` | `warn` | null, filter?: LogFilter | undefined, logger?: Logger);
|
|
87
|
-
error: LogFn;
|
|
88
|
-
info: LogFn;
|
|
89
|
-
warn: LogFn;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
type TransactionToken<_> = {
|
|
93
|
-
key: string;
|
|
94
|
-
type: `transaction`;
|
|
95
|
-
__brand?: _;
|
|
96
|
-
};
|
|
97
|
-
type TransactionUpdate<ƒ extends ƒn> = {
|
|
98
|
-
key: string;
|
|
99
|
-
updates: (KeyedStateUpdate<unknown> | TransactionUpdate<ƒn>)[];
|
|
100
|
-
params: Parameters<ƒ>;
|
|
101
|
-
output: ReturnType<ƒ>;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
type SelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => SelectorToken<T>) & {
|
|
105
|
-
key: string;
|
|
106
|
-
type: `selector_family`;
|
|
107
|
-
subject: Subject<SelectorToken<T>>;
|
|
108
|
-
};
|
|
109
|
-
type ReadonlySelectorFamily<T, K extends Serializable = Serializable> = ((key: K) => ReadonlySelectorToken<T>) & {
|
|
110
|
-
key: string;
|
|
111
|
-
type: `readonly_selector_family`;
|
|
112
|
-
subject: Subject<ReadonlySelectorToken<T>>;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
type StateUpdate<T> = {
|
|
116
|
-
newValue: T;
|
|
117
|
-
oldValue: T;
|
|
118
|
-
};
|
|
119
|
-
type KeyedStateUpdate<T> = StateUpdate<T> & {
|
|
120
|
-
key: string;
|
|
121
|
-
family?: FamilyMetadata;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
type TimelineToken = {
|
|
125
|
-
key: string;
|
|
126
|
-
type: `timeline`;
|
|
127
|
-
};
|
|
128
|
-
type TimelineUpdate = TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate;
|
|
129
|
-
|
|
130
|
-
type ƒn = (...parameters: any[]) => any;
|
|
131
|
-
type AtomToken<_> = {
|
|
132
|
-
key: string;
|
|
133
|
-
type: `atom`;
|
|
134
|
-
family?: FamilyMetadata;
|
|
135
|
-
__brand?: _;
|
|
136
|
-
};
|
|
137
|
-
interface MutableAtomToken<T extends Transceiver<any>, J extends Serializable> extends AtomToken<T> {
|
|
138
|
-
__asJSON?: J;
|
|
139
|
-
__update?: T extends Transceiver<infer Update> ? Update : never;
|
|
140
|
-
}
|
|
141
|
-
type SelectorToken<_> = {
|
|
142
|
-
key: string;
|
|
143
|
-
type: `selector`;
|
|
144
|
-
family?: FamilyMetadata;
|
|
145
|
-
__brand?: _;
|
|
146
|
-
};
|
|
147
|
-
type StateToken<T> = AtomToken<T> | SelectorToken<T>;
|
|
148
|
-
type ReadonlySelectorToken<_> = {
|
|
149
|
-
key: string;
|
|
150
|
-
type: `readonly_selector`;
|
|
151
|
-
family?: FamilyMetadata;
|
|
152
|
-
__brand?: _;
|
|
153
|
-
};
|
|
154
|
-
type FamilyMetadata = {
|
|
155
|
-
key: string;
|
|
156
|
-
subKey: string;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
27
|
declare class Subject<T> {
|
|
160
28
|
Subscriber: (value: T) => void;
|
|
161
29
|
subscribers: Map<string, this[`Subscriber`]>;
|
|
@@ -207,6 +75,13 @@ type TransactionMeta<ƒ extends ƒn> = {
|
|
|
207
75
|
update: TransactionUpdate<ƒ>;
|
|
208
76
|
};
|
|
209
77
|
|
|
78
|
+
type primitive = boolean | number | string | null;
|
|
79
|
+
|
|
80
|
+
type Serializable = primitive | Readonly<{
|
|
81
|
+
[key: string]: Serializable;
|
|
82
|
+
}> | ReadonlyArray<Serializable>;
|
|
83
|
+
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
84
|
+
|
|
210
85
|
type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
|
|
211
86
|
type Cardinality = `1:1` | `1:n` | `n:n`;
|
|
212
87
|
|
|
@@ -279,7 +154,7 @@ interface Lineage {
|
|
|
279
154
|
child: typeof this | null;
|
|
280
155
|
}
|
|
281
156
|
|
|
282
|
-
interface Transceiver<Signal extends Serializable> {
|
|
157
|
+
interface Transceiver<Signal extends Json.Serializable> {
|
|
283
158
|
do: (update: Signal) => void;
|
|
284
159
|
undo: (update: Signal) => void;
|
|
285
160
|
subscribe: (key: string, fn: (update: Signal) => void) => () => void;
|
|
@@ -298,9 +173,9 @@ declare class Tracker<Mutable extends Transceiver<any>> {
|
|
|
298
173
|
private unsubscribeFromInnerValue;
|
|
299
174
|
private observeCore;
|
|
300
175
|
private updateCore;
|
|
301
|
-
mutableState: MutableAtomToken<Mutable, Serializable>;
|
|
176
|
+
mutableState: MutableAtomToken<Mutable, Json.Serializable>;
|
|
302
177
|
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
303
|
-
constructor(mutableState: MutableAtomToken<Mutable, Serializable>, store: Store);
|
|
178
|
+
constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store: Store);
|
|
304
179
|
}
|
|
305
180
|
|
|
306
181
|
interface MutableAtom<T> extends Atom<T> {
|
|
@@ -433,17 +308,17 @@ declare class Differ<Leaf extends Record<string, any>, Tree extends Record<strin
|
|
|
433
308
|
|
|
434
309
|
declare const AtomIODevtools: () => JSX.Element;
|
|
435
310
|
|
|
436
|
-
declare const atomIndex: ReadonlySelectorToken<AtomTokenIndex>;
|
|
437
|
-
declare const selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>;
|
|
438
|
-
declare const transactionIndex: ReadonlySelectorToken<TransactionToken
|
|
439
|
-
declare const findTransactionLogState: ReadonlySelectorFamily<TransactionUpdate
|
|
440
|
-
declare const timelineIndex: ReadonlySelectorToken<TimelineToken[]>;
|
|
441
|
-
declare const findTimelineState: ReadonlySelectorFamily<Timeline>;
|
|
442
|
-
declare const devtoolsAreOpenState: AtomToken<boolean>;
|
|
311
|
+
declare const atomIndex: atom_io.ReadonlySelectorToken<AtomTokenIndex>;
|
|
312
|
+
declare const selectorIndex: atom_io.ReadonlySelectorToken<SelectorTokenIndex>;
|
|
313
|
+
declare const transactionIndex: atom_io.ReadonlySelectorToken<atom_io.TransactionToken<atom_io.ƒn>[]>;
|
|
314
|
+
declare const findTransactionLogState: atom_io.ReadonlySelectorFamily<atom_io.TransactionUpdate<atom_io.ƒn>[]>;
|
|
315
|
+
declare const timelineIndex: atom_io.ReadonlySelectorToken<atom_io.TimelineToken[]>;
|
|
316
|
+
declare const findTimelineState: atom_io.ReadonlySelectorFamily<Timeline>;
|
|
317
|
+
declare const devtoolsAreOpenState: atom_io.AtomToken<boolean>;
|
|
443
318
|
type DevtoolsView = `atoms` | `selectors` | `timelines` | `transactions`;
|
|
444
|
-
declare const devtoolsViewSelectionState: AtomToken<DevtoolsView>;
|
|
445
|
-
declare const devtoolsViewOptionsState: AtomToken<DevtoolsView[]>;
|
|
446
|
-
declare const findViewIsOpenState: AtomFamily<boolean, string>;
|
|
319
|
+
declare const devtoolsViewSelectionState: atom_io.AtomToken<DevtoolsView>;
|
|
320
|
+
declare const devtoolsViewOptionsState: atom_io.AtomToken<DevtoolsView[]>;
|
|
321
|
+
declare const findViewIsOpenState: atom_io.AtomFamily<boolean, string>;
|
|
447
322
|
declare const primitiveRefinery: Refinery<{
|
|
448
323
|
number: (input: unknown) => input is number;
|
|
449
324
|
string: (input: unknown) => input is string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { treeShake, isEmptyArray, pipe, ifDefined, isArray, isRecord, doesExtend, isModifier, sprawl, isPlainObject, raiseError, recordToEntries, fallback, hasExactProperties, isEmptyObject, doNothing, isOneOf, map, entriesToRecord, comprises, addTo, become, mapObject, delve } from '../../dist/chunk-NYCVSXQB.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { JSON_TYPE_NAMES, isString, isNumber, isBoolean, stringifyJson, JSON_DEFAULTS } from '../../dist/chunk-XACXFU3B.js';
|
|
3
|
+
import { __spreadProps, __spreadValues, __objRest, __restKey } from '../../dist/chunk-PZLG2HP3.js';
|
|
4
|
+
import { selectorFamily, atom, atomFamily, undo, redo, getState } from 'atom.io';
|
|
5
|
+
import { attachIntrospectionStates } from 'atom.io/introspection';
|
|
6
|
+
import { useI, useO } from 'atom.io/react';
|
|
5
7
|
import { motion, spring, LayoutGroup } from 'framer-motion';
|
|
6
8
|
import * as React from 'react';
|
|
7
9
|
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, Fragment as Fragment$1, Component, useId } from 'react';
|