atom.io 0.9.8 → 0.9.10
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/internal/dist/index.d.mts +25 -9
- package/internal/dist/index.d.ts +25 -9
- package/internal/dist/index.js +224 -223
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +220 -222
- package/internal/dist/index.mjs.map +1 -1
- package/internal/src/atom/is-default.ts +2 -2
- package/internal/src/caching.ts +6 -4
- package/internal/src/index.ts +1 -0
- package/internal/src/keys.ts +30 -0
- package/internal/src/selector/get-selector-dependency-keys.ts +20 -0
- package/internal/src/selector/index.ts +1 -1
- package/internal/src/selector/trace-selector-atoms.ts +27 -22
- package/internal/src/selector/update-selector-atoms.ts +4 -4
- package/internal/src/store/index.ts +0 -1
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +4 -5
- package/introspection/dist/index.d.mts +1 -1
- package/introspection/dist/index.d.ts +1 -1
- package/json/dist/index.d.mts +2 -6
- package/json/dist/index.d.ts +2 -6
- package/package.json +4 -4
- package/react-devtools/dist/index.css +281 -3
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +1 -1
- package/react-devtools/dist/index.d.ts +1 -1
- package/realtime-server/dist/index.d.mts +1 -1
- package/realtime-server/dist/index.d.ts +1 -1
- package/realtime-testing/dist/index.d.mts +1 -1
- package/realtime-testing/dist/index.d.ts +1 -1
- package/transceivers/set-rtx/dist/index.d.mts +1 -1
- package/transceivers/set-rtx/dist/index.d.ts +1 -1
- package/internal/src/selector/lookup-selector-sources.ts +0 -20
- package/internal/src/store/lookup.ts +0 -26
package/dist/index.d.mts
CHANGED
|
@@ -186,4 +186,4 @@ type FamilyMetadata = {
|
|
|
186
186
|
subKey: string;
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
export { AtomEffect, AtomFamily, AtomFamilyOptions, AtomOptions, AtomToken, Effectors, FamilyMetadata, KeyedStateUpdate, LOG_LEVELS, Logger, MutableAtomFamily, MutableAtomFamilyOptions, MutableAtomOptions, MutableAtomToken, NO_OP, NotFoundError, Read, ReadonlySelectorFamily, ReadonlySelectorFamilyOptions, ReadonlySelectorOptions, ReadonlySelectorToken, ReadonlyTransactors, SelectorFamily, SelectorFamilyOptions, SelectorOptions, SelectorToken, Silo, StateToken, StateUpdate, TimelineOptions, TimelineToken, TimelineUpdate, TransactionIO, TransactionOptions, TransactionToken, TransactionUpdate, TransactionUpdateHandler, Transactors, UpdateHandler, Write, atom, atomFamily, getState, redo, runTransaction, selector, selectorFamily, setLogLevel, setState, subscribe, subscribeToTimeline, subscribeToTransaction, timeline, transaction, undo, useLogger, ƒn };
|
|
189
|
+
export { type AtomEffect, type AtomFamily, type AtomFamilyOptions, type AtomOptions, type AtomToken, type Effectors, type FamilyMetadata, type KeyedStateUpdate, LOG_LEVELS, type Logger, type MutableAtomFamily, type MutableAtomFamilyOptions, type MutableAtomOptions, type MutableAtomToken, NO_OP, NotFoundError, type Read, type ReadonlySelectorFamily, type ReadonlySelectorFamilyOptions, type ReadonlySelectorOptions, type ReadonlySelectorToken, type ReadonlyTransactors, type SelectorFamily, type SelectorFamilyOptions, type SelectorOptions, type SelectorToken, Silo, type StateToken, type StateUpdate, type TimelineOptions, type TimelineToken, type TimelineUpdate, type TransactionIO, type TransactionOptions, type TransactionToken, type TransactionUpdate, type TransactionUpdateHandler, type Transactors, type UpdateHandler, type Write, atom, atomFamily, getState, redo, runTransaction, selector, selectorFamily, setLogLevel, setState, subscribe, subscribeToTimeline, subscribeToTransaction, timeline, transaction, undo, useLogger, type ƒn };
|
package/dist/index.d.ts
CHANGED
|
@@ -186,4 +186,4 @@ type FamilyMetadata = {
|
|
|
186
186
|
subKey: string;
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
export { AtomEffect, AtomFamily, AtomFamilyOptions, AtomOptions, AtomToken, Effectors, FamilyMetadata, KeyedStateUpdate, LOG_LEVELS, Logger, MutableAtomFamily, MutableAtomFamilyOptions, MutableAtomOptions, MutableAtomToken, NO_OP, NotFoundError, Read, ReadonlySelectorFamily, ReadonlySelectorFamilyOptions, ReadonlySelectorOptions, ReadonlySelectorToken, ReadonlyTransactors, SelectorFamily, SelectorFamilyOptions, SelectorOptions, SelectorToken, Silo, StateToken, StateUpdate, TimelineOptions, TimelineToken, TimelineUpdate, TransactionIO, TransactionOptions, TransactionToken, TransactionUpdate, TransactionUpdateHandler, Transactors, UpdateHandler, Write, atom, atomFamily, getState, redo, runTransaction, selector, selectorFamily, setLogLevel, setState, subscribe, subscribeToTimeline, subscribeToTransaction, timeline, transaction, undo, useLogger, ƒn };
|
|
189
|
+
export { type AtomEffect, type AtomFamily, type AtomFamilyOptions, type AtomOptions, type AtomToken, type Effectors, type FamilyMetadata, type KeyedStateUpdate, LOG_LEVELS, type Logger, type MutableAtomFamily, type MutableAtomFamilyOptions, type MutableAtomOptions, type MutableAtomToken, NO_OP, NotFoundError, type Read, type ReadonlySelectorFamily, type ReadonlySelectorFamilyOptions, type ReadonlySelectorOptions, type ReadonlySelectorToken, type ReadonlyTransactors, type SelectorFamily, type SelectorFamilyOptions, type SelectorOptions, type SelectorToken, Silo, type StateToken, type StateUpdate, type TimelineOptions, type TimelineToken, type TimelineUpdate, type TransactionIO, type TransactionOptions, type TransactionToken, type TransactionUpdate, type TransactionUpdateHandler, type Transactors, type UpdateHandler, type Write, atom, atomFamily, getState, redo, runTransaction, selector, selectorFamily, setLogLevel, setState, subscribe, subscribeToTimeline, subscribeToTransaction, timeline, transaction, undo, useLogger, type ƒn };
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Transactors, FamilyMetadata, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, SelectorFamily, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions } from 'atom.io';
|
|
2
2
|
import { Json } from 'atom.io/json';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type AtomKey<T> = string & {
|
|
5
|
+
__atomKey?: never;
|
|
6
|
+
__brand?: T;
|
|
7
|
+
};
|
|
8
|
+
type SelectorKey<T> = string & {
|
|
9
|
+
__selectorKey?: never;
|
|
10
|
+
__brand?: T;
|
|
11
|
+
};
|
|
12
|
+
type ReadonlySelectorKey<T> = string & {
|
|
13
|
+
__readonlySelectorKey?: never;
|
|
14
|
+
__brand?: T;
|
|
15
|
+
};
|
|
16
|
+
declare const isAtomKey: (key: string, store: Store) => key is AtomKey<unknown>;
|
|
17
|
+
declare const isSelectorKey: (key: string, store: Store) => key is SelectorKey<unknown>;
|
|
18
|
+
declare const isReadonlySelectorKey: (key: string, store: Store) => key is ReadonlySelectorKey<unknown>;
|
|
19
|
+
type StateKey<T> = AtomKey<T> | ReadonlySelectorKey<T> | SelectorKey<T>;
|
|
20
|
+
declare const isStateKey: (key: string, store: Store) => key is StateKey<unknown>;
|
|
21
|
+
|
|
22
|
+
declare const getSelectorDependencyKeys: (key: string, store: Store) => (AtomKey<unknown> | ReadonlySelectorKey<unknown> | SelectorKey<unknown>)[];
|
|
5
23
|
|
|
6
24
|
declare const registerSelector: (selectorKey: string, store?: Store) => Transactors;
|
|
7
25
|
|
|
@@ -39,8 +57,8 @@ type ReadonlySelector<T> = {
|
|
|
39
57
|
declare function createSelector<T>(options: SelectorOptions<T>, family?: FamilyMetadata, store?: Store): SelectorToken<T>;
|
|
40
58
|
declare function createSelector<T>(options: ReadonlySelectorOptions<T>, family?: FamilyMetadata, store?: Store): ReadonlySelectorToken<T>;
|
|
41
59
|
|
|
42
|
-
declare const traceSelectorAtoms: (selectorKey: string,
|
|
43
|
-
declare const traceAllSelectorAtoms: (selectorKey: string, store: Store) =>
|
|
60
|
+
declare const traceSelectorAtoms: (selectorKey: string, directDependencyKey: StateKey<unknown>, store: Store) => AtomKey<unknown>[];
|
|
61
|
+
declare const traceAllSelectorAtoms: (selectorKey: string, store: Store) => AtomKey<unknown>[];
|
|
44
62
|
|
|
45
63
|
declare const updateSelectorAtoms: (selectorKey: string, dependency: ReadonlySelectorToken<unknown> | StateToken<unknown>, store: Store) => void;
|
|
46
64
|
|
|
@@ -179,13 +197,13 @@ declare class Tracker<Mutable extends Transceiver<any>> {
|
|
|
179
197
|
private observeCore;
|
|
180
198
|
private updateCore;
|
|
181
199
|
mutableState: MutableAtomToken<Mutable, Json.Serializable>;
|
|
182
|
-
latestUpdateState: AtomToken<typeof this
|
|
200
|
+
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
183
201
|
constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store?: Store);
|
|
184
202
|
}
|
|
185
203
|
|
|
186
204
|
declare class FamilyTracker<Core extends Transceiver<any>, FamilyMemberKey extends Json.Serializable> {
|
|
187
205
|
private readonly Update;
|
|
188
|
-
readonly findLatestUpdateState: AtomFamily<typeof this
|
|
206
|
+
readonly findLatestUpdateState: AtomFamily<typeof this.Update | null, FamilyMemberKey>;
|
|
189
207
|
readonly findMutableState: AtomFamily<Core, FamilyMemberKey>;
|
|
190
208
|
constructor(findMutableState: AtomFamily<Core, FamilyMemberKey>, store?: Store);
|
|
191
209
|
}
|
|
@@ -283,8 +301,6 @@ declare const IMPLICIT: {
|
|
|
283
301
|
};
|
|
284
302
|
declare const clearStore: (store?: Store) => void;
|
|
285
303
|
|
|
286
|
-
declare function lookup(key: string, store: Store): AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>;
|
|
287
|
-
|
|
288
304
|
declare function withdraw<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
|
|
289
305
|
declare function withdraw<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
|
|
290
306
|
declare function withdraw<T>(token: StateToken<T>, store: Store): Atom<T> | Selector<T> | undefined;
|
|
@@ -357,4 +373,4 @@ declare const setState__INTERNAL: <T>(state: Atom<T> | Selector<T>, value: T | (
|
|
|
357
373
|
|
|
358
374
|
declare const subscribeToRootAtoms: <T>(state: ReadonlySelector<T> | Selector<T>, store: Store) => (() => void)[] | null;
|
|
359
375
|
|
|
360
|
-
export { Atom, FamilyTracker, Fated, Future, IMPLICIT, Loadable, Modify, MutableAtom, OperationProgress, ReadonlySelector, Selector, Signal, Store, StoreCore, Subject, TRANSACTION_PHASES, Timeline, TimelineAtomUpdate, TimelineSelectorUpdate, TimelineTransactionUpdate, Tracker, Transaction, TransactionIdle, TransactionPhase, TransactionStatus, TransactionUpdateInProgress, Transceiver, TransceiverMode, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, deleteAtom, deposit, evictCachedValue, getJsonToken, getState__INTERNAL, getUpdateToken, isAtomDefault, isAtomMutable, isAtomTokenMutable, isDone, isSelectorDefault,
|
|
376
|
+
export { type Atom, type AtomKey, FamilyTracker, type Fated, Future, IMPLICIT, type Loadable, type Modify, type MutableAtom, type OperationProgress, type ReadonlySelector, type ReadonlySelectorKey, type Selector, type SelectorKey, type Signal, type StateKey, Store, type StoreCore, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineSelectorUpdate, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionIdle, type TransactionPhase, type TransactionStatus, type TransactionUpdateInProgress, type Transceiver, type TransceiverMode, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, deleteAtom, deposit, evictCachedValue, getJsonToken, getSelectorDependencyKeys, getState__INTERNAL, getUpdateToken, isAtomDefault, isAtomKey, isAtomMutable, isAtomTokenMutable, isDone, isReadonlySelectorKey, isSelectorDefault, isSelectorKey, isStateKey, isTransceiver, isValueCached, markAtomAsDefault, markAtomAsNotDefault, markDone, openOperation, readCachedValue, redoTransactionUpdate, redo__INTERNAL, registerSelector, setState__INTERNAL, subscribeToRootAtoms, target, timeline__INTERNAL, traceAllSelectorAtoms, traceSelectorAtoms, transaction__INTERNAL, undoTransactionUpdate, undo__INTERNAL, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };
|
package/internal/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Transactors, FamilyMetadata, SelectorOptions, SelectorToken, ReadonlySelectorOptions, ReadonlySelectorToken, StateToken, ƒn, TransactionUpdate, TransactionOptions, TransactionToken, AtomToken, MutableAtomOptions, MutableAtomToken, MutableAtomFamilyOptions, MutableAtomFamily, AtomFamily, StateUpdate, TimelineUpdate, TimelineOptions, TimelineToken, ReadonlySelectorFamily, SelectorFamily, Logger, AtomOptions, AtomFamilyOptions, ReadonlySelectorFamilyOptions, SelectorFamilyOptions } from 'atom.io';
|
|
2
2
|
import { Json } from 'atom.io/json';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type AtomKey<T> = string & {
|
|
5
|
+
__atomKey?: never;
|
|
6
|
+
__brand?: T;
|
|
7
|
+
};
|
|
8
|
+
type SelectorKey<T> = string & {
|
|
9
|
+
__selectorKey?: never;
|
|
10
|
+
__brand?: T;
|
|
11
|
+
};
|
|
12
|
+
type ReadonlySelectorKey<T> = string & {
|
|
13
|
+
__readonlySelectorKey?: never;
|
|
14
|
+
__brand?: T;
|
|
15
|
+
};
|
|
16
|
+
declare const isAtomKey: (key: string, store: Store) => key is AtomKey<unknown>;
|
|
17
|
+
declare const isSelectorKey: (key: string, store: Store) => key is SelectorKey<unknown>;
|
|
18
|
+
declare const isReadonlySelectorKey: (key: string, store: Store) => key is ReadonlySelectorKey<unknown>;
|
|
19
|
+
type StateKey<T> = AtomKey<T> | ReadonlySelectorKey<T> | SelectorKey<T>;
|
|
20
|
+
declare const isStateKey: (key: string, store: Store) => key is StateKey<unknown>;
|
|
21
|
+
|
|
22
|
+
declare const getSelectorDependencyKeys: (key: string, store: Store) => (AtomKey<unknown> | ReadonlySelectorKey<unknown> | SelectorKey<unknown>)[];
|
|
5
23
|
|
|
6
24
|
declare const registerSelector: (selectorKey: string, store?: Store) => Transactors;
|
|
7
25
|
|
|
@@ -39,8 +57,8 @@ type ReadonlySelector<T> = {
|
|
|
39
57
|
declare function createSelector<T>(options: SelectorOptions<T>, family?: FamilyMetadata, store?: Store): SelectorToken<T>;
|
|
40
58
|
declare function createSelector<T>(options: ReadonlySelectorOptions<T>, family?: FamilyMetadata, store?: Store): ReadonlySelectorToken<T>;
|
|
41
59
|
|
|
42
|
-
declare const traceSelectorAtoms: (selectorKey: string,
|
|
43
|
-
declare const traceAllSelectorAtoms: (selectorKey: string, store: Store) =>
|
|
60
|
+
declare const traceSelectorAtoms: (selectorKey: string, directDependencyKey: StateKey<unknown>, store: Store) => AtomKey<unknown>[];
|
|
61
|
+
declare const traceAllSelectorAtoms: (selectorKey: string, store: Store) => AtomKey<unknown>[];
|
|
44
62
|
|
|
45
63
|
declare const updateSelectorAtoms: (selectorKey: string, dependency: ReadonlySelectorToken<unknown> | StateToken<unknown>, store: Store) => void;
|
|
46
64
|
|
|
@@ -179,13 +197,13 @@ declare class Tracker<Mutable extends Transceiver<any>> {
|
|
|
179
197
|
private observeCore;
|
|
180
198
|
private updateCore;
|
|
181
199
|
mutableState: MutableAtomToken<Mutable, Json.Serializable>;
|
|
182
|
-
latestUpdateState: AtomToken<typeof this
|
|
200
|
+
latestUpdateState: AtomToken<typeof this.Update | null>;
|
|
183
201
|
constructor(mutableState: MutableAtomToken<Mutable, Json.Serializable>, store?: Store);
|
|
184
202
|
}
|
|
185
203
|
|
|
186
204
|
declare class FamilyTracker<Core extends Transceiver<any>, FamilyMemberKey extends Json.Serializable> {
|
|
187
205
|
private readonly Update;
|
|
188
|
-
readonly findLatestUpdateState: AtomFamily<typeof this
|
|
206
|
+
readonly findLatestUpdateState: AtomFamily<typeof this.Update | null, FamilyMemberKey>;
|
|
189
207
|
readonly findMutableState: AtomFamily<Core, FamilyMemberKey>;
|
|
190
208
|
constructor(findMutableState: AtomFamily<Core, FamilyMemberKey>, store?: Store);
|
|
191
209
|
}
|
|
@@ -283,8 +301,6 @@ declare const IMPLICIT: {
|
|
|
283
301
|
};
|
|
284
302
|
declare const clearStore: (store?: Store) => void;
|
|
285
303
|
|
|
286
|
-
declare function lookup(key: string, store: Store): AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>;
|
|
287
|
-
|
|
288
304
|
declare function withdraw<T>(token: AtomToken<T>, store: Store): Atom<T> | undefined;
|
|
289
305
|
declare function withdraw<T>(token: SelectorToken<T>, store: Store): Selector<T> | undefined;
|
|
290
306
|
declare function withdraw<T>(token: StateToken<T>, store: Store): Atom<T> | Selector<T> | undefined;
|
|
@@ -357,4 +373,4 @@ declare const setState__INTERNAL: <T>(state: Atom<T> | Selector<T>, value: T | (
|
|
|
357
373
|
|
|
358
374
|
declare const subscribeToRootAtoms: <T>(state: ReadonlySelector<T> | Selector<T>, store: Store) => (() => void)[] | null;
|
|
359
375
|
|
|
360
|
-
export { Atom, FamilyTracker, Fated, Future, IMPLICIT, Loadable, Modify, MutableAtom, OperationProgress, ReadonlySelector, Selector, Signal, Store, StoreCore, Subject, TRANSACTION_PHASES, Timeline, TimelineAtomUpdate, TimelineSelectorUpdate, TimelineTransactionUpdate, Tracker, Transaction, TransactionIdle, TransactionPhase, TransactionStatus, TransactionUpdateInProgress, Transceiver, TransceiverMode, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, deleteAtom, deposit, evictCachedValue, getJsonToken, getState__INTERNAL, getUpdateToken, isAtomDefault, isAtomMutable, isAtomTokenMutable, isDone, isSelectorDefault,
|
|
376
|
+
export { type Atom, type AtomKey, FamilyTracker, type Fated, Future, IMPLICIT, type Loadable, type Modify, type MutableAtom, type OperationProgress, type ReadonlySelector, type ReadonlySelectorKey, type Selector, type SelectorKey, type Signal, type StateKey, Store, type StoreCore, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineSelectorUpdate, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionIdle, type TransactionPhase, type TransactionStatus, type TransactionUpdateInProgress, type Transceiver, type TransceiverMode, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, deleteAtom, deposit, evictCachedValue, getJsonToken, getSelectorDependencyKeys, getState__INTERNAL, getUpdateToken, isAtomDefault, isAtomKey, isAtomMutable, isAtomTokenMutable, isDone, isReadonlySelectorKey, isSelectorDefault, isSelectorKey, isStateKey, isTransceiver, isValueCached, markAtomAsDefault, markAtomAsNotDefault, markDone, openOperation, readCachedValue, redoTransactionUpdate, redo__INTERNAL, registerSelector, setState__INTERNAL, subscribeToRootAtoms, target, timeline__INTERNAL, traceAllSelectorAtoms, traceSelectorAtoms, transaction__INTERNAL, undoTransactionUpdate, undo__INTERNAL, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };
|