atom.io 0.32.0 → 0.32.1
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-3PQTWLQQ.js} +1 -1
- package/dist/{chunk-Z2UJW4NQ.js → chunk-3ZFTRSNG.js} +3 -3
- package/dist/{chunk-354XQWHH.js → chunk-KVI5OBF2.js} +5 -5
- package/dist/{chunk-GY2XQYZY.js → chunk-UQEYZ3OI.js} +45 -40
- package/dist/{chunk-R3ZUK5EH.js → chunk-UYYKOGZQ.js} +16 -6
- package/dist/{chunk-ECOMOMUN.js → chunk-VRJP2PCU.js} +10 -10
- package/dist/{chunk-NF7FJKJD.js → chunk-X7SD2NXU.js} +2 -1
- package/dist/index.d.ts +43 -514
- 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 +8 -656
- 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/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/json/dist/index.d.ts +5 -899
- package/json/dist/index.js +1 -1
- package/package.json +8 -8
- 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 +7 -202
- package/realtime/dist/index.js +2 -2
- package/realtime/src/realtime-continuity.ts +1 -0
- 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 +26 -971
- package/realtime-server/dist/index.js +3 -3
- package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
- 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/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
package/react/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { StoreContext, StoreProvider, useI, useJSON, useO, useTL } from '../../dist/chunk-
|
|
2
|
-
import '../../dist/chunk-
|
|
1
|
+
export { StoreContext, StoreProvider, useI, useJSON, useO, useTL } from '../../dist/chunk-3PQTWLQQ.js';
|
|
2
|
+
import '../../dist/chunk-UQEYZ3OI.js';
|
|
3
3
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DetailedHTMLProps, InputHTMLAttributes, ForwardRefExoticComponent, FC, ErrorInfo, ReactNode, Component, CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import { JsonTypes, Json } from 'atom.io/json';
|
|
2
3
|
|
|
3
4
|
declare const AtomIODevtools: React.FC;
|
|
4
5
|
|
|
@@ -75,32 +76,6 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
75
76
|
render(): ReactNode;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
type primitive = boolean | number | string | null;
|
|
79
|
-
declare namespace Json {
|
|
80
|
-
namespace Tree {
|
|
81
|
-
type Array<Element = unknown> = ReadonlyArray<Element>;
|
|
82
|
-
type Object<K extends string = string, V = unknown> = Record<K, V>;
|
|
83
|
-
type Fork = Array | Object;
|
|
84
|
-
type Leaf = primitive;
|
|
85
|
-
type Node = Fork | Leaf;
|
|
86
|
-
}
|
|
87
|
-
type Serializable = primitive | Readonly<{
|
|
88
|
-
[key: string]: Serializable;
|
|
89
|
-
}> | ReadonlyArray<Serializable>;
|
|
90
|
-
type Object<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
91
|
-
type Array<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
92
|
-
}
|
|
93
|
-
declare const JSON_TYPE_NAMES: readonly ["array", "boolean", "null", "number", "object", "string"];
|
|
94
|
-
type JsonTypeName = (typeof JSON_TYPE_NAMES)[number];
|
|
95
|
-
interface JsonTypes extends Record<JsonTypeName, Json.Serializable> {
|
|
96
|
-
array: Json.Array;
|
|
97
|
-
boolean: boolean;
|
|
98
|
-
null: null;
|
|
99
|
-
number: number;
|
|
100
|
-
object: Json.Object;
|
|
101
|
-
string: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
79
|
type Dict<T> = Record<string, T>;
|
|
105
80
|
type WrapperComponent<T extends Dict<unknown> = Dict<unknown>> = FC<T & {
|
|
106
81
|
children: ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { persistSync } from '../../dist/chunk-4LWKCEW3.js';
|
|
2
|
-
import {
|
|
3
|
-
import { StoreContext, useI, useO } from '../../dist/chunk-
|
|
4
|
-
import { IMPLICIT, createStandaloneAtom, createAtomFamily,
|
|
2
|
+
import { attachIntrospectionStates, jsonRefinery, primitiveRefinery, discoverType, prettyJson } from '../../dist/chunk-VRJP2PCU.js';
|
|
3
|
+
import { StoreContext, useI, useO } from '../../dist/chunk-3PQTWLQQ.js';
|
|
4
|
+
import { IMPLICIT, createStandaloneAtom, createAtomFamily, fromEntries, become, isJson, toEntries, JSON_DEFAULTS, findInStore, undo, redo, getState, stringifyJson } from '../../dist/chunk-UQEYZ3OI.js';
|
|
5
5
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
6
6
|
import { motion, spring, LayoutGroup } from 'motion/react';
|
|
7
7
|
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, createContext, useId, Component, useContext, Fragment as Fragment$1 } from 'react';
|
|
@@ -90,7 +90,7 @@ function clampInto(min, max) {
|
|
|
90
90
|
return (value) => value < min ? min : value > max ? max : value;
|
|
91
91
|
}
|
|
92
92
|
function round(value, decimalPlaces) {
|
|
93
|
-
if (decimalPlaces ===
|
|
93
|
+
if (decimalPlaces === void 0) return value;
|
|
94
94
|
const factor = 10 ** decimalPlaces;
|
|
95
95
|
return Math.round(value * factor) / factor;
|
|
96
96
|
}
|
|
@@ -128,7 +128,7 @@ var initRefinery = (constraints) => (input) => {
|
|
|
128
128
|
return constrained;
|
|
129
129
|
};
|
|
130
130
|
var valueToText = (numericValue) => {
|
|
131
|
-
if (numericValue === null || numericValue ===
|
|
131
|
+
if (numericValue === null || numericValue === void 0) {
|
|
132
132
|
return ``;
|
|
133
133
|
}
|
|
134
134
|
return numericValue.toString();
|
|
@@ -152,7 +152,7 @@ var NumberInput = ({
|
|
|
152
152
|
const [temporaryEntry, setTemporaryEntry] = useState(null);
|
|
153
153
|
const userHasMadeDeliberateChange = useRef(false);
|
|
154
154
|
const refine = initRefinery({ max, min, decimalPlaces, nullable: true });
|
|
155
|
-
const allowDecimal = decimalPlaces ===
|
|
155
|
+
const allowDecimal = decimalPlaces === void 0 || decimalPlaces > 0;
|
|
156
156
|
const handleBlur = () => {
|
|
157
157
|
if (userHasMadeDeliberateChange.current) {
|
|
158
158
|
set(refine(value ?? null));
|
|
@@ -162,7 +162,7 @@ var NumberInput = ({
|
|
|
162
162
|
};
|
|
163
163
|
const handleChange = (event) => {
|
|
164
164
|
if (onChange) onChange(event);
|
|
165
|
-
if (set ===
|
|
165
|
+
if (set === void 0) return;
|
|
166
166
|
userHasMadeDeliberateChange.current = true;
|
|
167
167
|
const input = event.target.value;
|
|
168
168
|
if (isValidNonNumber(input) || isDecimalInProgress(input)) {
|
|
@@ -231,7 +231,7 @@ var TextInput = ({
|
|
|
231
231
|
type: "text",
|
|
232
232
|
value,
|
|
233
233
|
onChange: (e) => set?.(e.target.value),
|
|
234
|
-
disabled: set ===
|
|
234
|
+
disabled: set === void 0,
|
|
235
235
|
placeholder,
|
|
236
236
|
"data-testid": testid
|
|
237
237
|
}
|
|
@@ -242,7 +242,7 @@ var TextInput = ({
|
|
|
242
242
|
type: "text",
|
|
243
243
|
value,
|
|
244
244
|
onChange: (e) => set?.(e.target.value),
|
|
245
|
-
disabled: set ===
|
|
245
|
+
disabled: set === void 0,
|
|
246
246
|
placeholder,
|
|
247
247
|
"data-testid": testid
|
|
248
248
|
}
|
|
@@ -253,7 +253,7 @@ var NonJsonEditor = ({
|
|
|
253
253
|
data,
|
|
254
254
|
testid
|
|
255
255
|
}) => {
|
|
256
|
-
return data ===
|
|
256
|
+
return data === void 0 ? /* @__PURE__ */ jsx(
|
|
257
257
|
ElasticInput,
|
|
258
258
|
{
|
|
259
259
|
disabled: true,
|
|
@@ -314,7 +314,7 @@ var JsonEditor_INTERNAL = ({
|
|
|
314
314
|
ElasticInput,
|
|
315
315
|
{
|
|
316
316
|
value: name,
|
|
317
|
-
onChange: disabled ?
|
|
317
|
+
onChange: disabled ? void 0 : (e) => {
|
|
318
318
|
rename(e.target.value);
|
|
319
319
|
},
|
|
320
320
|
disabled,
|
|
@@ -338,7 +338,7 @@ var JsonEditor_INTERNAL = ({
|
|
|
338
338
|
recast && dataIsJson ? /* @__PURE__ */ jsx(
|
|
339
339
|
"select",
|
|
340
340
|
{
|
|
341
|
-
onChange: disabled ?
|
|
341
|
+
onChange: disabled ? void 0 : (e) => {
|
|
342
342
|
recast(e.target.value);
|
|
343
343
|
},
|
|
344
344
|
value: refined.type,
|
|
@@ -551,7 +551,8 @@ var castToJson = (input) => {
|
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
|
-
|
|
554
|
+
case `null`:
|
|
555
|
+
case void 0: {
|
|
555
556
|
return {
|
|
556
557
|
get array() {
|
|
557
558
|
return nullToArray();
|
|
@@ -744,7 +745,7 @@ var NumberEditor = ({
|
|
|
744
745
|
{
|
|
745
746
|
testid: `${testid}-number-input`,
|
|
746
747
|
value: data,
|
|
747
|
-
set: isReadonly(path) ?
|
|
748
|
+
set: isReadonly(path) ? void 0 : (newValue) => {
|
|
748
749
|
set(Number(newValue));
|
|
749
750
|
},
|
|
750
751
|
autoSize: true
|
|
@@ -763,7 +764,7 @@ var StringEditor = ({
|
|
|
763
764
|
{
|
|
764
765
|
testid: `${testid}-string-input`,
|
|
765
766
|
value: data,
|
|
766
|
-
set: isReadonly(path) ?
|
|
767
|
+
set: isReadonly(path) ? void 0 : set,
|
|
767
768
|
autoSize: true
|
|
768
769
|
}
|
|
769
770
|
) });
|
|
@@ -1154,6 +1155,12 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
1154
1155
|
},
|
|
1155
1156
|
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1156
1157
|
);
|
|
1158
|
+
case `molecule_creation`:
|
|
1159
|
+
case `molecule_disposal`:
|
|
1160
|
+
case `molecule_transfer`:
|
|
1161
|
+
case `state_creation`:
|
|
1162
|
+
case `state_disposal`:
|
|
1163
|
+
return null;
|
|
1157
1164
|
}
|
|
1158
1165
|
})
|
|
1159
1166
|
] })
|
|
@@ -1200,6 +1207,12 @@ var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
|
1200
1207
|
},
|
|
1201
1208
|
`${timelineUpdate.key}:${index}:${update.key}`
|
|
1202
1209
|
);
|
|
1210
|
+
case `molecule_creation`:
|
|
1211
|
+
case `molecule_disposal`:
|
|
1212
|
+
case `molecule_transfer`:
|
|
1213
|
+
case `state_creation`:
|
|
1214
|
+
case `state_disposal`:
|
|
1215
|
+
return null;
|
|
1203
1216
|
}
|
|
1204
1217
|
}) : timelineUpdate.type === `selector_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
1205
1218
|
return /* @__PURE__ */ jsx(
|
|
@@ -119,6 +119,12 @@ const TransactionUpdateFC: React.FC<{
|
|
|
119
119
|
transactionUpdate={update}
|
|
120
120
|
/>
|
|
121
121
|
)
|
|
122
|
+
case `molecule_creation`:
|
|
123
|
+
case `molecule_disposal`:
|
|
124
|
+
case `molecule_transfer`:
|
|
125
|
+
case `state_creation`:
|
|
126
|
+
case `state_disposal`:
|
|
127
|
+
return null
|
|
122
128
|
}
|
|
123
129
|
})}
|
|
124
130
|
</section>
|
|
@@ -173,6 +179,12 @@ export const TimelineUpdateFC: React.FC<{
|
|
|
173
179
|
transactionUpdate={update}
|
|
174
180
|
/>
|
|
175
181
|
)
|
|
182
|
+
case `molecule_creation`:
|
|
183
|
+
case `molecule_disposal`:
|
|
184
|
+
case `molecule_transfer`:
|
|
185
|
+
case `state_creation`:
|
|
186
|
+
case `state_disposal`:
|
|
187
|
+
return null
|
|
176
188
|
}
|
|
177
189
|
})
|
|
178
190
|
) : timelineUpdate.type === `selector_update` ? (
|
package/realtime/dist/index.d.ts
CHANGED
|
@@ -1,203 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type Fork = Array | Object;
|
|
7
|
-
type Leaf = primitive;
|
|
8
|
-
type Node = Fork | Leaf;
|
|
9
|
-
}
|
|
10
|
-
type Serializable = primitive | Readonly<{
|
|
11
|
-
[key: string]: Serializable;
|
|
12
|
-
}> | ReadonlyArray<Serializable>;
|
|
13
|
-
type Object<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
14
|
-
type Array<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
15
|
-
}
|
|
16
|
-
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 & {
|
|
17
|
-
__json?: J;
|
|
18
|
-
};
|
|
19
|
-
type Canonical = primitive | ReadonlyArray<Canonical>;
|
|
20
|
-
|
|
21
|
-
type Func = (...parameters: any[]) => any;
|
|
22
|
-
|
|
23
|
-
declare class Subject<T> {
|
|
24
|
-
Subscriber: (value: T) => void;
|
|
25
|
-
subscribers: Map<string, this[`Subscriber`]>;
|
|
26
|
-
subscribe(key: string, subscriber: this[`Subscriber`]): () => void;
|
|
27
|
-
private unsubscribe;
|
|
28
|
-
next(value: T): void;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
type SetUpdate = `add:${string}` | `clear:${string}` | `del:${string}` | `tx:${string}`;
|
|
32
|
-
type NumberedSetUpdate = `${number}=${SetUpdate}`;
|
|
33
|
-
interface SetRTXJson<P extends primitive> extends Json.Object {
|
|
34
|
-
members: P[];
|
|
35
|
-
cache: (NumberedSetUpdate | null)[];
|
|
36
|
-
cacheLimit: number;
|
|
37
|
-
cacheIdx: number;
|
|
38
|
-
cacheUpdateNumber: number;
|
|
39
|
-
}
|
|
40
|
-
declare class SetRTX<P extends primitive> extends Set<P> implements Transceiver<NumberedSetUpdate>, Lineage {
|
|
41
|
-
mode: TransceiverMode;
|
|
42
|
-
readonly subject: Subject<SetUpdate>;
|
|
43
|
-
cacheLimit: number;
|
|
44
|
-
cache: (NumberedSetUpdate | null)[];
|
|
45
|
-
cacheIdx: number;
|
|
46
|
-
cacheUpdateNumber: number;
|
|
47
|
-
constructor(values?: Iterable<P>, cacheLimit?: number);
|
|
48
|
-
toJSON(): SetRTXJson<P>;
|
|
49
|
-
static fromJSON<P extends primitive>(json: SetRTXJson<P>): SetRTX<P>;
|
|
50
|
-
add(value: P): this;
|
|
51
|
-
clear(): void;
|
|
52
|
-
delete(value: P): boolean;
|
|
53
|
-
readonly parent: SetRTX<P> | null;
|
|
54
|
-
child: SetRTX<P> | null;
|
|
55
|
-
transactionUpdates: SetUpdate[] | null;
|
|
56
|
-
transaction(run: (child: SetRTX<P>) => boolean): void;
|
|
57
|
-
protected _subscribe(key: string, fn: (update: SetUpdate) => void): () => void;
|
|
58
|
-
subscribe(key: string, fn: (update: NumberedSetUpdate) => void): () => void;
|
|
59
|
-
emit(update: SetUpdate): void;
|
|
60
|
-
private doStep;
|
|
61
|
-
getUpdateNumber(update: NumberedSetUpdate): number;
|
|
62
|
-
do(update: NumberedSetUpdate): number | `OUT_OF_RANGE` | null;
|
|
63
|
-
undoStep(update: SetUpdate): void;
|
|
64
|
-
undo(update: NumberedSetUpdate): number | null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface Lineage {
|
|
68
|
-
parent: typeof this | null;
|
|
69
|
-
child: typeof this | null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
interface Transceiver<S extends Json.Serializable> {
|
|
73
|
-
do: (update: S) => number | `OUT_OF_RANGE` | null;
|
|
74
|
-
undo: (update: S) => void;
|
|
75
|
-
subscribe: (key: string, fn: (update: S) => void) => () => void;
|
|
76
|
-
cacheUpdateNumber: number;
|
|
77
|
-
getUpdateNumber: (update: S) => number;
|
|
78
|
-
}
|
|
79
|
-
type TransceiverMode = `playback` | `record` | `transaction`;
|
|
80
|
-
|
|
81
|
-
type RegularAtomFamilyToken<T, K extends Canonical> = {
|
|
82
|
-
key: string;
|
|
83
|
-
type: `atom_family`;
|
|
84
|
-
__T?: T;
|
|
85
|
-
__K?: K;
|
|
86
|
-
};
|
|
87
|
-
type MutableAtomFamilyToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical> = {
|
|
88
|
-
key: string;
|
|
89
|
-
type: `mutable_atom_family`;
|
|
90
|
-
__T?: T;
|
|
91
|
-
__J?: J;
|
|
92
|
-
__K?: K;
|
|
93
|
-
};
|
|
94
|
-
type AtomFamilyToken<T, K extends Canonical = Canonical> = MutableAtomFamilyToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomFamilyToken<T, K>;
|
|
95
|
-
|
|
96
|
-
type TransactionToken<F extends Func> = {
|
|
97
|
-
key: string;
|
|
98
|
-
type: `transaction`;
|
|
99
|
-
__F?: F;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
type WritableSelectorFamilyToken<T, K extends Canonical> = {
|
|
103
|
-
key: string;
|
|
104
|
-
type: `selector_family`;
|
|
105
|
-
__T?: T;
|
|
106
|
-
__K?: K;
|
|
107
|
-
};
|
|
108
|
-
type ReadonlySelectorFamilyToken<T, K extends Canonical> = {
|
|
109
|
-
key: string;
|
|
110
|
-
type: `readonly_selector_family`;
|
|
111
|
-
__T?: T;
|
|
112
|
-
__K?: K;
|
|
113
|
-
};
|
|
114
|
-
type SelectorFamilyToken<T, K extends Canonical> = ReadonlySelectorFamilyToken<T, K> | WritableSelectorFamilyToken<T, K>;
|
|
115
|
-
|
|
116
|
-
type JoinToken<ASide extends string, AType extends string, BSide extends string, BType extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null = null> = {
|
|
117
|
-
key: string;
|
|
118
|
-
type: `join`;
|
|
119
|
-
cardinality: Cardinality;
|
|
120
|
-
a: ASide;
|
|
121
|
-
b: BSide;
|
|
122
|
-
__aType?: AType;
|
|
123
|
-
__bType?: BType;
|
|
124
|
-
__content?: Content;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
type TokenType<Comparison extends ReadableFamilyToken<any, any> | ReadableToken<any>> = Comparison extends ReadableToken<infer RepresentedValue> ? RepresentedValue : Comparison extends ReadableFamilyToken<infer RepresentedValue, any> ? RepresentedValue : never;
|
|
128
|
-
|
|
129
|
-
/** @public */
|
|
130
|
-
type RegularAtomToken<T, K extends Canonical = any> = {
|
|
131
|
-
/** The unique identifier of the atom. */
|
|
132
|
-
key: string;
|
|
133
|
-
/** Discriminator. */
|
|
134
|
-
type: `atom`;
|
|
135
|
-
/** Present if the atom belongs to a family. */
|
|
136
|
-
family?: FamilyMetadata<K>;
|
|
137
|
-
/** Never present. This is a marker that preserves the type of the atom's value. */
|
|
138
|
-
__T?: T;
|
|
139
|
-
};
|
|
140
|
-
/** @public */
|
|
141
|
-
type MutableAtomToken<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical = any> = {
|
|
142
|
-
/** The unique identifier of the atom. */
|
|
143
|
-
key: string;
|
|
144
|
-
/** Discriminator. */
|
|
145
|
-
type: `mutable_atom`;
|
|
146
|
-
/** Present if the atom belongs to a family. */
|
|
147
|
-
family?: FamilyMetadata<K>;
|
|
148
|
-
/** Never present. This is a marker that preserves the JSON form of the atom's transceiver value. */
|
|
149
|
-
__J?: J;
|
|
150
|
-
/** Never present. This is a marker that preserves the type of the atom's transceiver value. */
|
|
151
|
-
__U?: T extends Transceiver<infer Update> ? Update : never;
|
|
152
|
-
};
|
|
153
|
-
/** @public */
|
|
154
|
-
type AtomToken<T, K extends Canonical = any> = MutableAtomToken<T extends Transceiver<any> ? T : never, any, K> | RegularAtomToken<T, K>;
|
|
155
|
-
/** @public */
|
|
156
|
-
type WritableSelectorToken<T, K extends Canonical = any> = {
|
|
157
|
-
/** The unique identifier of the selector. */
|
|
158
|
-
key: string;
|
|
159
|
-
/** Discriminator. */
|
|
160
|
-
type: `selector`;
|
|
161
|
-
/** Present if the selector belongs to a family. */
|
|
162
|
-
family?: FamilyMetadata<K>;
|
|
163
|
-
/** Never present. This is a marker that preserves the type of the selector's value. */
|
|
164
|
-
__T?: T;
|
|
165
|
-
};
|
|
166
|
-
/** @public */
|
|
167
|
-
type ReadonlySelectorToken<T, K extends Canonical = any> = {
|
|
168
|
-
/** The unique identifier of the selector. */
|
|
169
|
-
key: string;
|
|
170
|
-
/** Discriminator. */
|
|
171
|
-
type: `readonly_selector`;
|
|
172
|
-
/** Present if the selector belongs to a family. */
|
|
173
|
-
family?: FamilyMetadata<K>;
|
|
174
|
-
/** Never present. This is a marker that preserves the type of the selector's value. */
|
|
175
|
-
__T?: T;
|
|
176
|
-
};
|
|
177
|
-
/** @public */
|
|
178
|
-
type SelectorToken<T, K extends Canonical = any> = ReadonlySelectorToken<T, K> | WritableSelectorToken<T, K>;
|
|
179
|
-
/**
|
|
180
|
-
* @public
|
|
181
|
-
* These states cannot be set.
|
|
182
|
-
*/
|
|
183
|
-
type ReadableToken<T, K extends Canonical = any> = AtomToken<T, K> | SelectorToken<T, K>;
|
|
184
|
-
/**
|
|
185
|
-
* @public
|
|
186
|
-
* States belonging to this family cannot be set.
|
|
187
|
-
*/
|
|
188
|
-
type ReadableFamilyToken<T, K extends Canonical> = AtomFamilyToken<T, K> | SelectorFamilyToken<T, K>;
|
|
189
|
-
/**
|
|
190
|
-
* @public
|
|
191
|
-
* Identifies a state's connection to its family.
|
|
192
|
-
*/
|
|
193
|
-
type FamilyMetadata<K extends Canonical = any> = {
|
|
194
|
-
/** The family's unique key. */
|
|
195
|
-
key: string;
|
|
196
|
-
/** The family member's unique identifier, in the form of a string. */
|
|
197
|
-
subKey: stringified<K>;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
type UserKey = `user::${string}`;
|
|
1
|
+
import * as atom_io from 'atom.io';
|
|
2
|
+
import { AtomFamilyToken, ReadableFamilyToken, ReadableToken, TokenType, AtomToken, TransactionToken, MutableAtomToken } from 'atom.io';
|
|
3
|
+
import { Canonical } from 'atom.io/json';
|
|
4
|
+
import { UserKey } from 'atom.io/realtime-server';
|
|
5
|
+
import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
|
|
201
6
|
|
|
202
7
|
declare class InvariantMap<K, V> extends Map<K, V> {
|
|
203
8
|
set(key: K, value: V): this;
|
|
@@ -240,7 +45,7 @@ type UserInRoomMeta = {
|
|
|
240
45
|
enteredAtEpoch: number;
|
|
241
46
|
};
|
|
242
47
|
declare const DEFAULT_USER_IN_ROOM_META: UserInRoomMeta;
|
|
243
|
-
declare const usersInRooms: JoinToken<"room", string, "user", string, "1:n", UserInRoomMeta>;
|
|
244
|
-
declare const usersInMyRoomView: ReadonlySelectorFamilyToken<MutableAtomToken<SetRTX<string>, SetRTXJson<string>>[], string>;
|
|
48
|
+
declare const usersInRooms: atom_io.JoinToken<"room", string, "user", string, "1:n", UserInRoomMeta>;
|
|
49
|
+
declare const usersInMyRoomView: atom_io.ReadonlySelectorFamilyToken<MutableAtomToken<SetRTX<string>, SetRTXJson<string>>[], string>;
|
|
245
50
|
|
|
246
51
|
export { type ContinuityOptions, type ContinuityToken, DEFAULT_USER_IN_ROOM_META, InvariantMap, type PerspectiveToken, SyncGroup, type UserInRoomMeta, continuity, roomIndex, usersInMyRoomView, usersInRooms, usersInThisRoomIndex };
|
package/realtime/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DEFAULT_USER_IN_ROOM_META, InvariantMap, SyncGroup, continuity, roomIndex, usersInMyRoomView, usersInRooms, usersInThisRoomIndex } from '../../dist/chunk-
|
|
2
|
-
import '../../dist/chunk-
|
|
1
|
+
export { DEFAULT_USER_IN_ROOM_META, InvariantMap, SyncGroup, continuity, roomIndex, usersInMyRoomView, usersInRooms, usersInThisRoomIndex } from '../../dist/chunk-X7SD2NXU.js';
|
|
2
|
+
import '../../dist/chunk-UQEYZ3OI.js';
|
|
3
3
|
import '../../dist/chunk-XWL6SNVU.js';
|