atom.io 0.32.0 → 0.32.2
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.d.ts +8 -925
- package/data/dist/index.js +2 -2
- package/dist/{chunk-5F2V7S3B.js → chunk-HEEVASKG.js} +1 -1
- package/dist/{chunk-ECOMOMUN.js → chunk-KMBRCA5Q.js} +20 -19
- package/dist/{chunk-R3ZUK5EH.js → chunk-NDTM5IY3.js} +22 -11
- package/dist/{chunk-354XQWHH.js → chunk-QRPY4LSO.js} +5 -5
- package/dist/{chunk-GY2XQYZY.js → chunk-RXQWAO26.js} +50 -41
- package/dist/{chunk-Z2UJW4NQ.js → chunk-XN3EO2UT.js} +3 -3
- package/dist/{chunk-NF7FJKJD.js → chunk-YPME5OLO.js} +6 -4
- package/dist/index.d.ts +45 -516
- package/dist/index.js +1 -1
- package/eslint-plugin/dist/index.js +3 -3
- package/eslint-plugin/src/rules/explicit-state-types.ts +1 -0
- package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +1 -0
- package/eslint-plugin/src/walk.ts +1 -0
- package/internal/dist/index.d.ts +9 -657
- package/internal/dist/index.js +1 -1
- package/internal/src/join/join-internal.ts +1 -1
- package/internal/src/junction.ts +7 -4
- package/internal/src/lazy-map.ts +3 -1
- package/internal/src/set-state/emit-update.ts +3 -1
- package/internal/src/timeline/create-timeline.ts +2 -1
- package/internal/src/timeline/time-travel.ts +2 -1
- package/introspection/dist/index.d.ts +6 -922
- package/introspection/dist/index.js +2 -2
- package/introspection/src/auditor.ts +3 -3
- package/json/dist/index.d.ts +5 -899
- package/json/dist/index.js +1 -1
- package/package.json +10 -10
- package/react/dist/index.d.ts +3 -921
- package/react/dist/index.js +2 -2
- package/react-devtools/dist/index.d.ts +1 -26
- package/react-devtools/dist/index.js +28 -15
- package/react-devtools/src/Updates.tsx +12 -0
- package/react-devtools/src/json-editor/editors-by-type/utilities/cast-to-json.ts +2 -1
- package/realtime/dist/index.d.ts +8 -203
- package/realtime/dist/index.js +2 -2
- package/realtime/src/realtime-continuity.ts +5 -1
- package/realtime-client/dist/index.d.ts +21 -959
- package/realtime-client/dist/index.js +2 -2
- package/realtime-react/dist/index.d.ts +12 -166
- package/realtime-react/dist/index.js +4 -4
- package/realtime-server/dist/index.d.ts +27 -972
- package/realtime-server/dist/index.js +3 -3
- package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
- package/realtime-server/src/ipc-sockets/custom-socket.ts +6 -1
- package/realtime-server/src/realtime-server-stores/server-sync-store.ts +10 -2
- package/realtime-testing/dist/index.d.ts +3 -1091
- package/realtime-testing/dist/index.js +7 -7
- package/src/logger.ts +12 -4
- package/transceivers/set-rtx/dist/index.d.ts +6 -40
- package/transceivers/set-rtx/dist/index.js +1 -1
- package/transceivers/set-rtx/src/set-rtx.ts +4 -7
- package/web/dist/index.d.ts +1 -30
- package/react-devtools/src/json-editor/assets/Untitled-1.ai +2 -1436
- package/react-devtools/src/json-editor/assets/data-vis.ai +1 -1548
- package/react-devtools/src/json-editor/comp/json-editor-sketches.ai +5 -1449
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue, pullAtom, pullAtomFamilyMember, pullMutableAtom, pullMutableAtomFamilyMember, pullSelector, pullSelectorFamilyMember, pushState, serverAction, syncContinuity, useConcealState, useRegisterAndAttemptConfirmedUpdate, useRevealState } from '../../dist/chunk-
|
|
1
|
+
export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue, pullAtom, pullAtomFamilyMember, pullMutableAtom, pullMutableAtomFamilyMember, pullSelector, pullSelectorFamilyMember, pushState, serverAction, syncContinuity, useConcealState, useRegisterAndAttemptConfirmedUpdate, useRevealState } from '../../dist/chunk-XN3EO2UT.js';
|
|
2
2
|
import '../../dist/chunk-4LWKCEW3.js';
|
|
3
|
-
import '../../dist/chunk-
|
|
3
|
+
import '../../dist/chunk-RXQWAO26.js';
|
|
4
4
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Socket } from 'socket.io-client';
|
|
3
|
+
import * as AtomIO from 'atom.io';
|
|
4
|
+
import { Json, Canonical } from 'atom.io/json';
|
|
5
|
+
import { Transceiver, Func } from 'atom.io/internal';
|
|
6
|
+
import { ContinuityToken } from 'atom.io/realtime';
|
|
3
7
|
|
|
4
8
|
type RealtimeReactStore = {
|
|
5
9
|
socket: Socket | null;
|
|
@@ -14,179 +18,21 @@ declare const RealtimeProvider: React.FC<{
|
|
|
14
18
|
socket: Socket | null;
|
|
15
19
|
}>;
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
declare namespace Json {
|
|
19
|
-
namespace Tree {
|
|
20
|
-
type Array<Element = unknown> = ReadonlyArray<Element>;
|
|
21
|
-
type Object<K extends string = string, V = unknown> = Record<K, V>;
|
|
22
|
-
type Fork = Array | Object;
|
|
23
|
-
type Leaf = primitive;
|
|
24
|
-
type Node = Fork | Leaf;
|
|
25
|
-
}
|
|
26
|
-
type Serializable = primitive | Readonly<{
|
|
27
|
-
[key: string]: Serializable;
|
|
28
|
-
}> | ReadonlyArray<Serializable>;
|
|
29
|
-
type Object<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
30
|
-
type Array<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
31
|
-
}
|
|
32
|
-
type stringified<J extends Json.Serializable> = J extends string ? `"${J}"` : J extends number ? `${J}` : J extends true ? `true` : J extends false ? `false` : J extends boolean ? `false` | `true` : J extends null ? `null` : string & {
|
|
33
|
-
__json?: J;
|
|
34
|
-
};
|
|
35
|
-
type Canonical = primitive | ReadonlyArray<Canonical>;
|
|
36
|
-
|
|
37
|
-
type Func = (...parameters: any[]) => any;
|
|
21
|
+
declare function usePullAtom<J extends Json.Serializable>(token: AtomIO.RegularAtomToken<J>): J;
|
|
38
22
|
|
|
39
|
-
|
|
40
|
-
do: (update: S) => number | `OUT_OF_RANGE` | null;
|
|
41
|
-
undo: (update: S) => void;
|
|
42
|
-
subscribe: (key: string, fn: (update: S) => void) => () => void;
|
|
43
|
-
cacheUpdateNumber: number;
|
|
44
|
-
getUpdateNumber: (update: S) => number;
|
|
45
|
-
}
|
|
23
|
+
declare function usePullAtomFamilyMember<J extends Json.Serializable, K extends Canonical, Key extends K>(family: AtomIO.RegularAtomFamilyToken<J, K>, subKey: Key): J;
|
|
46
24
|
|
|
47
|
-
|
|
48
|
-
key: string;
|
|
49
|
-
type: `atom_family`;
|
|
50
|
-
__T?: T;
|
|
51
|
-
__K?: K;
|
|
52
|
-
};
|
|
53
|
-
type MutableAtomFamilyToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = {
|
|
54
|
-
key: string;
|
|
55
|
-
type: `mutable_atom_family`;
|
|
56
|
-
__T?: T;
|
|
57
|
-
__J?: J;
|
|
58
|
-
__K?: K;
|
|
59
|
-
};
|
|
60
|
-
type AtomFamilyToken<T, K extends Canonical = Canonical> = MutableAtomFamilyToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamilyToken<T, K>;
|
|
25
|
+
declare function usePullMutable<T extends Transceiver<any>, J extends Json.Serializable>(token: AtomIO.MutableAtomToken<T, J>): T;
|
|
61
26
|
|
|
62
|
-
|
|
63
|
-
key: string;
|
|
64
|
-
type: `transaction`;
|
|
65
|
-
__F?: F;
|
|
66
|
-
};
|
|
27
|
+
declare function usePullMutableAtomFamilyMember<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(familyToken: AtomIO.MutableAtomFamilyToken<T, J, K>, key: Key): T;
|
|
67
28
|
|
|
68
|
-
|
|
69
|
-
key: string;
|
|
70
|
-
type: `selector_family`;
|
|
71
|
-
__T?: T;
|
|
72
|
-
__K?: K;
|
|
73
|
-
};
|
|
74
|
-
type ReadonlySelectorFamilyToken<T, K extends Canonical> = {
|
|
75
|
-
key: string;
|
|
76
|
-
type: `readonly_selector_family`;
|
|
77
|
-
__T?: T;
|
|
78
|
-
__K?: K;
|
|
79
|
-
};
|
|
80
|
-
type SelectorFamilyToken<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
|
|
29
|
+
declare function usePullSelector<J extends Json.Serializable>(token: AtomIO.SelectorToken<J>): J;
|
|
81
30
|
|
|
82
|
-
|
|
31
|
+
declare function usePullSelectorFamilyMember<T, K extends Canonical, Key extends K>(familyToken: AtomIO.SelectorFamilyToken<T, K>, key: Key): T;
|
|
83
32
|
|
|
84
|
-
|
|
85
|
-
type RegularAtomToken<T, K extends Canonical = any> = {
|
|
86
|
-
/** The unique identifier of the atom. */
|
|
87
|
-
key: string;
|
|
88
|
-
/** Discriminator. */
|
|
89
|
-
type: `atom`;
|
|
90
|
-
/** Present if the atom belongs to a family. */
|
|
91
|
-
family?: FamilyMetadata<K>;
|
|
92
|
-
/** Never present. This is a marker that preserves the type of the atom's value. */
|
|
93
|
-
__T?: T;
|
|
94
|
-
};
|
|
95
|
-
/** @public */
|
|
96
|
-
type MutableAtomToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical = any> = {
|
|
97
|
-
/** The unique identifier of the atom. */
|
|
98
|
-
key: string;
|
|
99
|
-
/** Discriminator. */
|
|
100
|
-
type: `mutable_atom`;
|
|
101
|
-
/** Present if the atom belongs to a family. */
|
|
102
|
-
family?: FamilyMetadata<K>;
|
|
103
|
-
/** Never present. This is a marker that preserves the JSON form of the atom's transceiver value. */
|
|
104
|
-
__J?: J;
|
|
105
|
-
/** Never present. This is a marker that preserves the type of the atom's transceiver value. */
|
|
106
|
-
__U?: T extends Transceiver<infer Update> ? Update : never;
|
|
107
|
-
};
|
|
108
|
-
/** @public */
|
|
109
|
-
type AtomToken<T, K extends Canonical = any> = MutableAtomToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomToken<T, K>;
|
|
110
|
-
/** @public */
|
|
111
|
-
type WritableSelectorToken<T, K extends Canonical = any> = {
|
|
112
|
-
/** The unique identifier of the selector. */
|
|
113
|
-
key: string;
|
|
114
|
-
/** Discriminator. */
|
|
115
|
-
type: `selector`;
|
|
116
|
-
/** Present if the selector belongs to a family. */
|
|
117
|
-
family?: FamilyMetadata<K>;
|
|
118
|
-
/** Never present. This is a marker that preserves the type of the selector's value. */
|
|
119
|
-
__T?: T;
|
|
120
|
-
};
|
|
121
|
-
/** @public */
|
|
122
|
-
type ReadonlySelectorToken<T, K extends Canonical = any> = {
|
|
123
|
-
/** The unique identifier of the selector. */
|
|
124
|
-
key: string;
|
|
125
|
-
/** Discriminator. */
|
|
126
|
-
type: `readonly_selector`;
|
|
127
|
-
/** Present if the selector belongs to a family. */
|
|
128
|
-
family?: FamilyMetadata<K>;
|
|
129
|
-
/** Never present. This is a marker that preserves the type of the selector's value. */
|
|
130
|
-
__T?: T;
|
|
131
|
-
};
|
|
132
|
-
/** @public */
|
|
133
|
-
type SelectorToken<T, K extends Canonical = any> = ReadonlySelectorToken<T, K> | WritableSelectorToken<T, K>;
|
|
134
|
-
/**
|
|
135
|
-
* @public
|
|
136
|
-
* These states can be set.
|
|
137
|
-
*/
|
|
138
|
-
type WritableToken<T, K extends Canonical = any> = AtomToken<T, K> | WritableSelectorToken<T, K>;
|
|
139
|
-
/**
|
|
140
|
-
* @public
|
|
141
|
-
* These states cannot be set.
|
|
142
|
-
*/
|
|
143
|
-
type ReadableToken<T, K extends Canonical = any> = AtomToken<T, K> | SelectorToken<T, K>;
|
|
144
|
-
/**
|
|
145
|
-
* @public
|
|
146
|
-
* States belonging to this family cannot be set.
|
|
147
|
-
*/
|
|
148
|
-
type ReadableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | SelectorFamilyToken<T, K>;
|
|
149
|
-
/**
|
|
150
|
-
* @public
|
|
151
|
-
* Identifies a state's connection to its family.
|
|
152
|
-
*/
|
|
153
|
-
type FamilyMetadata<K extends Canonical = any> = {
|
|
154
|
-
/** The family's unique key. */
|
|
155
|
-
key: string;
|
|
156
|
-
/** The family member's unique identifier, in the form of a string. */
|
|
157
|
-
subKey: stringified<K>;
|
|
158
|
-
};
|
|
33
|
+
declare function usePush<J extends Json.Serializable>(token: AtomIO.WritableToken<J>): <New extends J>(next: New | ((old: J) => New)) => void;
|
|
159
34
|
|
|
160
|
-
declare function
|
|
161
|
-
|
|
162
|
-
declare function usePullAtomFamilyMember<J extends Json.Serializable, K extends Canonical, Key extends K>(family: RegularAtomFamilyToken<J, K>, subKey: Key): J;
|
|
163
|
-
|
|
164
|
-
declare function usePullMutable<T extends Transceiver<any>, J extends Json.Serializable>(token: MutableAtomToken<T, J>): T;
|
|
165
|
-
|
|
166
|
-
declare function usePullMutableAtomFamilyMember<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(familyToken: MutableAtomFamilyToken<T, J, K>, key: Key): T;
|
|
167
|
-
|
|
168
|
-
declare function usePullSelector<J extends Json.Serializable>(token: SelectorToken<J>): J;
|
|
169
|
-
|
|
170
|
-
declare function usePullSelectorFamilyMember<T, K extends Canonical, Key extends K>(familyToken: SelectorFamilyToken<T, K>, key: Key): T;
|
|
171
|
-
|
|
172
|
-
declare function usePush<J extends Json.Serializable>(token: WritableToken<J>): <New extends J>(next: New | ((old: J) => New)) => void;
|
|
173
|
-
|
|
174
|
-
declare function useServerAction<F extends Func>(token: TransactionToken<F>): (...parameters: Parameters<F>) => ReturnType<F>;
|
|
175
|
-
|
|
176
|
-
type UserKey = `user::${string}`;
|
|
177
|
-
|
|
178
|
-
type PerspectiveToken<F extends AtomFamilyToken<any>> = {
|
|
179
|
-
type: `realtime_perspective`;
|
|
180
|
-
resourceAtoms: F;
|
|
181
|
-
viewAtoms: ReadableFamilyToken<ReadableToken<TokenType<F>>[], UserKey>;
|
|
182
|
-
};
|
|
183
|
-
type ContinuityToken = {
|
|
184
|
-
readonly type: `continuity`;
|
|
185
|
-
readonly key: string;
|
|
186
|
-
readonly globals: AtomToken<any>[];
|
|
187
|
-
readonly actions: TransactionToken<any>[];
|
|
188
|
-
readonly perspectives: PerspectiveToken<AtomFamilyToken<any, Canonical>>[];
|
|
189
|
-
};
|
|
35
|
+
declare function useServerAction<F extends Func>(token: AtomIO.TransactionToken<F>): (...parameters: Parameters<F>) => ReturnType<F>;
|
|
190
36
|
|
|
191
37
|
declare function useSyncContinuity(token: ContinuityToken): void;
|
|
192
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { RealtimeContext, RealtimeProvider, usePullAtom, usePullAtomFamilyMember, usePullMutable, usePullMutableAtomFamilyMember, usePullSelector, usePullSelectorFamilyMember, usePush, useServerAction, useSyncContinuity } from '../../dist/chunk-
|
|
2
|
-
import '../../dist/chunk-
|
|
1
|
+
export { RealtimeContext, RealtimeProvider, usePullAtom, usePullAtomFamilyMember, usePullMutable, usePullMutableAtomFamilyMember, usePullSelector, usePullSelectorFamilyMember, usePush, useServerAction, useSyncContinuity } from '../../dist/chunk-QRPY4LSO.js';
|
|
2
|
+
import '../../dist/chunk-XN3EO2UT.js';
|
|
3
3
|
import '../../dist/chunk-4LWKCEW3.js';
|
|
4
|
-
import '../../dist/chunk-
|
|
5
|
-
import '../../dist/chunk-
|
|
4
|
+
import '../../dist/chunk-HEEVASKG.js';
|
|
5
|
+
import '../../dist/chunk-RXQWAO26.js';
|
|
6
6
|
import '../../dist/chunk-XWL6SNVU.js';
|