atom.io 0.6.7 → 0.6.8
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 +27 -17
- package/dist/index.d.ts +27 -17
- package/dist/index.js +28 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -22
- package/dist/index.mjs.map +1 -1
- package/introspection/dist/index.d.mts +14 -15
- package/introspection/dist/index.d.ts +14 -15
- package/introspection/dist/index.js +2 -2
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/index.mjs +2 -2
- package/introspection/dist/index.mjs.map +1 -1
- package/json/dist/index.d.mts +5 -7
- package/json/dist/index.d.ts +5 -7
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs.map +1 -1
- package/package.json +15 -7
- package/react-devtools/dist/index.css +9 -1
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +14 -15
- package/react-devtools/dist/index.d.ts +14 -15
- package/react-devtools/dist/index.js +769 -249
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +752 -227
- package/react-devtools/dist/index.mjs.map +1 -1
- package/realtime/dist/index.d.mts +6 -8
- package/realtime/dist/index.d.ts +6 -8
- package/realtime/dist/index.js +0 -1
- package/realtime/dist/index.js.map +1 -1
- package/realtime/dist/index.mjs +0 -1
- package/realtime/dist/index.mjs.map +1 -1
- package/realtime-react/dist/index.d.mts +11 -13
- package/realtime-react/dist/index.d.ts +11 -13
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/dist/index.mjs.map +1 -1
- package/src/atom.ts +4 -4
- package/src/index.ts +1 -1
- package/src/internal/families-internal.ts +23 -20
- package/src/internal/index.ts +1 -1
- package/src/internal/selector/create-read-write-selector.ts +3 -1
- package/src/internal/selector/create-readonly-selector.ts +3 -1
- package/src/internal/time-travel-internal.ts +4 -4
- package/src/internal/timeline/add-atom-to-timeline.ts +2 -2
- package/src/internal/timeline-internal.ts +2 -2
- package/src/introspection/attach-timeline-family.ts +1 -1
- package/src/json/select-json.ts +1 -1
- package/src/react-devtools/StateEditor.tsx +5 -1
- package/src/react-devtools/StateIndex.tsx +4 -1
- package/src/react-devtools/devtools.scss +0 -1
- package/src/realtime/hook-composition/expose-family.ts +2 -2
- package/src/realtime/hook-composition/expose-single.ts +1 -1
- package/src/realtime/hook-composition/receive-state.ts +1 -1
- package/src/realtime-react/realtime-hooks.ts +4 -4
- package/src/realtime-react/use-pull-family-member.ts +2 -2
- package/src/realtime-react/use-pull-family.ts +2 -2
- package/src/realtime-react/use-pull.ts +3 -1
- package/src/realtime-react/use-push.ts +3 -1
- package/src/selector.ts +14 -12
- package/src/subscribe.ts +1 -1
- package/src/tracker/index.ts +3 -0
- package/src/tracker/tracker.ts +61 -0
- package/src/web-effects/storage.ts +1 -1
- package/src/internal/subject.ts +0 -24
|
@@ -5,18 +5,17 @@ type PlainObject = Record<keyof any, unknown>;
|
|
|
5
5
|
|
|
6
6
|
type ƒn = (...parameters: any[]) => any;
|
|
7
7
|
|
|
8
|
-
type JsonInterface<T, J extends
|
|
8
|
+
type JsonInterface<T, J extends Serializable = Serializable> = {
|
|
9
9
|
toJson: (t: T) => J;
|
|
10
10
|
fromJson: (json: J) => T;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
type
|
|
14
|
-
|
|
13
|
+
type primitive = boolean | number | string | null;
|
|
14
|
+
|
|
15
|
+
type Serializable = primitive | Readonly<{
|
|
15
16
|
[key: string]: Serializable;
|
|
16
17
|
}> | ReadonlyArray<Serializable>;
|
|
17
|
-
type
|
|
18
|
-
type JsonArr<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
19
|
-
type Json = JsonArr | JsonObj | Primitive;
|
|
18
|
+
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
20
19
|
|
|
21
20
|
type Identified = {
|
|
22
21
|
id: string;
|
|
@@ -24,23 +23,23 @@ type Identified = {
|
|
|
24
23
|
|
|
25
24
|
declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
|
|
26
25
|
type RelationType = typeof RELATION_TYPES[number];
|
|
27
|
-
type RelationData<CONTENT extends
|
|
28
|
-
contents:
|
|
29
|
-
relations:
|
|
26
|
+
type RelationData<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
27
|
+
contents: Object$1<string, CONTENT>;
|
|
28
|
+
relations: Object$1<string, string[]>;
|
|
30
29
|
relationType: RelationType;
|
|
31
30
|
a: A;
|
|
32
31
|
b: B;
|
|
33
32
|
};
|
|
34
|
-
type IsRelationDataOptions<CONTENT extends
|
|
33
|
+
type IsRelationDataOptions<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
35
34
|
from?: A;
|
|
36
35
|
to?: B;
|
|
37
|
-
isContent?: (json:
|
|
36
|
+
isContent?: (json: Serializable) => json is CONTENT;
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
type NullSafeUnion<Base, Extension> = Extension extends null ? Base : Base & Extension;
|
|
41
|
-
type NullSafeRest<MaybeArg> = MaybeArg extends null ? [] | [undefined] : [
|
|
40
|
+
type NullSafeRest<MaybeArg, IfArg = MaybeArg> = MaybeArg extends null ? [] | [undefined] : [IfArg];
|
|
42
41
|
|
|
43
|
-
declare class Join<CONTENT extends
|
|
42
|
+
declare class Join<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> implements RelationData<CONTENT, A, B> {
|
|
44
43
|
readonly relationType: `1:1` | `1:n` | `n:n`;
|
|
45
44
|
readonly a: A;
|
|
46
45
|
readonly b: B;
|
|
@@ -48,7 +47,7 @@ declare class Join<CONTENT extends JsonObj | null = null, A extends string = `fr
|
|
|
48
47
|
readonly contents: Record<string, CONTENT>;
|
|
49
48
|
constructor(json?: Partial<RelationData<CONTENT, A, B>>);
|
|
50
49
|
toJSON(): RelationData<CONTENT, A, B>;
|
|
51
|
-
static fromJSON<CONTENT extends
|
|
50
|
+
static fromJSON<CONTENT extends Object$1 | null, A extends string, B extends string>(json: Serializable, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
|
|
52
51
|
from<AA extends string>(newA: AA): Join<CONTENT, AA, B>;
|
|
53
52
|
to<BB extends string>(newB: BB): Join<CONTENT, A, BB>;
|
|
54
53
|
makeJsonInterface: (...params: CONTENT extends null ? [
|
|
@@ -239,7 +238,7 @@ type TimelineTransactionUpdate = TransactionUpdate<ƒn> & {
|
|
|
239
238
|
type Timeline = {
|
|
240
239
|
key: string;
|
|
241
240
|
at: number;
|
|
242
|
-
timeTraveling:
|
|
241
|
+
timeTraveling: `into_future` | `into_past` | null;
|
|
243
242
|
history: TimelineUpdate[];
|
|
244
243
|
selectorTime: number | null;
|
|
245
244
|
transactionKey: string | null;
|
|
@@ -5,18 +5,17 @@ type PlainObject = Record<keyof any, unknown>;
|
|
|
5
5
|
|
|
6
6
|
type ƒn = (...parameters: any[]) => any;
|
|
7
7
|
|
|
8
|
-
type JsonInterface<T, J extends
|
|
8
|
+
type JsonInterface<T, J extends Serializable = Serializable> = {
|
|
9
9
|
toJson: (t: T) => J;
|
|
10
10
|
fromJson: (json: J) => T;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
type
|
|
14
|
-
|
|
13
|
+
type primitive = boolean | number | string | null;
|
|
14
|
+
|
|
15
|
+
type Serializable = primitive | Readonly<{
|
|
15
16
|
[key: string]: Serializable;
|
|
16
17
|
}> | ReadonlyArray<Serializable>;
|
|
17
|
-
type
|
|
18
|
-
type JsonArr<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
19
|
-
type Json = JsonArr | JsonObj | Primitive;
|
|
18
|
+
type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
20
19
|
|
|
21
20
|
type Identified = {
|
|
22
21
|
id: string;
|
|
@@ -24,23 +23,23 @@ type Identified = {
|
|
|
24
23
|
|
|
25
24
|
declare const RELATION_TYPES: readonly ["1:1", "1:n", "n:n"];
|
|
26
25
|
type RelationType = typeof RELATION_TYPES[number];
|
|
27
|
-
type RelationData<CONTENT extends
|
|
28
|
-
contents:
|
|
29
|
-
relations:
|
|
26
|
+
type RelationData<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
27
|
+
contents: Object$1<string, CONTENT>;
|
|
28
|
+
relations: Object$1<string, string[]>;
|
|
30
29
|
relationType: RelationType;
|
|
31
30
|
a: A;
|
|
32
31
|
b: B;
|
|
33
32
|
};
|
|
34
|
-
type IsRelationDataOptions<CONTENT extends
|
|
33
|
+
type IsRelationDataOptions<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> = {
|
|
35
34
|
from?: A;
|
|
36
35
|
to?: B;
|
|
37
|
-
isContent?: (json:
|
|
36
|
+
isContent?: (json: Serializable) => json is CONTENT;
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
type NullSafeUnion<Base, Extension> = Extension extends null ? Base : Base & Extension;
|
|
41
|
-
type NullSafeRest<MaybeArg> = MaybeArg extends null ? [] | [undefined] : [
|
|
40
|
+
type NullSafeRest<MaybeArg, IfArg = MaybeArg> = MaybeArg extends null ? [] | [undefined] : [IfArg];
|
|
42
41
|
|
|
43
|
-
declare class Join<CONTENT extends
|
|
42
|
+
declare class Join<CONTENT extends Object$1 | null = null, A extends string = `from`, B extends string = `to`> implements RelationData<CONTENT, A, B> {
|
|
44
43
|
readonly relationType: `1:1` | `1:n` | `n:n`;
|
|
45
44
|
readonly a: A;
|
|
46
45
|
readonly b: B;
|
|
@@ -48,7 +47,7 @@ declare class Join<CONTENT extends JsonObj | null = null, A extends string = `fr
|
|
|
48
47
|
readonly contents: Record<string, CONTENT>;
|
|
49
48
|
constructor(json?: Partial<RelationData<CONTENT, A, B>>);
|
|
50
49
|
toJSON(): RelationData<CONTENT, A, B>;
|
|
51
|
-
static fromJSON<CONTENT extends
|
|
50
|
+
static fromJSON<CONTENT extends Object$1 | null, A extends string, B extends string>(json: Serializable, options?: IsRelationDataOptions<CONTENT, A, B>): Join<CONTENT, A, B>;
|
|
52
51
|
from<AA extends string>(newA: AA): Join<CONTENT, AA, B>;
|
|
53
52
|
to<BB extends string>(newB: BB): Join<CONTENT, A, BB>;
|
|
54
53
|
makeJsonInterface: (...params: CONTENT extends null ? [
|
|
@@ -239,7 +238,7 @@ type TimelineTransactionUpdate = TransactionUpdate<ƒn> & {
|
|
|
239
238
|
type Timeline = {
|
|
240
239
|
key: string;
|
|
241
240
|
at: number;
|
|
242
|
-
timeTraveling:
|
|
241
|
+
timeTraveling: `into_future` | `into_past` | null;
|
|
243
242
|
history: TimelineUpdate[];
|
|
244
243
|
selectorTime: number | null;
|
|
245
244
|
transactionKey: string | null;
|