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,11 +1,11 @@
1
1
  import * as AtomIO from 'atom.io';
2
- import { ReadonlySelectorFamily, MutableAtomFamily, SetterToolkit, disposeState, ReadonlySelectorToken, MutableAtomFamilyToken } from 'atom.io';
2
+ import { ReadonlySelectorFamilyToken, MutableAtomFamilyToken, SetterToolkit, disposeState, ReadonlySelectorToken } from 'atom.io';
3
3
  import { Store, Molecule } from 'atom.io/internal';
4
4
  import { Canonical, stringified, Json } from 'atom.io/json';
5
5
  import { findState } from 'atom.io/ephemeral';
6
6
  import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
7
7
 
8
- declare function dict<State, Key extends Canonical>(findState: AtomIO.ReadonlySelectorFamilyToken<State, Key> | AtomIO.RegularAtomFamilyToken<State, Key> | AtomIO.WritableSelectorFamily<State, Key>, index: AtomIO.ReadonlySelectorToken<Key[]> | AtomIO.RegularAtomToken<Key[]> | AtomIO.WritableSelectorToken<Key[]>, store?: Store): AtomIO.ReadonlySelectorToken<{
8
+ declare function dict<State, Key extends Canonical>(family: AtomIO.ReadonlySelectorFamilyToken<State, Key> | AtomIO.RegularAtomFamilyToken<State, Key> | AtomIO.WritableSelectorFamilyToken<State, Key>, index: AtomIO.ReadonlySelectorToken<Key[]> | AtomIO.RegularAtomToken<Key[]> | AtomIO.WritableSelectorToken<Key[]>, store?: Store): AtomIO.ReadonlySelectorToken<{
9
9
  [K in stringified<Key>]: State;
10
10
  }>;
11
11
 
@@ -88,33 +88,33 @@ interface JoinOptions<ASide extends string, BSide extends string, Cardinality ex
88
88
  readonly cardinality: Cardinality;
89
89
  }
90
90
  type JoinStateFamilies<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json.Object | null> = Cardinality extends `1:1` ? (Content extends Json.Object ? {
91
- readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntryOf${Capitalize<BSide>}` : `${AB}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<[
91
+ readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntryOf${Capitalize<BSide>}` : `${AB}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
92
92
  string,
93
93
  Content
94
94
  ] | null, string>;
95
95
  } : {}) & {
96
- readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeyOf${Capitalize<BSide>}` : `${AB}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<string | null, string>;
96
+ readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeyOf${Capitalize<BSide>}` : `${AB}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<string | null, string>;
97
97
  } : Cardinality extends `1:n` ? (Content extends Json.Object ? {
98
- readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamily<[
98
+ readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<[
99
99
  string,
100
100
  Content
101
101
  ] | null, string>;
102
102
  } & {
103
- readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<[
103
+ readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
104
104
  string,
105
105
  Content
106
106
  ][], string>;
107
107
  } : {}) & {
108
- readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamily<string | null, string>;
108
+ readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<string | null, string>;
109
109
  } & {
110
- readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<string[], string>;
110
+ readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<string[], string>;
111
111
  } : Cardinality extends `n:n` ? (Content extends Json.Object ? {
112
- readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntriesOf${Capitalize<BSide>}` : `${AB}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<[
112
+ readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntriesOf${Capitalize<BSide>}` : `${AB}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
113
113
  string,
114
114
  Content
115
115
  ][], string>;
116
116
  } : {}) & {
117
- readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeysOf${Capitalize<BSide>}` : `${AB}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<string[], string>;
117
+ readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeysOf${Capitalize<BSide>}` : `${AB}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<string[], string>;
118
118
  } : never;
119
119
  declare class Join<const ASide extends string, const BSide extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json.Object | null = null> {
120
120
  private options;
@@ -125,7 +125,7 @@ declare class Join<const ASide extends string, const BSide extends string, const
125
125
  relations: Junction<ASide, BSide, Content>;
126
126
  states: JoinStateFamilies<ASide, BSide, Cardinality, Content>;
127
127
  core: {
128
- findRelatedKeysState: MutableAtomFamily<SetRTX<string>, SetRTXJson<string>, string>;
128
+ findRelatedKeysState: MutableAtomFamilyToken<SetRTX<string>, SetRTXJson<string>, string>;
129
129
  };
130
130
  transact(toolkit: SetterToolkit & {
131
131
  dispose: typeof disposeState;
@@ -203,7 +203,7 @@ declare function structFamily<Struct extends object, Key extends string>(options
203
203
  default: Struct;
204
204
  }): [
205
205
  {
206
- [K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<K & string>}State`]: AtomIO.RegularAtomFamily<Struct[K], string>;
206
+ [K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<K & string>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>;
207
207
  },
208
208
  AtomIO.ReadonlySelectorFamilyToken<Struct, string>
209
209
  ];
@@ -1,17 +1,17 @@
1
1
  import { Junction } from '../../dist/chunk-IBTHB2PI.js';
2
2
  import '../../dist/chunk-XWL6SNVU.js';
3
- import { createStandaloneSelector, findInStore, IMPLICIT, getFromStore, setIntoStore, seekInStore, getJsonToken, disposeFromStore, withdraw, growMoleculeInStore, NotFoundError, initFamilyMemberInStore, createMutableAtomFamily, createRegularAtomFamily, createMoleculeFamily, newest, makeMoleculeInStore, isChildStore, createRegularAtom, createSelectorFamily, getJsonFamily } from 'atom.io/internal';
3
+ import { createStandaloneSelector, findInStore, IMPLICIT, getFromStore, setIntoStore, seekInStore, getJsonToken, disposeFromStore, withdraw, growMoleculeInStore, NotFoundError, initFamilyMemberInStore, createMutableAtomFamily, createRegularAtomFamily, createMoleculeFamily, newest, makeMoleculeInStore, isChildStore, createRegularAtom, createSelectorFamily, createReadonlySelectorFamily, getJsonFamily } from 'atom.io/internal';
4
4
  import { stringifyJson } from 'atom.io/json';
5
5
  import { SetRTX } from 'atom.io/transceivers/set-rtx';
6
6
 
7
- function dict(findState, index, store = IMPLICIT.STORE) {
7
+ function dict(family, index, store = IMPLICIT.STORE) {
8
8
  return createStandaloneSelector(
9
9
  {
10
- key: `${findState.key}Dict`,
10
+ key: `${family.key}Dict`,
11
11
  get: ({ get }) => {
12
12
  const keys = get(index);
13
13
  return keys.reduce((acc, key) => {
14
- acc[key] = get(findInStore(findState, key, store));
14
+ acc[key] = get(findInStore(family, key, store));
15
15
  return acc;
16
16
  }, {});
17
17
  }
@@ -97,7 +97,8 @@ var Join = class _Join {
97
97
  fromJson: (json) => SetRTX.fromJSON(json),
98
98
  toJson: (set) => set.toJSON()
99
99
  },
100
- store
100
+ store,
101
+ [`join`, `relations`]
101
102
  );
102
103
  this.core = { findRelatedKeysState: relatedKeysAtoms };
103
104
  const getRelatedKeys = ({ get }, key) => get(this.retrieve(relatedKeysAtoms, key));
@@ -231,7 +232,8 @@ var Join = class _Join {
231
232
  key: `${options.key}/content`,
232
233
  default: defaultContent
233
234
  },
234
- store
235
+ store,
236
+ [`join`, `content`]
235
237
  );
236
238
  const joinToken = {
237
239
  key: options.key,
@@ -306,7 +308,7 @@ var Join = class _Join {
306
308
  return compositeKey;
307
309
  }
308
310
  });
309
- const createSingleKeyStateFamily = () => createSelectorFamily(
311
+ const createSingleKeyStateFamily = () => createReadonlySelectorFamily(
310
312
  {
311
313
  key: `${options.key}/singleRelatedKey`,
312
314
  get: (key) => ({ get }) => {
@@ -318,10 +320,11 @@ var Join = class _Join {
318
320
  return null;
319
321
  }
320
322
  },
321
- store
323
+ store,
324
+ [`join`, `keys`]
322
325
  );
323
326
  const getMultipleKeyStateFamily = () => {
324
- return createSelectorFamily(
327
+ return createReadonlySelectorFamily(
325
328
  {
326
329
  key: `${options.key}/multipleRelatedKeys`,
327
330
  get: (key) => ({ get }) => {
@@ -331,10 +334,11 @@ var Join = class _Join {
331
334
  return json.members;
332
335
  }
333
336
  },
334
- store
337
+ store,
338
+ [`join`, `keys`]
335
339
  );
336
340
  };
337
- const createSingleEntryStateFamily = () => createSelectorFamily(
341
+ const createSingleEntryStateFamily = () => createReadonlySelectorFamily(
338
342
  {
339
343
  key: `${options.key}/singleRelatedEntry`,
340
344
  get: (key) => ({ get }) => {
@@ -349,9 +353,10 @@ var Join = class _Join {
349
353
  return null;
350
354
  }
351
355
  },
352
- store
356
+ store,
357
+ [`join`, `entries`]
353
358
  );
354
- const getMultipleEntryStateFamily = () => createSelectorFamily(
359
+ const getMultipleEntryStateFamily = () => createReadonlySelectorFamily(
355
360
  {
356
361
  key: `${options.key}/multipleRelatedEntries`,
357
362
  get: (key) => ({ get }) => {
@@ -366,7 +371,8 @@ var Join = class _Join {
366
371
  });
367
372
  }
368
373
  },
369
- store
374
+ store,
375
+ [`join`, `entries`]
370
376
  );
371
377
  switch (options.cardinality) {
372
378
  case `1:1`: {
package/data/src/dict.ts CHANGED
@@ -8,10 +8,10 @@ import {
8
8
  import type { Canonical, stringified } from "atom.io/json"
9
9
 
10
10
  export function dict<State, Key extends Canonical>(
11
- findState:
11
+ family:
12
12
  | AtomIO.ReadonlySelectorFamilyToken<State, Key>
13
13
  | AtomIO.RegularAtomFamilyToken<State, Key>
14
- | AtomIO.WritableSelectorFamily<State, Key>,
14
+ | AtomIO.WritableSelectorFamilyToken<State, Key>,
15
15
  index:
16
16
  | AtomIO.ReadonlySelectorToken<Key[]>
17
17
  | AtomIO.RegularAtomToken<Key[]>
@@ -20,11 +20,11 @@ export function dict<State, Key extends Canonical>(
20
20
  ): AtomIO.ReadonlySelectorToken<{ [K in stringified<Key>]: State }> {
21
21
  return createStandaloneSelector(
22
22
  {
23
- key: `${findState.key}Dict`,
23
+ key: `${family.key}Dict`,
24
24
  get: ({ get }) => {
25
25
  const keys = get(index)
26
26
  return keys.reduce((acc, key) => {
27
- acc[key] = get(findInStore(findState, key, store))
27
+ acc[key] = get(findInStore(family, key, store))
28
28
  return acc
29
29
  }, {} as any)
30
30
  },
package/data/src/join.ts CHANGED
@@ -3,14 +3,13 @@ import type {
3
3
  disposeState,
4
4
  getState,
5
5
  MoleculeFamilyToken,
6
- MutableAtomFamily,
7
6
  MutableAtomFamilyToken,
8
7
  Read,
9
8
  ReadableFamilyToken,
10
9
  ReadableToken,
11
- ReadonlySelectorFamily,
10
+ ReadonlySelectorFamilyToken,
12
11
  ReadonlySelectorToken,
13
- RegularAtomFamily,
12
+ RegularAtomFamilyToken,
14
13
  setState,
15
14
  SetterToolkit,
16
15
  Write,
@@ -21,8 +20,8 @@ import type { Molecule, Store } from "atom.io/internal"
21
20
  import {
22
21
  createMoleculeFamily,
23
22
  createMutableAtomFamily,
23
+ createReadonlySelectorFamily,
24
24
  createRegularAtomFamily,
25
- createSelectorFamily,
26
25
  disposeFromStore,
27
26
  findInStore,
28
27
  getFromStore,
@@ -78,7 +77,7 @@ export type JoinStateFamilies<
78
77
  ? {
79
78
  readonly [AB in ASide | BSide as AB extends ASide
80
79
  ? `${AB}EntryOf${Capitalize<BSide>}`
81
- : `${AB}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<
80
+ : `${AB}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<
82
81
  [string, Content] | null,
83
82
  string
84
83
  >
@@ -86,7 +85,7 @@ export type JoinStateFamilies<
86
85
  : {}) & {
87
86
  readonly [AB in ASide | BSide as AB extends ASide
88
87
  ? `${AB}KeyOf${Capitalize<BSide>}`
89
- : `${AB}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<
88
+ : `${AB}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<
90
89
  string | null,
91
90
  string
92
91
  >
@@ -94,23 +93,23 @@ export type JoinStateFamilies<
94
93
  : Cardinality extends `1:n`
95
94
  ? (Content extends Json.Object
96
95
  ? {
97
- readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamily<
96
+ readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<
98
97
  [string, Content] | null,
99
98
  string
100
99
  >
101
100
  } & {
102
- readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<
101
+ readonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<
103
102
  [string, Content][],
104
103
  string
105
104
  >
106
105
  }
107
106
  : {}) & {
108
- readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamily<
107
+ readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<
109
108
  string | null,
110
109
  string
111
110
  >
112
111
  } & {
113
- readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<
112
+ readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<
114
113
  string[],
115
114
  string
116
115
  >
@@ -120,7 +119,7 @@ export type JoinStateFamilies<
120
119
  ? {
121
120
  readonly [AB in ASide | BSide as AB extends ASide
122
121
  ? `${AB}EntriesOf${Capitalize<BSide>}`
123
- : `${AB}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<
122
+ : `${AB}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<
124
123
  [string, Content][],
125
124
  string
126
125
  >
@@ -128,7 +127,7 @@ export type JoinStateFamilies<
128
127
  : {}) & {
129
128
  readonly [AB in ASide | BSide as AB extends ASide
130
129
  ? `${AB}KeysOf${Capitalize<BSide>}`
131
- : `${AB}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamily<
130
+ : `${AB}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<
132
131
  string[],
133
132
  string
134
133
  >
@@ -149,7 +148,7 @@ export class Join<
149
148
  public relations: Junction<ASide, BSide, Content>
150
149
  public states: JoinStateFamilies<ASide, BSide, Cardinality, Content>
151
150
  public core: {
152
- findRelatedKeysState: MutableAtomFamily<
151
+ findRelatedKeysState: MutableAtomFamilyToken<
153
152
  SetRTX<string>,
154
153
  SetRTXJson<string>,
155
154
  string
@@ -242,6 +241,7 @@ export class Join<
242
241
  toJson: (set) => set.toJSON(),
243
242
  },
244
243
  store,
244
+ [`join`, `relations`],
245
245
  )
246
246
  this.core = { findRelatedKeysState: relatedKeysAtoms }
247
247
  const getRelatedKeys: Read<(key: string) => SetRTX<string>> = (
@@ -388,7 +388,7 @@ export class Join<
388
388
  has: (a, b) => has(this.toolkit, a, b),
389
389
  }
390
390
  let externalStore: ExternalStoreConfiguration<Content>
391
- let contentAtoms: RegularAtomFamily<Content, string>
391
+ let contentAtoms: RegularAtomFamilyToken<Content, string>
392
392
  let contentMolecules: MoleculeFamilyToken<
393
393
  new (
394
394
  ..._: any[]
@@ -401,6 +401,7 @@ export class Join<
401
401
  default: defaultContent,
402
402
  },
403
403
  store,
404
+ [`join`, `content`],
404
405
  )
405
406
  const joinToken = {
406
407
  key: options.key,
@@ -488,7 +489,7 @@ export class Join<
488
489
  })
489
490
 
490
491
  const createSingleKeyStateFamily = () =>
491
- createSelectorFamily<string | null, string>(
492
+ createReadonlySelectorFamily<string | null, string>(
492
493
  {
493
494
  key: `${options.key}/singleRelatedKey`,
494
495
  get:
@@ -503,9 +504,10 @@ export class Join<
503
504
  },
504
505
  },
505
506
  store,
507
+ [`join`, `keys`],
506
508
  )
507
509
  const getMultipleKeyStateFamily = () => {
508
- return createSelectorFamily<string[], string>(
510
+ return createReadonlySelectorFamily<string[], string>(
509
511
  {
510
512
  key: `${options.key}/multipleRelatedKeys`,
511
513
  get:
@@ -518,10 +520,11 @@ export class Join<
518
520
  },
519
521
  },
520
522
  store,
523
+ [`join`, `keys`],
521
524
  )
522
525
  }
523
526
  const createSingleEntryStateFamily = () =>
524
- createSelectorFamily<[string, Content] | null, string>(
527
+ createReadonlySelectorFamily<[string, Content] | null, string>(
525
528
  {
526
529
  key: `${options.key}/singleRelatedEntry`,
527
530
  get:
@@ -539,9 +542,10 @@ export class Join<
539
542
  },
540
543
  },
541
544
  store,
545
+ [`join`, `entries`],
542
546
  )
543
547
  const getMultipleEntryStateFamily = () =>
544
- createSelectorFamily<[string, Content][], string>(
548
+ createReadonlySelectorFamily<[string, Content][], string>(
545
549
  {
546
550
  key: `${options.key}/multipleRelatedEntries`,
547
551
  get:
@@ -559,6 +563,7 @@ export class Join<
559
563
  },
560
564
  },
561
565
  store,
566
+ [`join`, `entries`],
562
567
  )
563
568
 
564
569
  switch (options.cardinality) {
@@ -19,14 +19,14 @@ export function structFamily<
19
19
  {
20
20
  [K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<
21
21
  K & string
22
- >}State`]: AtomIO.RegularAtomFamily<Struct[K], string>
22
+ >}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>
23
23
  },
24
24
  AtomIO.ReadonlySelectorFamilyToken<Struct, string>,
25
25
  ] {
26
26
  const atoms: {
27
27
  [K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<
28
28
  K & string
29
- >}State`]: AtomIO.RegularAtomFamily<Struct[K], string>
29
+ >}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>
30
30
  } = Object.keys(options.default).reduce((acc, subKey) => {
31
31
  const atomFamilyName = nameFamily(options.key, subKey)
32
32
  acc[atomFamilyName] = createRegularAtomFamily(