atom.io 0.27.1 → 0.27.3

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.
Files changed (45) hide show
  1. package/data/dist/index.d.ts +12 -12
  2. package/data/dist/index.js +20 -14
  3. package/data/src/dict.ts +4 -4
  4. package/data/src/join.ts +23 -18
  5. package/data/src/struct-family.ts +2 -2
  6. package/dist/chunk-ETCFHO7J.js +3087 -0
  7. package/dist/index.d.ts +4 -31
  8. package/eslint-plugin/dist/index.js +8 -0
  9. package/eslint-plugin/src/walk.ts +8 -0
  10. package/internal/dist/index.d.ts +52 -19
  11. package/internal/dist/index.js +2 -3044
  12. package/internal/src/families/create-atom-family.ts +6 -5
  13. package/internal/src/families/create-readonly-selector-family.ts +38 -29
  14. package/internal/src/families/create-regular-atom-family.ts +40 -31
  15. package/internal/src/families/create-selector-family.ts +6 -5
  16. package/internal/src/families/create-writable-selector-family.ts +39 -30
  17. package/internal/src/families/throw-in-case-of-conflicting-family.ts +18 -0
  18. package/internal/src/index.ts +76 -2
  19. package/internal/src/ingest-updates/ingest-creation-disposal.ts +0 -1
  20. package/internal/src/ingest-updates/ingest-selector-update.ts +1 -1
  21. package/internal/src/molecule/dispose-molecule.ts +0 -1
  22. package/internal/src/molecule/grow-molecule-in-store.ts +27 -17
  23. package/internal/src/mutable/create-mutable-atom-family.ts +41 -32
  24. package/internal/src/mutable/get-json-family.ts +2 -1
  25. package/internal/src/mutable/get-update-family.ts +23 -0
  26. package/internal/src/mutable/index.ts +1 -0
  27. package/internal/src/mutable/tracker-family.ts +5 -3
  28. package/internal/src/not-found-error.ts +2 -35
  29. package/internal/src/pretty-print.ts +37 -0
  30. package/internal/src/store/store.ts +10 -4
  31. package/internal/src/store/withdraw.ts +8 -8
  32. package/introspection/dist/index.js +3 -3
  33. package/introspection/src/attach-timeline-family.ts +1 -1
  34. package/introspection/src/attach-transaction-logs.ts +2 -2
  35. package/json/dist/index.d.ts +2 -2
  36. package/json/dist/index.js +16 -12
  37. package/json/src/select-json-family.ts +21 -18
  38. package/package.json +4 -4
  39. package/realtime-server/dist/index.d.ts +1 -1
  40. package/src/atom.ts +2 -32
  41. package/src/get-state.ts +2 -2
  42. package/src/index.ts +1 -10
  43. package/src/selector.ts +1 -26
  44. package/src/set-state.ts +2 -2
  45. package/src/silo.ts +7 -5
@@ -1,8 +1,9 @@
1
1
  import type {
2
- MutableAtomFamily,
2
+ AtomFamilyToken,
3
3
  MutableAtomFamilyOptions,
4
- RegularAtomFamily,
4
+ MutableAtomFamilyToken,
5
5
  RegularAtomFamilyOptions,
6
+ RegularAtomFamilyToken,
6
7
  } from "atom.io"
7
8
  import type { Canonical, Json } from "atom.io/json"
8
9
 
@@ -17,17 +18,17 @@ export function createAtomFamily<
17
18
  >(
18
19
  options: MutableAtomFamilyOptions<T, J, K>,
19
20
  store: Store,
20
- ): MutableAtomFamily<T, J, K>
21
+ ): MutableAtomFamilyToken<T, J, K>
21
22
  export function createAtomFamily<T, K extends Canonical>(
22
23
  options: RegularAtomFamilyOptions<T, K>,
23
24
  store: Store,
24
- ): RegularAtomFamily<T, K>
25
+ ): RegularAtomFamilyToken<T, K>
25
26
  export function createAtomFamily<T, K extends Canonical>(
26
27
  options:
27
28
  | MutableAtomFamilyOptions<any, any, any>
28
29
  | RegularAtomFamilyOptions<T, K>,
29
30
  store: Store,
30
- ): MutableAtomFamily<any, any, any> | RegularAtomFamily<T, K> {
31
+ ): AtomFamilyToken<any, any> {
31
32
  const isMutable = `mutable` in options
32
33
 
33
34
  if (isMutable) {
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  FamilyMetadata,
3
- ReadonlySelectorFamily,
4
3
  ReadonlySelectorFamilyOptions,
4
+ ReadonlySelectorFamilyToken,
5
5
  ReadonlySelectorToken,
6
6
  StateCreation,
7
7
  StateDisposal,
@@ -9,46 +9,55 @@ import type {
9
9
  import type { Canonical } from "atom.io/json"
10
10
  import { stringifyJson } from "atom.io/json"
11
11
 
12
+ import type { ReadonlySelectorFamily } from ".."
12
13
  import { newest } from "../lineage"
13
14
  import { createReadonlySelector } from "../selector"
14
15
  import type { Store } from "../store"
15
16
  import { Subject } from "../subject"
17
+ import { throwInCaseOfConflictingFamily } from "./throw-in-case-of-conflicting-family"
16
18
 
17
19
  export function createReadonlySelectorFamily<T, K extends Canonical>(
18
20
  options: ReadonlySelectorFamilyOptions<T, K>,
19
21
  store: Store,
20
- ): ReadonlySelectorFamily<T, K> {
22
+ internalRoles?: string[],
23
+ ): ReadonlySelectorFamilyToken<T, K> {
24
+ const familyToken = {
25
+ key: options.key,
26
+ type: `readonly_selector_family`,
27
+ } as const satisfies ReadonlySelectorFamilyToken<T, K>
28
+
29
+ throwInCaseOfConflictingFamily(familyToken, store)
30
+
21
31
  const subject = new Subject<
22
32
  | StateCreation<ReadonlySelectorToken<T>>
23
33
  | StateDisposal<ReadonlySelectorToken<T>>
24
34
  >()
25
35
 
26
- const readonlySelectorFamily = Object.assign(
27
- (key: K): ReadonlySelectorToken<T> => {
28
- const subKey = stringifyJson(key)
29
- const family: FamilyMetadata = { key: options.key, subKey }
30
- const fullKey = `${options.key}(${subKey})`
31
- const target = newest(store)
32
-
33
- const token = createReadonlySelector(
34
- {
35
- key: fullKey,
36
- get: options.get(key),
37
- },
38
- family,
39
- target,
40
- )
41
-
42
- subject.next({ type: `state_creation`, token })
43
- return token
44
- },
45
- {
46
- key: options.key,
47
- type: `readonly_selector_family`,
48
- subject,
49
- install: (s: Store) => createReadonlySelectorFamily(options, s),
50
- } as const,
51
- ) satisfies ReadonlySelectorFamily<T, K>
36
+ const familyFunction = (key: K): ReadonlySelectorToken<T> => {
37
+ const subKey = stringifyJson(key)
38
+ const family: FamilyMetadata = { key: options.key, subKey }
39
+ const fullKey = `${options.key}(${subKey})`
40
+ const target = newest(store)
41
+
42
+ const token = createReadonlySelector(
43
+ {
44
+ key: fullKey,
45
+ get: options.get(key),
46
+ },
47
+ family,
48
+ target,
49
+ )
50
+
51
+ subject.next({ type: `state_creation`, token })
52
+ return token
53
+ }
54
+
55
+ const readonlySelectorFamily = Object.assign(familyFunction, familyToken, {
56
+ subject,
57
+ install: (s: Store) => createReadonlySelectorFamily(options, s),
58
+ internalRoles,
59
+ }) satisfies ReadonlySelectorFamily<T, K>
60
+
52
61
  store.families.set(options.key, readonlySelectorFamily)
53
- return readonlySelectorFamily
62
+ return familyToken
54
63
  }
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  FamilyMetadata,
3
- RegularAtomFamily,
4
3
  RegularAtomFamilyOptions,
4
+ RegularAtomFamilyToken,
5
5
  RegularAtomOptions,
6
6
  RegularAtomToken,
7
7
  StateCreation,
@@ -10,47 +10,56 @@ import type {
10
10
  import type { Canonical } from "atom.io/json"
11
11
  import { stringifyJson } from "atom.io/json"
12
12
 
13
+ import type { RegularAtomFamily } from ".."
13
14
  import { createRegularAtom } from "../atom"
14
15
  import { newest } from "../lineage"
15
16
  import type { Store } from "../store"
16
17
  import { Subject } from "../subject"
18
+ import { throwInCaseOfConflictingFamily } from "./throw-in-case-of-conflicting-family"
17
19
 
18
20
  export function createRegularAtomFamily<T, K extends Canonical>(
19
21
  options: RegularAtomFamilyOptions<T, K>,
20
22
  store: Store,
21
- ): RegularAtomFamily<T, K> {
23
+ internalRoles?: string[],
24
+ ): RegularAtomFamilyToken<T, K> {
25
+ const familyToken = {
26
+ key: options.key,
27
+ type: `atom_family`,
28
+ } as const satisfies RegularAtomFamilyToken<T, K>
29
+
30
+ throwInCaseOfConflictingFamily(familyToken, store)
31
+
22
32
  const subject = new Subject<
23
33
  StateCreation<RegularAtomToken<T>> | StateDisposal<RegularAtomToken<T>>
24
34
  >()
25
35
 
26
- const atomFamily: RegularAtomFamily<T, K> = Object.assign(
27
- (key: K): RegularAtomToken<any> => {
28
- const subKey = stringifyJson(key)
29
- const family: FamilyMetadata = { key: options.key, subKey }
30
- const fullKey = `${options.key}(${subKey})`
31
- const target = newest(store)
32
-
33
- const def = options.default
34
- const individualOptions: RegularAtomOptions<T> = {
35
- key: fullKey,
36
- default: def instanceof Function ? def(key) : def,
37
- }
38
- if (options.effects) {
39
- individualOptions.effects = options.effects(key)
40
- }
41
-
42
- const token = createRegularAtom(individualOptions, family, target)
43
-
44
- subject.next({ type: `state_creation`, token })
45
- return token
46
- },
47
- {
48
- key: options.key,
49
- type: `atom_family`,
50
- subject,
51
- install: (s: Store) => createRegularAtomFamily(options, s),
52
- } as const,
53
- ) satisfies RegularAtomFamily<T, K>
36
+ const familyFunction = (key: K): RegularAtomToken<any> => {
37
+ const subKey = stringifyJson(key)
38
+ const family: FamilyMetadata = { key: options.key, subKey }
39
+ const fullKey = `${options.key}(${subKey})`
40
+ const target = newest(store)
41
+
42
+ const def = options.default
43
+ const individualOptions: RegularAtomOptions<T> = {
44
+ key: fullKey,
45
+ default: def instanceof Function ? def(key) : def,
46
+ }
47
+ if (options.effects) {
48
+ individualOptions.effects = options.effects(key)
49
+ }
50
+
51
+ const token = createRegularAtom(individualOptions, family, target)
52
+
53
+ subject.next({ type: `state_creation`, token })
54
+ return token
55
+ }
56
+
57
+ const atomFamily = Object.assign(familyFunction, familyToken, {
58
+ subject,
59
+ install: (s: Store) => createRegularAtomFamily(options, s),
60
+ internalRoles,
61
+ }) satisfies RegularAtomFamily<T, K>
62
+
54
63
  store.families.set(options.key, atomFamily)
55
- return atomFamily
64
+ return familyToken
56
65
  }
@@ -1,8 +1,9 @@
1
1
  import type {
2
- ReadonlySelectorFamily,
3
2
  ReadonlySelectorFamilyOptions,
4
- WritableSelectorFamily,
3
+ ReadonlySelectorFamilyToken,
4
+ SelectorFamilyToken,
5
5
  WritableSelectorFamilyOptions,
6
+ WritableSelectorFamilyToken,
6
7
  } from "atom.io"
7
8
  import type { Canonical } from "atom.io/json"
8
9
 
@@ -13,17 +14,17 @@ import { createWritableSelectorFamily } from "./create-writable-selector-family"
13
14
  export function createSelectorFamily<T, K extends Canonical>(
14
15
  options: WritableSelectorFamilyOptions<T, K>,
15
16
  store: Store,
16
- ): WritableSelectorFamily<T, K>
17
+ ): WritableSelectorFamilyToken<T, K>
17
18
  export function createSelectorFamily<T, K extends Canonical>(
18
19
  options: ReadonlySelectorFamilyOptions<T, K>,
19
20
  store: Store,
20
- ): ReadonlySelectorFamily<T, K>
21
+ ): ReadonlySelectorFamilyToken<T, K>
21
22
  export function createSelectorFamily<T, K extends Canonical>(
22
23
  options:
23
24
  | ReadonlySelectorFamilyOptions<T, K>
24
25
  | WritableSelectorFamilyOptions<T, K>,
25
26
  store: Store,
26
- ): ReadonlySelectorFamily<T, K> | WritableSelectorFamily<T, K> {
27
+ ): SelectorFamilyToken<T, K> {
27
28
  const isWritable = `set` in options
28
29
 
29
30
  if (isWritable) {
@@ -2,54 +2,63 @@ import type {
2
2
  FamilyMetadata,
3
3
  StateCreation,
4
4
  StateDisposal,
5
- WritableSelectorFamily,
6
5
  WritableSelectorFamilyOptions,
6
+ WritableSelectorFamilyToken,
7
7
  WritableSelectorToken,
8
8
  } from "atom.io"
9
9
  import type { Canonical } from "atom.io/json"
10
10
  import { stringifyJson } from "atom.io/json"
11
11
 
12
+ import type { WritableSelectorFamily } from ".."
12
13
  import { newest } from "../lineage"
13
14
  import { createWritableSelector } from "../selector"
14
15
  import type { Store } from "../store"
15
16
  import { Subject } from "../subject"
17
+ import { throwInCaseOfConflictingFamily } from "./throw-in-case-of-conflicting-family"
16
18
 
17
19
  export function createWritableSelectorFamily<T, K extends Canonical>(
18
20
  options: WritableSelectorFamilyOptions<T, K>,
19
21
  store: Store,
20
- ): WritableSelectorFamily<T, K> {
22
+ internalRoles?: string[],
23
+ ): WritableSelectorFamilyToken<T, K> {
24
+ const familyToken = {
25
+ key: options.key,
26
+ type: `selector_family`,
27
+ } as const satisfies WritableSelectorFamilyToken<T, K>
28
+
29
+ throwInCaseOfConflictingFamily(familyToken, store)
30
+
21
31
  const subject = new Subject<
22
32
  | StateCreation<WritableSelectorToken<T>>
23
33
  | StateDisposal<WritableSelectorToken<T>>
24
34
  >()
25
35
 
26
- const selectorFamily = Object.assign(
27
- (key: K): WritableSelectorToken<T> => {
28
- const subKey = stringifyJson(key)
29
- const family: FamilyMetadata = { key: options.key, subKey }
30
- const fullKey = `${options.key}(${subKey})`
31
- const target = newest(store)
32
-
33
- const token = createWritableSelector(
34
- {
35
- key: fullKey,
36
- get: options.get(key),
37
- set: options.set(key),
38
- },
39
- family,
40
- target,
41
- )
42
-
43
- subject.next({ type: `state_creation`, token })
44
- return token
45
- },
46
- {
47
- key: options.key,
48
- type: `selector_family`,
49
- subject,
50
- install: (s: Store) => createWritableSelectorFamily(options, s),
51
- } as const,
52
- ) satisfies WritableSelectorFamily<T, K>
36
+ const familyFunction = (key: K): WritableSelectorToken<T> => {
37
+ const subKey = stringifyJson(key)
38
+ const family: FamilyMetadata = { key: options.key, subKey }
39
+ const fullKey = `${options.key}(${subKey})`
40
+ const target = newest(store)
41
+
42
+ const token = createWritableSelector(
43
+ {
44
+ key: fullKey,
45
+ get: options.get(key),
46
+ set: options.set(key),
47
+ },
48
+ family,
49
+ target,
50
+ )
51
+
52
+ subject.next({ type: `state_creation`, token })
53
+ return token
54
+ }
55
+
56
+ const selectorFamily = Object.assign(familyFunction, familyToken, {
57
+ subject,
58
+ install: (s: Store) => createWritableSelectorFamily(options, s),
59
+ internalRoles,
60
+ }) satisfies WritableSelectorFamily<T, K>
61
+
53
62
  store.families.set(options.key, selectorFamily)
54
- return selectorFamily
63
+ return familyToken
55
64
  }
@@ -0,0 +1,18 @@
1
+ import type { AtomFamilyToken, SelectorFamilyToken } from "atom.io"
2
+
3
+ import { prettyPrintTokenType } from "../pretty-print"
4
+ import type { Store } from "../store"
5
+
6
+ export function throwInCaseOfConflictingFamily(
7
+ family: AtomFamilyToken<any, any> | SelectorFamilyToken<any, any>,
8
+ store: Store,
9
+ ): void {
10
+ const existingFamily = store.families.get(family.key)
11
+ if (existingFamily) {
12
+ throw new Error(
13
+ `Tried to create ${family.type === `atom_family` ? `an` : `a`} ${prettyPrintTokenType(family)} with key "${family.key}", but "${family.key}" already exists in store "${store.config.name}" as ${existingFamily.type === `atom_family` ? `an` : `a`} ${prettyPrintTokenType(
14
+ existingFamily,
15
+ )}`,
16
+ )
17
+ }
18
+ }
@@ -1,5 +1,17 @@
1
- import type { FamilyMetadata } from "atom.io"
2
- import type { Json, JsonInterface } from "atom.io/json"
1
+ import type {
2
+ AtomToken,
3
+ FamilyMetadata,
4
+ MutableAtomFamilyToken,
5
+ MutableAtomToken,
6
+ ReadonlySelectorToken,
7
+ RegularAtomFamilyToken,
8
+ RegularAtomToken,
9
+ StateCreation,
10
+ StateDisposal,
11
+ WritableSelectorFamilyToken,
12
+ WritableSelectorToken,
13
+ } from "atom.io"
14
+ import type { Canonical, Json, JsonInterface } from "atom.io/json"
3
15
 
4
16
  import type { Transceiver } from "./mutable"
5
17
  import type { Store } from "./store"
@@ -20,6 +32,7 @@ export * from "./molecule"
20
32
  export * from "./mutable"
21
33
  export * from "./not-found-error"
22
34
  export * from "./operation"
35
+ export * from "./pretty-print"
23
36
  export * from "./selector"
24
37
  export * from "./set-state"
25
38
  export * from "./store"
@@ -67,3 +80,64 @@ export type Selector<T> = ReadonlySelector<T> | WritableSelector<T>
67
80
 
68
81
  export type WritableState<T> = Atom<T> | WritableSelector<T>
69
82
  export type ReadableState<T> = Atom<T> | Selector<T>
83
+
84
+ // biome-ignore format: intersection
85
+ export type RegularAtomFamily<T, K extends Canonical> =
86
+ & RegularAtomFamilyToken<T, K>
87
+ & {
88
+ (key: K): RegularAtomToken<T>
89
+ subject: Subject<StateCreation<AtomToken<T>> | StateDisposal<AtomToken<T>>>
90
+ install: (store: Store) => void
91
+ internalRoles: string[] | undefined
92
+ }
93
+
94
+ // biome-ignore format: intersection
95
+ export type MutableAtomFamily<
96
+ T extends Transceiver<any>,
97
+ J extends Json.Serializable,
98
+ K extends Canonical,
99
+ > =
100
+ & JsonInterface<T, J>
101
+ & MutableAtomFamilyToken<T, J, K>
102
+ & {
103
+ (key: K): MutableAtomToken<T, J>
104
+ subject: Subject<StateCreation<MutableAtomToken<T, J>> | StateDisposal<MutableAtomToken<T, J>>>
105
+ install: (store: Store) => void
106
+ internalRoles: string[] | undefined
107
+ }
108
+
109
+ export type AtomFamily<T, K extends Canonical = Canonical> =
110
+ | MutableAtomFamily<T extends Transceiver<any> ? T : never, any, K>
111
+ | RegularAtomFamily<T, K>
112
+
113
+ // biome-ignore format: intersection
114
+ export type WritableSelectorFamily<T, K extends Canonical> =
115
+ & WritableSelectorFamilyToken<T, K>
116
+ & {
117
+ (key: K): WritableSelectorToken<T>
118
+ subject: Subject<StateCreation<WritableSelectorToken<T>> | StateDisposal<WritableSelectorToken<T>>>
119
+ install: (store: Store) => void
120
+ internalRoles : string[] | undefined
121
+ }
122
+
123
+ // biome-ignore format: intersection
124
+ export type ReadonlySelectorFamily<T, K extends Canonical> =
125
+ & ((key: K) => ReadonlySelectorToken<T>)
126
+ & {
127
+ key: string
128
+ type: `readonly_selector_family`
129
+ subject: Subject<StateCreation<ReadonlySelectorToken<T>> | StateDisposal<ReadonlySelectorToken<T>>>
130
+ install: (store: Store) => void
131
+ internalRoles : string[] | undefined
132
+ }
133
+
134
+ export type SelectorFamily<T, K extends Canonical> =
135
+ | ReadonlySelectorFamily<T, K>
136
+ | WritableSelectorFamily<T, K>
137
+
138
+ export type WritableFamily<T, K extends Canonical> =
139
+ | AtomFamily<T, K>
140
+ | WritableSelectorFamily<T, K>
141
+ export type ReadableFamily<T, K extends Canonical> =
142
+ | AtomFamily<T, K>
143
+ | SelectorFamily<T, K>
@@ -9,7 +9,6 @@ import { parseJson, stringifyJson } from "atom.io/json"
9
9
 
10
10
  import { disposeFromStore, initFamilyMemberInStore } from "../families"
11
11
  import { growMoleculeInStore, makeMoleculeInStore } from "../molecule"
12
- import { setIntoStore } from "../set-state"
13
12
  import { type Store, withdraw } from "../store"
14
13
 
15
14
  export function ingestCreationEvent(
@@ -10,7 +10,7 @@ export function ingestSelectorUpdate(
10
10
  const updates =
11
11
  applying === `newValue`
12
12
  ? selectorUpdate.atomUpdates
13
- : [...selectorUpdate.atomUpdates].reverse()
13
+ : selectorUpdate.atomUpdates.toReversed()
14
14
  for (const atomUpdate of updates) {
15
15
  ingestAtomUpdate(applying, atomUpdate, store)
16
16
  }
@@ -1,4 +1,3 @@
1
- import { stringifyJson } from "anvl/json"
2
1
  import type {
3
2
  MoleculeConstructor,
4
3
  MoleculeDisposal,
@@ -1,23 +1,33 @@
1
1
  import type {
2
- AtomFamily,
2
+ AtomFamilyToken,
3
3
  AtomToken,
4
- MutableAtomFamily,
4
+ MutableAtomFamilyToken,
5
5
  MutableAtomToken,
6
- ReadableFamily,
6
+ ReadableFamilyToken,
7
7
  ReadableToken,
8
- ReadonlySelectorFamily,
8
+ ReadonlySelectorFamilyToken,
9
9
  ReadonlySelectorToken,
10
- RegularAtomFamily,
10
+ RegularAtomFamilyToken,
11
11
  RegularAtomToken,
12
- SelectorFamily,
12
+ SelectorFamilyToken,
13
13
  SelectorToken,
14
- WritableFamily,
15
- WritableSelectorFamily,
14
+ WritableFamilyToken,
15
+ WritableSelectorFamilyToken,
16
16
  WritableSelectorToken,
17
17
  WritableToken,
18
18
  } from "atom.io"
19
19
  import type { Canonical, Json } from "atom.io/json"
20
20
 
21
+ import type {
22
+ AtomFamily,
23
+ MutableAtomFamily,
24
+ ReadableFamily,
25
+ ReadonlySelectorFamily,
26
+ RegularAtomFamily,
27
+ SelectorFamily,
28
+ WritableFamily,
29
+ WritableSelectorFamily,
30
+ } from ".."
21
31
  import { initFamilyMemberInStore } from "../families"
22
32
  import type { Transceiver } from "../mutable"
23
33
  import type { Store } from "../store"
@@ -30,47 +40,47 @@ export function growMoleculeInStore<
30
40
  K extends Canonical,
31
41
  >(
32
42
  molecule: Molecule<any>,
33
- family: MutableAtomFamily<T, J, K>,
43
+ family: MutableAtomFamilyToken<T, J, K>,
34
44
  store: Store,
35
45
  ): MutableAtomToken<T, J>
36
46
  export function growMoleculeInStore<T, K extends Canonical>(
37
47
  molecule: Molecule<any>,
38
- family: RegularAtomFamily<T, K>,
48
+ family: RegularAtomFamilyToken<T, K>,
39
49
  store: Store,
40
50
  ): RegularAtomToken<T>
41
51
  export function growMoleculeInStore<T, K extends Canonical>(
42
52
  molecule: Molecule<any>,
43
- family: AtomFamily<T, K>,
53
+ family: AtomFamilyToken<T, K>,
44
54
  store: Store,
45
55
  ): AtomToken<T>
46
56
  export function growMoleculeInStore<T, K extends Canonical>(
47
57
  molecule: Molecule<any>,
48
- family: WritableSelectorFamily<T, K>,
58
+ family: WritableSelectorFamilyToken<T, K>,
49
59
  store: Store,
50
60
  ): WritableSelectorToken<T>
51
61
  export function growMoleculeInStore<T, K extends Canonical>(
52
62
  molecule: Molecule<any>,
53
- family: ReadonlySelectorFamily<T, K>,
63
+ family: ReadonlySelectorFamilyToken<T, K>,
54
64
  store: Store,
55
65
  ): ReadonlySelectorToken<T>
56
66
  export function growMoleculeInStore<T, K extends Canonical>(
57
67
  molecule: Molecule<any>,
58
- family: SelectorFamily<T, K>,
68
+ family: SelectorFamilyToken<T, K>,
59
69
  store: Store,
60
70
  ): SelectorToken<T>
61
71
  export function growMoleculeInStore<T, K extends Canonical>(
62
72
  molecule: Molecule<any>,
63
- family: WritableFamily<T, K>,
73
+ family: WritableFamilyToken<T, K>,
64
74
  store: Store,
65
75
  ): WritableToken<T>
66
76
  export function growMoleculeInStore<T, K extends Canonical>(
67
77
  molecule: Molecule<any>,
68
- family: ReadableFamily<T, K>,
78
+ family: ReadableFamilyToken<T, K>,
69
79
  store: Store,
70
80
  ): ReadableToken<T>
71
81
  export function growMoleculeInStore(
72
82
  molecule: Molecule<any>,
73
- family: ReadableFamily<any, any>,
83
+ family: ReadableFamilyToken<any, any>,
74
84
  store: Store,
75
85
  ): ReadableToken<any> {
76
86
  const stateToken = initFamilyMemberInStore(family, molecule.key, store)