atom.io 0.38.2 → 0.39.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.
Files changed (91) hide show
  1. package/dist/data/index.js.map +1 -1
  2. package/dist/eslint-plugin/index.js +2 -1
  3. package/dist/eslint-plugin/index.js.map +1 -1
  4. package/dist/internal/index.d.ts +128 -85
  5. package/dist/internal/index.d.ts.map +1 -1
  6. package/dist/internal/index.js +429 -286
  7. package/dist/internal/index.js.map +1 -1
  8. package/dist/introspection/index.d.ts.map +1 -1
  9. package/dist/introspection/index.js.map +1 -1
  10. package/dist/json/index.d.ts.map +1 -1
  11. package/dist/json/index.js.map +1 -1
  12. package/dist/main/index.d.ts +45 -35
  13. package/dist/main/index.d.ts.map +1 -1
  14. package/dist/main/index.js.map +1 -1
  15. package/dist/react/index.d.ts.map +1 -1
  16. package/dist/react/index.js +43 -2
  17. package/dist/react/index.js.map +1 -1
  18. package/dist/react-devtools/index.d.ts.map +1 -1
  19. package/dist/react-devtools/index.js +4 -5
  20. package/dist/react-devtools/index.js.map +1 -1
  21. package/dist/realtime/index.d.ts.map +1 -1
  22. package/dist/realtime/index.js.map +1 -1
  23. package/dist/realtime-client/index.js +5 -5
  24. package/dist/realtime-client/index.js.map +1 -1
  25. package/dist/realtime-react/index.js.map +1 -1
  26. package/dist/realtime-server/index.d.ts.map +1 -1
  27. package/dist/realtime-server/index.js +4 -4
  28. package/dist/realtime-server/index.js.map +1 -1
  29. package/dist/realtime-testing/index.d.ts.map +1 -1
  30. package/dist/realtime-testing/index.js.map +1 -1
  31. package/dist/transceivers/set-rtx/index.d.ts.map +1 -1
  32. package/dist/transceivers/set-rtx/index.js.map +1 -1
  33. package/dist/web/index.js.map +1 -1
  34. package/package.json +10 -11
  35. package/src/internal/atom/create-regular-atom.ts +2 -6
  36. package/src/internal/caching.ts +2 -4
  37. package/src/internal/{ingest-updates → events}/ingest-atom-update.ts +4 -5
  38. package/src/internal/{ingest-updates → events}/ingest-creation-disposal.ts +37 -37
  39. package/src/internal/{ingest-updates → events}/ingest-selector-update.ts +5 -5
  40. package/src/internal/events/ingest-transaction-update.ts +45 -0
  41. package/src/internal/families/create-readonly-held-selector-family.ts +1 -1
  42. package/src/internal/families/create-readonly-pure-selector-family.ts +1 -1
  43. package/src/internal/families/create-regular-atom-family.ts +4 -3
  44. package/src/internal/families/create-writable-held-selector-family.ts +1 -1
  45. package/src/internal/families/create-writable-pure-selector-family.ts +1 -1
  46. package/src/internal/families/find-in-store.ts +2 -2
  47. package/src/internal/families/get-family-of-token.ts +1 -0
  48. package/src/internal/families/index.ts +0 -1
  49. package/src/internal/families/mint-in-store.ts +30 -64
  50. package/src/internal/get-state/get-from-store.ts +2 -3
  51. package/src/internal/get-state/read-or-compute-value.ts +6 -15
  52. package/src/internal/get-state/reduce-reference.ts +52 -11
  53. package/src/internal/index.ts +2 -2
  54. package/src/internal/is-fn.ts +9 -0
  55. package/src/internal/junction.ts +177 -133
  56. package/src/internal/mutable/create-mutable-atom-family.ts +1 -1
  57. package/src/internal/overlays/index.ts +3 -0
  58. package/src/internal/overlays/map-overlay.ts +86 -0
  59. package/src/internal/{lazy-map.ts → overlays/relations-overlay.ts} +6 -6
  60. package/src/internal/overlays/set-overlay.ts +55 -0
  61. package/src/internal/selector/create-readonly-held-selector.ts +8 -11
  62. package/src/internal/selector/create-readonly-pure-selector.ts +8 -10
  63. package/src/internal/selector/create-writable-held-selector.ts +6 -6
  64. package/src/internal/selector/create-writable-pure-selector.ts +2 -2
  65. package/src/internal/selector/register-selector.ts +3 -4
  66. package/src/internal/set-state/become.ts +11 -6
  67. package/src/internal/set-state/dispatch-state-update.ts +47 -12
  68. package/src/internal/set-state/operate-on-store.ts +10 -8
  69. package/src/internal/set-state/reset-atom-or-selector.ts +7 -7
  70. package/src/internal/set-state/set-atom-or-selector.ts +3 -2
  71. package/src/internal/set-state/set-atom.ts +5 -4
  72. package/src/internal/set-state/set-selector.ts +9 -8
  73. package/src/internal/store/withdraw.ts +4 -4
  74. package/src/internal/timeline/time-travel.ts +11 -11
  75. package/src/internal/transaction/apply-transaction.ts +5 -5
  76. package/src/internal/transaction/build-transaction.ts +17 -26
  77. package/src/internal/transaction/create-transaction.ts +1 -1
  78. package/src/internal/transaction/is-root-store.ts +2 -2
  79. package/src/main/events.ts +14 -3
  80. package/src/main/logger.ts +43 -32
  81. package/src/react-devtools/json-editor/editors-by-type/array-editor.tsx +1 -1
  82. package/src/react-devtools/json-editor/editors-by-type/object-editor.tsx +2 -3
  83. package/src/react-devtools/json-editor/editors-by-type/utilities/array-elements.ts +1 -1
  84. package/src/react-devtools/json-editor/editors-by-type/utilities/object-properties.ts +1 -1
  85. package/src/realtime-client/continuity/register-and-attempt-confirmed-update.ts +5 -5
  86. package/src/realtime-server/continuity/subscribe-to-continuity-perpectives.ts +4 -4
  87. package/dist/use-o-DXPncKmZ.js +0 -47
  88. package/dist/use-o-DXPncKmZ.js.map +0 -1
  89. package/src/internal/families/init-family-member.ts +0 -33
  90. package/src/internal/ingest-updates/ingest-transaction-update.ts +0 -47
  91. /package/src/internal/{ingest-updates → events}/index.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["atoms: {\n\t\t[K in keyof Struct as `${Key}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomToken<Struct[K]>\n\t}","atoms: {\n\t\t[K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>\n\t}","findStructState: AtomIO.ReadonlyPureSelectorFamilyToken<Struct, string>"],"sources":["../../src/data/dict.ts","../../src/data/struct.ts","../../src/data/struct-family.ts"],"sourcesContent":["import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tcreateStandaloneSelector,\n\tfindInStore,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Canonical, stringified } from \"atom.io/json\"\n\nexport function dict<State, Key extends Canonical>(\n\tfamily:\n\t\t| AtomIO.ReadonlyPureSelectorFamilyToken<State, Key>\n\t\t| AtomIO.RegularAtomFamilyToken<State, Key>\n\t\t| AtomIO.WritablePureSelectorFamilyToken<State, Key>,\n\tindex:\n\t\t| AtomIO.ReadonlyPureSelectorToken<Key[]>\n\t\t| AtomIO.RegularAtomToken<Key[]>\n\t\t| AtomIO.WritablePureSelectorToken<Key[]>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.ReadonlyPureSelectorToken<{ [K in stringified<Key>]: State }> {\n\treturn createStandaloneSelector(store, {\n\t\tkey: `${family.key}Dict`,\n\t\tget: ({ get }) => {\n\t\t\tconst keys = get(index)\n\t\t\treturn keys.reduce((acc, key) => {\n\t\t\t\tacc[key] = get(findInStore(store, family, key))\n\t\t\t\treturn acc\n\t\t\t}, {} as any)\n\t\t},\n\t})\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tcapitalize,\n\tcreateRegularAtom,\n\tcreateStandaloneSelector,\n\tIMPLICIT,\n} from \"atom.io/internal\"\n\nexport function struct<\n\tStruct extends { [key: string]: unknown },\n\tKey extends string,\n>(\n\toptions: {\n\t\tkey: Key\n\t\tdefault: Struct\n\t},\n\tstore: Store = IMPLICIT.STORE,\n): [\n\t{\n\t\t[K in keyof Struct as `${Key}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomToken<Struct[K]>\n\t},\n\tAtomIO.ReadonlyPureSelectorToken<Struct>,\n] {\n\tconst atoms: {\n\t\t[K in keyof Struct as `${Key}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomToken<Struct[K]>\n\t} = Object.keys(options.default).reduce((acc, key) => {\n\t\tconst atomName = options.key + capitalize(key) + `State`\n\t\tacc[atomName] = createRegularAtom(\n\t\t\tstore,\n\t\t\t{\n\t\t\t\tkey: `${options.key}.${key}`,\n\t\t\t\tdefault: options.default[key],\n\t\t\t},\n\t\t\tundefined,\n\t\t)\n\t\treturn acc\n\t}, {} as any)\n\tconst structState = createStandaloneSelector(store, {\n\t\tkey: options.key,\n\t\tget: ({ get }) => {\n\t\t\treturn Object.keys(options.default).reduce((acc, key) => {\n\t\t\t\t// @ts-expect-error finicky\n\t\t\t\tacc[key] = get(atoms[options.key + capitalize(key) + `State`])\n\t\t\t\treturn acc\n\t\t\t}, {} as any)\n\t\t},\n\t})\n\treturn [atoms, structState]\n}\n","import type * as AtomIO from \"atom.io\"\nimport {\n\tcapitalize,\n\tcreateRegularAtomFamily,\n\tcreateSelectorFamily,\n\tIMPLICIT,\n} from \"atom.io/internal\"\n\nconst nameFamily = (topKey: string, subKey: string) =>\n\t`find` + capitalize(topKey) + capitalize(subKey) + `State`\n\nexport function structFamily<\n\tStruct extends object,\n\tKey extends string,\n>(options: {\n\tkey: Key\n\tdefault: Struct\n}): [\n\t{\n\t\t[K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>\n\t},\n\tAtomIO.ReadonlyPureSelectorFamilyToken<Struct, string>,\n] {\n\tconst atoms: {\n\t\t[K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>\n\t} = Object.keys(options.default).reduce((acc, subKey) => {\n\t\tconst atomFamilyName = nameFamily(options.key, subKey)\n\t\tacc[atomFamilyName] = createRegularAtomFamily(IMPLICIT.STORE, {\n\t\t\tkey: `${options.key}.${subKey}`,\n\t\t\tdefault: (options.default as any)[subKey],\n\t\t})\n\t\treturn acc\n\t}, {} as any)\n\tconst findStructState: AtomIO.ReadonlyPureSelectorFamilyToken<Struct, string> =\n\t\tcreateSelectorFamily(IMPLICIT.STORE, {\n\t\t\tkey: options.key,\n\t\t\tget:\n\t\t\t\t(id) =>\n\t\t\t\t({ find, get }) => {\n\t\t\t\t\treturn Object.keys(options.default).reduce((acc, subKey) => {\n\t\t\t\t\t\tacc[subKey] = get(\n\t\t\t\t\t\t\tfind((atoms as any)[nameFamily(options.key, subKey)], id),\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {} as any)\n\t\t\t\t},\n\t\t})\n\treturn [atoms, findStructState]\n}\n"],"mappings":";;;AASA,SAAgB,KACf,QAIA,OAIA,QAAe,SAAS,OAC+C;AACvE,QAAO,yBAAyB,OAAO;EACtC,KAAK,GAAG,OAAO,IAAI;EACnB,MAAM,EAAE,KAAK,KAAK;GACjB,MAAM,OAAO,IAAI;AACjB,UAAO,KAAK,QAAQ,KAAK,QAAQ;AAChC,QAAI,OAAO,IAAI,YAAY,OAAO,QAAQ;AAC1C,WAAO;GACP,GAAE,EAAE;EACL;EACD;AACD;;;;ACrBD,SAAgB,OAIf,SAIA,QAAe,SAAS,OAQvB;CACD,MAAMA,QAIF,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,QAAQ;EACrD,MAAM,WAAW,QAAQ,MAAM,WAAW,OAAO;AACjD,MAAI,YAAY,kBACf,OACA;GACC,KAAK,GAAG,QAAQ,IAAI,GAAG;GACvB,SAAS,QAAQ,QAAQ;GACzB,EACD;AAED,SAAO;CACP,GAAE,EAAE;CACL,MAAM,cAAc,yBAAyB,OAAO;EACnD,KAAK,QAAQ;EACb,MAAM,EAAE,KAAK,KAAK;AACjB,UAAO,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,QAAQ;AAExD,QAAI,OAAO,IAAI,MAAM,QAAQ,MAAM,WAAW,OAAO;AACrD,WAAO;GACP,GAAE,EAAE;EACL;EACD;AACD,QAAO,CAAC,OAAO,YAAY;AAC3B;;;;AC7CD,MAAM,cAAc,QAAgB,WACnC,SAAS,WAAW,UAAU,WAAW,UAAU;AAEpD,SAAgB,aAGd,SAUA;CACD,MAAMC,QAIF,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,WAAW;EACxD,MAAM,iBAAiB,WAAW,QAAQ,KAAK;AAC/C,MAAI,kBAAkB,wBAAwB,SAAS,OAAO;GAC7D,KAAK,GAAG,QAAQ,IAAI,GAAG;GACvB,SAAU,QAAQ,QAAgB;GAClC;AACD,SAAO;CACP,GAAE,EAAE;CACL,MAAMC,kBACL,qBAAqB,SAAS,OAAO;EACpC,KAAK,QAAQ;EACb,MACE,QACA,EAAE,MAAM,KAAK,KAAK;AAClB,UAAO,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,WAAW;AAC3D,QAAI,UAAU,IACb,KAAM,MAAc,WAAW,QAAQ,KAAK,UAAU;AAEvD,WAAO;GACP,GAAE,EAAE;EACL;EACF;AACF,QAAO,CAAC,OAAO,gBAAgB;AAC/B"}
1
+ {"version":3,"file":"index.js","names":["atoms: {\n\t\t[K in keyof Struct as `${Key}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomToken<Struct[K]>\n\t}","atoms: {\n\t\t[K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>\n\t}","findStructState: AtomIO.ReadonlyPureSelectorFamilyToken<Struct, string>"],"sources":["../../src/data/dict.ts","../../src/data/struct.ts","../../src/data/struct-family.ts"],"sourcesContent":["import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tcreateStandaloneSelector,\n\tfindInStore,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Canonical, stringified } from \"atom.io/json\"\n\nexport function dict<State, Key extends Canonical>(\n\tfamily:\n\t\t| AtomIO.ReadonlyPureSelectorFamilyToken<State, Key>\n\t\t| AtomIO.RegularAtomFamilyToken<State, Key>\n\t\t| AtomIO.WritablePureSelectorFamilyToken<State, Key>,\n\tindex:\n\t\t| AtomIO.ReadonlyPureSelectorToken<Key[]>\n\t\t| AtomIO.RegularAtomToken<Key[]>\n\t\t| AtomIO.WritablePureSelectorToken<Key[]>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.ReadonlyPureSelectorToken<{ [K in stringified<Key>]: State }> {\n\treturn createStandaloneSelector(store, {\n\t\tkey: `${family.key}Dict`,\n\t\tget: ({ get }) => {\n\t\t\tconst keys = get(index)\n\t\t\treturn keys.reduce((acc, key) => {\n\t\t\t\tacc[key] = get(findInStore(store, family, key))\n\t\t\t\treturn acc\n\t\t\t}, {} as any)\n\t\t},\n\t})\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tcapitalize,\n\tcreateRegularAtom,\n\tcreateStandaloneSelector,\n\tIMPLICIT,\n} from \"atom.io/internal\"\n\nexport function struct<\n\tStruct extends { [key: string]: unknown },\n\tKey extends string,\n>(\n\toptions: {\n\t\tkey: Key\n\t\tdefault: Struct\n\t},\n\tstore: Store = IMPLICIT.STORE,\n): [\n\t{\n\t\t[K in keyof Struct as `${Key}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomToken<Struct[K]>\n\t},\n\tAtomIO.ReadonlyPureSelectorToken<Struct>,\n] {\n\tconst atoms: {\n\t\t[K in keyof Struct as `${Key}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomToken<Struct[K]>\n\t} = Object.keys(options.default).reduce((acc, key) => {\n\t\tconst atomName = options.key + capitalize(key) + `State`\n\t\tacc[atomName] = createRegularAtom(\n\t\t\tstore,\n\t\t\t{\n\t\t\t\tkey: `${options.key}.${key}`,\n\t\t\t\tdefault: options.default[key],\n\t\t\t},\n\t\t\tundefined,\n\t\t)\n\t\treturn acc\n\t}, {} as any)\n\tconst structState = createStandaloneSelector(store, {\n\t\tkey: options.key,\n\t\tget: ({ get }) => {\n\t\t\treturn Object.keys(options.default).reduce((acc, key) => {\n\t\t\t\t// @ts-expect-error finicky\n\t\t\t\tacc[key] = get(atoms[options.key + capitalize(key) + `State`])\n\t\t\t\treturn acc\n\t\t\t}, {} as any)\n\t\t},\n\t})\n\treturn [atoms, structState]\n}\n","import type * as AtomIO from \"atom.io\"\nimport {\n\tcapitalize,\n\tcreateRegularAtomFamily,\n\tcreateSelectorFamily,\n\tIMPLICIT,\n} from \"atom.io/internal\"\n\nconst nameFamily = (topKey: string, subKey: string) =>\n\t`find` + capitalize(topKey) + capitalize(subKey) + `State`\n\nexport function structFamily<\n\tStruct extends object,\n\tKey extends string,\n>(options: {\n\tkey: Key\n\tdefault: Struct\n}): [\n\t{\n\t\t[K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>\n\t},\n\tAtomIO.ReadonlyPureSelectorFamilyToken<Struct, string>,\n] {\n\tconst atoms: {\n\t\t[K in keyof Struct as `find${Capitalize<Key & string>}${Capitalize<\n\t\t\tK & string\n\t\t>}State`]: AtomIO.RegularAtomFamilyToken<Struct[K], string>\n\t} = Object.keys(options.default).reduce((acc, subKey) => {\n\t\tconst atomFamilyName = nameFamily(options.key, subKey)\n\t\tacc[atomFamilyName] = createRegularAtomFamily(IMPLICIT.STORE, {\n\t\t\tkey: `${options.key}.${subKey}`,\n\t\t\tdefault: (options.default as any)[subKey],\n\t\t})\n\t\treturn acc\n\t}, {} as any)\n\tconst findStructState: AtomIO.ReadonlyPureSelectorFamilyToken<Struct, string> =\n\t\tcreateSelectorFamily(IMPLICIT.STORE, {\n\t\t\tkey: options.key,\n\t\t\tget:\n\t\t\t\t(id) =>\n\t\t\t\t({ find, get }) => {\n\t\t\t\t\treturn Object.keys(options.default).reduce((acc, subKey) => {\n\t\t\t\t\t\tacc[subKey] = get(\n\t\t\t\t\t\t\tfind((atoms as any)[nameFamily(options.key, subKey)], id),\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {} as any)\n\t\t\t\t},\n\t\t})\n\treturn [atoms, findStructState]\n}\n"],"mappings":";;;AASA,SAAgB,KACf,QAIA,OAIA,QAAe,SAAS,OAC+C;AACvE,QAAO,yBAAyB,OAAO;EACtC,KAAK,GAAG,OAAO,IAAI;EACnB,MAAM,EAAE,UAAU;GACjB,MAAM,OAAO,IAAI;AACjB,UAAO,KAAK,QAAQ,KAAK,QAAQ;AAChC,QAAI,OAAO,IAAI,YAAY,OAAO,QAAQ;AAC1C,WAAO;MACL;;;;;;;AClBN,SAAgB,OAIf,SAIA,QAAe,SAAS,OAQvB;CACD,MAAMA,QAIF,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,QAAQ;EACrD,MAAM,WAAW,QAAQ,MAAM,WAAW,OAAO;AACjD,MAAI,YAAY,kBACf,OACA;GACC,KAAK,GAAG,QAAQ,IAAI,GAAG;GACvB,SAAS,QAAQ,QAAQ;KAE1B;AAED,SAAO;IACL;CACH,MAAM,cAAc,yBAAyB,OAAO;EACnD,KAAK,QAAQ;EACb,MAAM,EAAE,UAAU;AACjB,UAAO,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,QAAQ;AAExD,QAAI,OAAO,IAAI,MAAM,QAAQ,MAAM,WAAW,OAAO;AACrD,WAAO;MACL;;;AAGL,QAAO,CAAC,OAAO;;;;;AC5ChB,MAAM,cAAc,QAAgB,WACnC,SAAS,WAAW,UAAU,WAAW,UAAU;AAEpD,SAAgB,aAGd,SAUA;CACD,MAAMC,QAIF,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,WAAW;EACxD,MAAM,iBAAiB,WAAW,QAAQ,KAAK;AAC/C,MAAI,kBAAkB,wBAAwB,SAAS,OAAO;GAC7D,KAAK,GAAG,QAAQ,IAAI,GAAG;GACvB,SAAU,QAAQ,QAAgB;;AAEnC,SAAO;IACL;CACH,MAAMC,kBACL,qBAAqB,SAAS,OAAO;EACpC,KAAK,QAAQ;EACb,MACE,QACA,EAAE,MAAM,UAAU;AAClB,UAAO,OAAO,KAAK,QAAQ,SAAS,QAAQ,KAAK,WAAW;AAC3D,QAAI,UAAU,IACb,KAAM,MAAc,WAAW,QAAQ,KAAK,UAAU;AAEvD,WAAO;MACL;;;AAGP,QAAO,CAAC,OAAO"}
@@ -51,7 +51,8 @@ __export(rules_exports, { explicitStateTypes: () => explicitStateTypes });
51
51
  //#endregion
52
52
  //#region src/eslint-plugin/index.ts
53
53
  const plugin = { rules: { "explicit-state-types": explicitStateTypes } };
54
+ var eslint_plugin_default = plugin;
54
55
 
55
56
  //#endregion
56
- export { rules_exports as Rules, plugin as default };
57
+ export { rules_exports as Rules, eslint_plugin_default as default };
57
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["explicitStateTypes: ESLintUtils.RuleModule<\n\t`noTypeArgument`,\n\t[],\n\tunknown,\n\tESLintUtils.RuleListener\n>","plugin: ESLint.Plugin"],"sources":["../../src/eslint-plugin/rules/explicit-state-types.ts","../../src/eslint-plugin/rules/index.ts","../../src/eslint-plugin/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/switch-exhaustiveness-check */\nimport { ESLintUtils } from \"@typescript-eslint/utils\"\n\nconst createRule = ESLintUtils.RuleCreator(\n\t(name) => `https://atom.io.fyi/docs/eslint-plugin#${name}`,\n)\n\nconst STATE_FUNCTIONS = [\n\t`atom`,\n\t`atomFamily`,\n\t`mutableAtom`,\n\t`mutableAtomFamily`,\n\t`selector`,\n\t`selectorFamily`,\n]\n\nexport const explicitStateTypes: ESLintUtils.RuleModule<\n\t`noTypeArgument`,\n\t[],\n\tunknown,\n\tESLintUtils.RuleListener\n> = createRule({\n\tname: `explicit-state-types`,\n\tmeta: {\n\t\ttype: `problem`,\n\t\tdocs: {\n\t\t\tdescription: `State declarations must have generic type arguments directly passed to them`,\n\t\t},\n\t\tmessages: {\n\t\t\tnoTypeArgument: `State declarations must have generic type arguments directly passed to them.`,\n\t\t},\n\t\tschema: [], // no options\n\t},\n\tdefaultOptions: [],\n\tcreate(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tconst { callee } = node\n\t\t\t\tswitch (callee.type) {\n\t\t\t\t\tcase `Identifier`: {\n\t\t\t\t\t\tif (STATE_FUNCTIONS.includes(callee.name)) {\n\t\t\t\t\t\t\tif (!node.typeArguments) {\n\t\t\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tmessageId: `noTypeArgument`,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase `MemberExpression`: {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcallee.property.type === `Identifier` &&\n\t\t\t\t\t\t\tSTATE_FUNCTIONS.includes(callee.property.name)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (!node.typeArguments) {\n\t\t\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tmessageId: `noTypeArgument`,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t},\n})\n","export * from \"./explicit-state-types\"\n","import type { ESLint } from \"eslint\"\n\nimport * as Rules from \"./rules\"\n\nexport { Rules }\n\nconst plugin: ESLint.Plugin = {\n\trules: {\n\t\t\"explicit-state-types\": Rules.explicitStateTypes as any,\n\t},\n} satisfies ESLint.Plugin\n\nexport default plugin\n"],"mappings":";;;;AAGA,MAAM,aAAa,YAAY,aAC7B,SAAS,0CAA0C;AAGrD,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAaA,qBAKT,WAAW;CACd,MAAM;CACN,MAAM;EACL,MAAM;EACN,MAAM,EACL,aAAa,+EACb;EACD,UAAU,EACT,gBAAgB,gFAChB;EACD,QAAQ,EAAE;EACV;CACD,gBAAgB,EAAE;CAClB,OAAO,SAAS;AACf,SAAO,EACN,eAAe,MAAM;GACpB,MAAM,EAAE,QAAQ,GAAG;AACnB,WAAQ,OAAO,MAAf;IACC,KAAK;AACJ,SAAI,gBAAgB,SAAS,OAAO,OACnC;UAAI,CAAC,KAAK,cACT,SAAQ,OAAO;OACd;OACA,WAAW;OACX;KACD;AAEF;IAED,KAAK,mBACJ,KACC,OAAO,SAAS,SAAS,gBACzB,gBAAgB,SAAS,OAAO,SAAS,OAEzC;SAAI,CAAC,KAAK,cACT,SAAQ,OAAO;MACd;MACA,WAAW;MACX;IACD;GAGH;EACD,GACD;CACD;CACD;;;;;;;;;AE7DD,MAAMC,SAAwB,EAC7B,OAAO,EACN,4CACA,EACD"}
1
+ {"version":3,"file":"index.js","names":["explicitStateTypes: ESLintUtils.RuleModule<\n\t`noTypeArgument`,\n\t[],\n\tunknown,\n\tESLintUtils.RuleListener\n>","plugin: ESLint.Plugin"],"sources":["../../src/eslint-plugin/rules/explicit-state-types.ts","../../src/eslint-plugin/rules/index.ts","../../src/eslint-plugin/index.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/switch-exhaustiveness-check */\nimport { ESLintUtils } from \"@typescript-eslint/utils\"\n\nconst createRule = ESLintUtils.RuleCreator(\n\t(name) => `https://atom.io.fyi/docs/eslint-plugin#${name}`,\n)\n\nconst STATE_FUNCTIONS = [\n\t`atom`,\n\t`atomFamily`,\n\t`mutableAtom`,\n\t`mutableAtomFamily`,\n\t`selector`,\n\t`selectorFamily`,\n]\n\nexport const explicitStateTypes: ESLintUtils.RuleModule<\n\t`noTypeArgument`,\n\t[],\n\tunknown,\n\tESLintUtils.RuleListener\n> = createRule({\n\tname: `explicit-state-types`,\n\tmeta: {\n\t\ttype: `problem`,\n\t\tdocs: {\n\t\t\tdescription: `State declarations must have generic type arguments directly passed to them`,\n\t\t},\n\t\tmessages: {\n\t\t\tnoTypeArgument: `State declarations must have generic type arguments directly passed to them.`,\n\t\t},\n\t\tschema: [], // no options\n\t},\n\tdefaultOptions: [],\n\tcreate(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tconst { callee } = node\n\t\t\t\tswitch (callee.type) {\n\t\t\t\t\tcase `Identifier`: {\n\t\t\t\t\t\tif (STATE_FUNCTIONS.includes(callee.name)) {\n\t\t\t\t\t\t\tif (!node.typeArguments) {\n\t\t\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tmessageId: `noTypeArgument`,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase `MemberExpression`: {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcallee.property.type === `Identifier` &&\n\t\t\t\t\t\t\tSTATE_FUNCTIONS.includes(callee.property.name)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (!node.typeArguments) {\n\t\t\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t\t\tmessageId: `noTypeArgument`,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t},\n})\n","export * from \"./explicit-state-types\"\n","import type { ESLint } from \"eslint\"\n\nimport * as Rules from \"./rules\"\n\nexport { Rules }\n\nconst plugin: ESLint.Plugin = {\n\trules: {\n\t\t\"explicit-state-types\": Rules.explicitStateTypes as any,\n\t},\n} satisfies ESLint.Plugin\n\nexport default plugin\n"],"mappings":";;;;AAGA,MAAM,aAAa,YAAY,aAC7B,SAAS,0CAA0C;AAGrD,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;;AAGD,MAAaA,qBAKT,WAAW;CACd,MAAM;CACN,MAAM;EACL,MAAM;EACN,MAAM,EACL,aAAa;EAEd,UAAU,EACT,gBAAgB;EAEjB,QAAQ;;CAET,gBAAgB;CAChB,OAAO,SAAS;AACf,SAAO,EACN,eAAe,MAAM;GACpB,MAAM,EAAE,WAAW;AACnB,WAAQ,OAAO,MAAf;IACC,KAAK;AACJ,SAAI,gBAAgB,SAAS,OAAO,OACnC;UAAI,CAAC,KAAK,cACT,SAAQ,OAAO;OACd;OACA,WAAW;;;AAId;IAED,KAAK,mBACJ,KACC,OAAO,SAAS,SAAS,gBACzB,gBAAgB,SAAS,OAAO,SAAS,OAEzC;SAAI,CAAC,KAAK,cACT,SAAQ,OAAO;MACd;MACA,WAAW;;;;;;;;;;;;;;;AEpDpB,MAAMC,SAAwB,EAC7B,OAAO,EACN;AAIF,4BAAe"}
@@ -19,6 +19,52 @@ declare class CircularBuffer<T> {
19
19
  copy(): CircularBuffer<T>;
20
20
  }
21
21
  //#endregion
22
+ //#region src/internal/overlays/map-overlay.d.ts
23
+ declare class MapOverlay<K, V> extends Map<K, V> {
24
+ deleted: Set<K>;
25
+ changed: Set<K>;
26
+ protected readonly source: Map<K, V>;
27
+ constructor(source: Map<K, V>);
28
+ get(key: K): V | undefined;
29
+ set(key: K, value: V): this;
30
+ hasOwn(key: K): boolean;
31
+ has(key: K): boolean;
32
+ delete(key: K): boolean;
33
+ clear(): void;
34
+ [Symbol.iterator](): MapIterator<[K, V]>;
35
+ entries(): MapIterator<[K, V]>;
36
+ keys(): MapIterator<K>;
37
+ values(): MapIterator<V>;
38
+ forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void): void;
39
+ get size(): number;
40
+ }
41
+ //#endregion
42
+ //#region src/internal/overlays/relations-overlay.d.ts
43
+ declare class RelationsOverlay<K, V extends Set<any>> extends Map<K, V> {
44
+ deleted: Set<K>;
45
+ protected readonly source: Map<K, V>;
46
+ constructor(source: Map<K, V>);
47
+ get(key: K): V | undefined;
48
+ set(key: K, value: V): this;
49
+ has(key: K): boolean;
50
+ delete(key: K): boolean;
51
+ }
52
+ //#endregion
53
+ //#region src/internal/overlays/set-overlay.d.ts
54
+ declare class SetOverlay<T> extends Set<T> {
55
+ deleted: Set<T>;
56
+ source: Set<T>;
57
+ constructor(source: Set<T>);
58
+ add(value: T): this;
59
+ hasOwn(member: T): boolean;
60
+ has(key: T): boolean;
61
+ delete(key: T): boolean;
62
+ clear(): void;
63
+ [Symbol.iterator](): SetIterator<T>;
64
+ iterateOwn(): SetIterator<T>;
65
+ get size(): number;
66
+ }
67
+ //#endregion
22
68
  //#region src/internal/utility-types.d.ts
23
69
  type Fn = (...parameters: any[]) => any;
24
70
  type Flat<R extends { [K in PropertyKey]: any }> = { [K in keyof R]: R[K] };
@@ -27,14 +73,14 @@ type Each<E extends any[]> = { [P in Count<E[`length`]>]: E[P] };
27
73
  type Refinement<A, B extends A> = (a: A) => a is B;
28
74
  //#endregion
29
75
  //#region src/internal/junction.d.ts
30
- type JunctionEntriesBase<AType extends string, BType extends string, Content extends Json.Object | null> = {
31
- readonly relations: ([AType, BType[]] | [BType, AType[]])[];
76
+ type JunctionEntriesBase<A extends string, B extends string, Content extends Json.Object | null> = {
77
+ readonly relations: ([A, B[]] | [B, A[]])[];
32
78
  readonly contents: [string, Content][];
33
79
  };
34
- interface JunctionEntries<AType extends string, BType extends string, Content extends Json.Object | null> extends Json.Object, JunctionEntriesBase<AType, BType, Content> {}
35
- type JunctionSchemaBase<ASide extends string, BSide extends string> = {
80
+ interface JunctionEntries<A extends string, B extends string, Content extends Json.Object | null> extends Json.Object, JunctionEntriesBase<A, B, Content> {}
81
+ type JunctionSchemaBase<AName extends string, BName extends string> = {
36
82
  /** Description of the relationship between the two sides */
37
- readonly between: [a: ASide, b: BSide];
83
+ readonly between: [a: AName, b: BName];
38
84
  /** How many relations are allowed in each direction? */
39
85
  readonly cardinality: `1:1` | `1:n` | `n:n`;
40
86
  };
@@ -54,59 +100,66 @@ type ExternalStoreWithContentConfiguration<Content extends Json.Object> = {
54
100
  };
55
101
  type Empty<Obj extends object> = { [Key in keyof Obj]?: undefined };
56
102
  type ExternalStoreConfiguration<Content extends Json.Object | null> = Content extends Json.Object ? BaseExternalStoreConfiguration & ExternalStoreWithContentConfiguration<Content> : BaseExternalStoreConfiguration & Empty<ExternalStoreWithContentConfiguration<Json.Object>>;
57
- type JunctionAdvancedConfiguration<AType extends string, BType extends string, Content extends Json.Object | null> = {
103
+ type JunctionAdvancedConfiguration<AName extends string, A extends string, BName extends string, B extends string, Content extends Json.Object | null> = {
58
104
  warn?: (...args: any[]) => void;
59
105
  externalStore?: ExternalStoreConfiguration<Content>;
60
- isAType?: Refinement<string, AType>;
61
- isBType?: Refinement<string, BType>;
106
+ isAType?: Refinement<string, A>;
107
+ isBType?: Refinement<string, B>;
62
108
  isContent?: Refinement<unknown, Content>;
63
- makeContentKey?: (a: AType, b: BType) => string;
109
+ makeContentKey?: (a: A, b: B) => string;
110
+ source?: Junction<AName, A, BName, B, Content>;
64
111
  };
65
- type JunctionJSON<ASide extends string, AType extends string, BSide extends string, BType extends string, Content extends Json.Object | null> = JunctionEntries<AType, BType, Content> & JunctionSchema<ASide, BSide>;
66
- declare class Junction<const ASide extends string, const AType extends string, const BSide extends string, const BType extends string, const Content extends Json.Object | null = null> {
67
- readonly a: ASide;
68
- readonly b: BSide;
112
+ type JunctionJSON<AName extends string, A extends string, BName extends string, B extends string, Content extends Json.Object | null> = JunctionEntries<A, B, Content> & JunctionSchema<AName, BName>;
113
+ declare class Junction<const AName extends string, const A extends string, const BName extends string, const B extends string, const Content extends Json.Object | null = null> {
114
+ readonly a: AName;
115
+ readonly b: BName;
69
116
  readonly cardinality: `1:1` | `1:n` | `n:n`;
70
- readonly relations: Map<AType | BType, Set<AType> | Set<BType>>;
117
+ readonly relations: Map<A | B, Set<A> | Set<B>>;
71
118
  readonly contents: Map<string, Content>;
72
- isAType?: Refinement<string, AType> | null;
73
- isBType?: Refinement<string, BType> | null;
119
+ isAType?: Refinement<string, A> | null;
120
+ isBType?: Refinement<string, B> | null;
74
121
  isContent: Refinement<unknown, Content> | null;
75
- makeContentKey: (a: AType, b: BType) => string;
122
+ makeContentKey: (a: A, b: B) => string;
76
123
  warn?: (...args: any[]) => void;
77
- getRelatedKeys(key: AType): Set<BType> | undefined;
78
- getRelatedKeys(key: BType): Set<AType> | undefined;
79
- getRelatedKeys(key: AType | BType): Set<AType> | Set<BType> | undefined;
80
- protected addRelation(a: AType, b: BType): void;
81
- protected deleteRelation(a: AType, b: BType): void;
82
- protected replaceRelationsUnsafely(a: AType, bs: BType[]): void;
83
- protected replaceRelationsUnsafely(b: BType, as: AType[]): void;
84
- protected replaceRelationsSafely(a: AType, bs: BType[]): void;
85
- protected replaceRelationsSafely(b: BType, as: AType[]): void;
124
+ getRelatedKeys(key: A): Set<B> | undefined;
125
+ getRelatedKeys(key: B): Set<A> | undefined;
126
+ getRelatedKeys(key: A | B): Set<A> | Set<B> | undefined;
127
+ protected addRelation(a: A, b: B): void;
128
+ protected deleteRelation(a: A, b: B): void;
129
+ protected replaceRelationsUnsafely(a: A, bs: B[]): void;
130
+ protected replaceRelationsUnsafely(b: B, as: A[]): void;
131
+ protected replaceRelationsSafely(a: A, bs: B[]): void;
132
+ protected replaceRelationsSafely(b: B, as: A[]): void;
86
133
  protected getContentInternal(contentKey: string): Content | undefined;
87
134
  protected setContent(contentKey: string, content: Content): void;
88
135
  protected deleteContent(contentKey: string): void;
89
- constructor(data: JunctionSchema<ASide, BSide> & Partial<JunctionEntries<NoInfer<AType>, NoInfer<BType>, Content>>, config?: JunctionAdvancedConfiguration<AType, BType, Content>);
90
- toJSON(): JunctionJSON<ASide, AType, BSide, BType, Content>;
91
- set(a: AType, ...rest: Content extends null ? [b: BType] : [b: BType, content: Content]): this;
92
- set(relation: { [Key in ASide]: AType } & { [Key in BSide]: BType }, ...rest: Content extends null ? [] | [void?: undefined] : [content: Content]): this;
93
- delete(a: AType, b?: BType): this;
94
- delete(b: BType, a?: AType): this;
95
- delete(relation: { [Key in ASide]: AType } | { [Key in BSide]: BType } | ({ [Key in ASide]: AType } & { [Key in BSide]: BType }), b?: undefined): this;
96
- getRelatedKey(key: AType): BType | undefined;
97
- getRelatedKey(key: BType): AType | undefined;
98
- replaceRelations(a: AType, relations: Content extends null ? BType[] : Record<BType, Content>, config?: {
136
+ constructor(data: JunctionSchema<AName, BName> & Partial<JunctionEntries<NoInfer<A>, NoInfer<B>, Content>>, config?: JunctionAdvancedConfiguration<AName, A, BName, B, Content>);
137
+ toJSON(): JunctionJSON<AName, A, BName, B, Content>;
138
+ set(a: A, ...rest: Content extends null ? [b: B] : [b: B, content: Content]): this;
139
+ set(relation: { [Key in AName]: A } & { [Key in BName]: B }, ...rest: Content extends null ? [] | [void?: undefined] : [content: Content]): this;
140
+ delete(a: A, b?: B): this;
141
+ delete(b: B, a?: A): this;
142
+ delete(relation: { [Key in AName]: A } | { [Key in BName]: B } | ({ [Key in AName]: A } & { [Key in BName]: B }), b?: undefined): this;
143
+ getRelatedKey(key: A): B | undefined;
144
+ getRelatedKey(key: B): A | undefined;
145
+ replaceRelations(a: A, relations: Content extends null ? B[] : Record<B, Content>, config?: {
99
146
  reckless: boolean;
100
147
  }): this;
101
- replaceRelations(b: BType, relations: Content extends null ? AType[] : Record<AType, Content>, config?: {
148
+ replaceRelations(b: B, relations: Content extends null ? A[] : Record<A, Content>, config?: {
102
149
  reckless: boolean;
103
150
  }): this;
104
- getContent(a: AType, b: BType): Content | undefined;
105
- getRelationEntries(input: Record<ASide, AType>): [BType, Content][];
106
- getRelationEntries(input: Record<BSide, BType>): [AType, Content][];
107
- has(a: AType, b?: BType): boolean;
108
- has(b: BType, a?: AType): boolean;
151
+ getContent(a: A, b: B): Content | undefined;
152
+ getRelationEntries(input: Record<AName, A>): [B, Content][];
153
+ getRelationEntries(input: Record<BName, B>): [A, Content][];
154
+ has(a: A, b?: B): boolean;
155
+ has(b: B, a?: A): boolean;
156
+ overlay(): JunctionOverlay<AName, A, BName, B, Content>;
157
+ incorporate(overlay: JunctionOverlay<AName, A, BName, B, Content>): void;
109
158
  }
159
+ type JunctionOverlay<AName extends string, A extends string, BName extends string, B extends string, Content extends Json.Object | null = null> = Junction<AName, A, BName, B, Content> & {
160
+ relations: MapOverlay<A | B, Set<A> | Set<B>>;
161
+ contents: MapOverlay<string, Content>;
162
+ };
110
163
  //#endregion
111
164
  //#region src/internal/transaction/abort-transaction.d.ts
112
165
  declare const abortTransaction: (store: Store) => void;
@@ -115,23 +168,11 @@ declare const abortTransaction: (store: Store) => void;
115
168
  declare function actUponStore<F extends Fn>(store: Store, token: TransactionToken<F>, id: string): (...parameters: Parameters<F>) => ReturnType<F>;
116
169
  //#endregion
117
170
  //#region src/internal/transaction/apply-transaction.d.ts
118
- declare const applyTransaction: <F extends Fn>(output: ReturnType<F>, store: Store) => void;
171
+ declare function applyTransaction<F extends Fn>(store: Store, output: ReturnType<F>): void;
119
172
  //#endregion
120
173
  //#region src/internal/transaction/assign-transaction-to-continuity.d.ts
121
174
  declare function assignTransactionToContinuity(store: Store, continuityKey: string, transactionKey: string): void;
122
175
  //#endregion
123
- //#region src/internal/lazy-map.d.ts
124
- declare class LazyMap<K, V> extends Map<K, V> {
125
- deleted: Set<K>;
126
- protected readonly source: Map<K, V>;
127
- constructor(source: Map<K, V>);
128
- get(key: K): V | undefined;
129
- set(key: K, value: V): this;
130
- hasOwn(key: K): boolean;
131
- has(key: K): boolean;
132
- delete(key: K): boolean;
133
- }
134
- //#endregion
135
176
  //#region src/internal/transaction/is-root-store.d.ts
136
177
  interface RootStore extends Store {
137
178
  transactionMeta: TransactionEpoch;
@@ -142,7 +183,7 @@ interface ChildStore extends Store {
142
183
  transactionMeta: TransactionProgress<Fn>;
143
184
  parent: ChildStore | RootStore;
144
185
  child: ChildStore | null;
145
- valueMap: LazyMap<string, any>;
186
+ valueMap: MapOverlay<string, any>;
146
187
  }
147
188
  declare function isRootStore(store: Store): store is RootStore;
148
189
  declare function isChildStore(store: Store): store is ChildStore;
@@ -418,8 +459,8 @@ declare function withdraw<T, K extends Canonical>(store: Store, token: WritableS
418
459
  declare function withdraw<T, K extends Canonical>(store: Store, token: HeldSelectorFamilyToken<T, K>): HeldSelectorFamily<T, K>;
419
460
  declare function withdraw<T, K extends Canonical>(store: Store, token: PureSelectorFamilyToken<T, K>): PureSelectorFamily<T, K>;
420
461
  declare function withdraw<T, K extends Canonical>(store: Store, token: SelectorFamilyToken<T, K>): SelectorFamily<T, K>;
421
- declare function withdraw<T, K extends Canonical>(store: Store, token: ReadableFamilyToken<T, K>): ReadableFamily<T, K>;
422
462
  declare function withdraw<T, K extends Canonical>(store: Store, token: WritableFamilyToken<T, K>): WritableFamily<T, K>;
463
+ declare function withdraw<T, K extends Canonical>(store: Store, token: ReadableFamilyToken<T, K>): ReadableFamily<T, K>;
423
464
  declare function withdraw<T extends Fn>(store: Store, token: TransactionToken<T>): Transaction<T extends Fn ? T : never>;
424
465
  declare function withdraw<T>(store: Store, token: TimelineToken<T>): Timeline<T extends TimelineManageable ? T : never>;
425
466
  declare function withdraw<T>(store: Store, token: WritableToken<T>): WritableState<T>;
@@ -534,6 +575,22 @@ declare function evictCachedValue(target: Store, key: string): void;
534
575
  //#region src/internal/capitalize.d.ts
535
576
  declare function capitalize<S extends string>(string: S): Capitalize<S>;
536
577
  //#endregion
578
+ //#region src/internal/events/ingest-atom-update.d.ts
579
+ declare function ingestAtomUpdateEvent(store: Store, event: AtomUpdateEvent<any>, applying: `newValue` | `oldValue`): void;
580
+ //#endregion
581
+ //#region src/internal/events/ingest-creation-disposal.d.ts
582
+ declare function ingestCreationEvent(store: Store, event: StateCreationEvent<any>, applying: `newValue` | `oldValue`): void;
583
+ declare function ingestDisposalEvent(store: Store, event: StateDisposalEvent<ReadableToken<any>>, applying: `newValue` | `oldValue`): void;
584
+ declare function ingestMoleculeCreationEvent(store: Store, event: MoleculeCreationEvent, applying: `newValue` | `oldValue`): void;
585
+ declare function ingestMoleculeDisposalEvent(store: Store, event: MoleculeDisposalEvent, applying: `newValue` | `oldValue`): void;
586
+ declare function ingestMoleculeTransferEvent(store: Store, event: MoleculeTransferEvent, applying: `newValue` | `oldValue`): void;
587
+ //#endregion
588
+ //#region src/internal/events/ingest-selector-update.d.ts
589
+ declare function ingestSelectorUpdateEvent(store: Store, selectorUpdate: TimelineSelectorUpdateEvent<any>, applying: `newValue` | `oldValue`): void;
590
+ //#endregion
591
+ //#region src/internal/events/ingest-transaction-update.d.ts
592
+ declare function ingestTransactionOutcomeEvent(store: Store, event: TransactionOutcomeEvent<any>, applying: `newValue` | `oldValue`): void;
593
+ //#endregion
537
594
  //#region src/internal/families/create-readonly-pure-selector-family.d.ts
538
595
  declare function createReadonlyPureSelectorFamily<T, K extends Canonical>(store: Store, options: ReadonlyPureSelectorFamilyOptions<T, K>, internalRoles?: string[]): ReadonlyPureSelectorFamilyToken<T, K>;
539
596
  //#endregion
@@ -563,10 +620,6 @@ declare function findInStore<T, K extends Canonical, Key extends K>(store: Store
563
620
  declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: WritableFamilyToken<T, K>, key: Key): WritableToken<T, K>;
564
621
  declare function findInStore<T, K extends Canonical, Key extends K>(store: Store, familyToken: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
565
622
  //#endregion
566
- //#region src/internal/families/init-family-member.d.ts
567
- declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(store: Store, token: WritableFamilyToken<T, K>, key: Key): WritableToken<T, K>;
568
- declare function initFamilyMemberInStore<T, K extends Canonical, Key extends K>(store: Store, token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
569
- //#endregion
570
623
  //#region src/internal/families/seek-in-store.d.ts
571
624
  declare function seekInStore<T extends Transceiver<any, any, any>, K extends Canonical, Key extends K>(store: Store, token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K> | undefined;
572
625
  declare function seekInStore<T, K extends Canonical, Key extends K>(store: Store, token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K> | undefined;
@@ -594,22 +647,6 @@ declare function readOrComputeValue<T>(target: Store, state: ReadableState<T>, m
594
647
  //#region src/internal/get-trace.d.ts
595
648
  declare function getTrace(error: Error): string;
596
649
  //#endregion
597
- //#region src/internal/ingest-updates/ingest-atom-update.d.ts
598
- declare function ingestAtomUpdate(applying: `newValue` | `oldValue`, atomUpdate: AtomUpdateEvent<any>, store: Store): void;
599
- //#endregion
600
- //#region src/internal/ingest-updates/ingest-creation-disposal.d.ts
601
- declare function ingestCreationEvent(update: StateCreationEvent<any>, applying: `newValue` | `oldValue`, store: Store): void;
602
- declare function ingestDisposalEvent(update: StateDisposalEvent<ReadableToken<any>>, applying: `newValue` | `oldValue`, store: Store): void;
603
- declare function ingestMoleculeCreationEvent(update: MoleculeCreationEvent, applying: `newValue` | `oldValue`, store: Store): void;
604
- declare function ingestMoleculeDisposalEvent(update: MoleculeDisposalEvent, applying: `newValue` | `oldValue`, store: Store): void;
605
- declare function ingestMoleculeTransferEvent(update: MoleculeTransferEvent, applying: `newValue` | `oldValue`, store: Store): void;
606
- //#endregion
607
- //#region src/internal/ingest-updates/ingest-selector-update.d.ts
608
- declare function ingestSelectorUpdate(applying: `newValue` | `oldValue`, selectorUpdate: TimelineSelectorUpdateEvent<any>, store: Store): void;
609
- //#endregion
610
- //#region src/internal/ingest-updates/ingest-transaction-update.d.ts
611
- declare function ingestTransactionUpdate(applying: `newValue` | `oldValue`, transactionUpdate: TransactionOutcomeEvent<any>, store: Store): void;
612
- //#endregion
613
650
  //#region src/internal/install-into-store.d.ts
614
651
  /**
615
652
  * @public
@@ -684,26 +721,32 @@ declare function updateSelectorAtoms(store: Store, selectorType: `readonly_held_
684
721
  //#endregion
685
722
  //#region src/internal/set-state/become.d.ts
686
723
  type Modify<T> = (thing: T) => T;
687
- declare const become: <T>(nextVersionOfThing: Modify<T> | T) => (originalThing: T) => T;
724
+ declare function become<T>(nextVersionOfThing: Modify<T> | T, originalThing: T): T;
688
725
  //#endregion
689
726
  //#region src/internal/set-state/evict-downstream.d.ts
690
727
  declare function evictDownstreamFromAtom(store: Store, atom: Atom<any>): void;
691
728
  declare function evictDownstreamFromSelector(store: Store, selectorKey: string): void;
692
729
  //#endregion
693
- //#region src/internal/set-state/reset-atom-or-selector.d.ts
694
- declare function resetAtomOrSelector<T>(target: Store & {
695
- operation: OpenOperation;
696
- }, state: WritableState<T>): [oldValue: T, newValue: T];
697
- //#endregion
698
730
  //#region src/internal/set-state/reset-in-store.d.ts
699
731
  declare const RESET_STATE: unique symbol;
700
732
  declare function resetInStore(store: Store, token: WritableToken<any>): void;
701
733
  declare function resetInStore<K extends Canonical>(store: Store, token: WritableFamilyToken<any, K>, key: K): void;
702
734
  //#endregion
735
+ //#region src/internal/set-state/operate-on-store.d.ts
736
+ type ProtoUpdate<T> = {
737
+ oldValue: T;
738
+ newValue: T;
739
+ };
740
+ //#endregion
741
+ //#region src/internal/set-state/reset-atom-or-selector.d.ts
742
+ declare function resetAtomOrSelector<T>(target: Store & {
743
+ operation: OpenOperation;
744
+ }, state: WritableState<T>): ProtoUpdate<T>;
745
+ //#endregion
703
746
  //#region src/internal/set-state/set-atom-or-selector.d.ts
704
747
  declare const setAtomOrSelector: <T>(target: Store & {
705
748
  operation: OpenOperation;
706
- }, state: WritableState<T>, value: T | ((oldValue: T) => T)) => [oldValue: T, newValue: T];
749
+ }, state: WritableState<T>, value: T | ((oldValue: T) => T)) => ProtoUpdate<T>;
707
750
  //#endregion
708
751
  //#region src/internal/set-state/set-into-store.d.ts
709
752
  declare function setIntoStore<T, New extends T>(store: Store, token: WritableToken<T>, value: New | typeof RESET_STATE | ((oldValue: T) => New)): void;
@@ -822,5 +865,5 @@ type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> | WritablePureSel
822
865
  type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
823
866
  type AtomIOInternalResource = ReadableFamily<any, any> | ReadableState<any> | Timeline<any> | Transaction<any>;
824
867
  //#endregion
825
- export { AsJSON, Atom, AtomFamily, AtomIOInternalResource, AtomIOState, AtomKey, BaseExternalStoreConfiguration, COUNTERFEIT, ChildStore, CircularBuffer, ConstructorOf, Count, Each, Empty, EnvironmentData, ExternalStoreConfiguration, ExternalStoreWithContentConfiguration, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Flat, Fn, Future, HeldSelector, HeldSelectorFamily, IMPLICIT, INTERNAL_ROLES, Join, JoinStateFamilies, Junction, JunctionAdvancedConfiguration, JunctionEntries, JunctionEntriesBase, JunctionJSON, JunctionSchema, JunctionSchemaBase, LazyMap, Lineage, Modify, Molecule, MutableAtom, MutableAtomFamily, NotFoundError, OpenOperation, OperationProgress, PureSelector, PureSelectorFamily, RESET_STATE, ReadableFamily, ReadableState, ReadonlyHeldSelector, ReadonlyHeldSelectorFamily, ReadonlyPureSelector, ReadonlyPureSelectorFamily, ReadonlySelector, ReadonlySelectorFamily, ReadonlySelectorKey, Refinement, RegularAtom, RegularAtomFamily, ReservedIntrospectionKey, RootStore, Selector, SelectorFamily, SelectorKey, SignalFrom, StateKey, StatefulSubject, Store, StoreEventCarrier, Subject, TRANSACTION_PHASES, Timeline, Tracker, Transaction, TransactionEpoch, TransactionPhase, TransactionProgress, Transceiver, TransceiverConstructor, TransceiverMode, WritableFamily, WritableHeldSelector, WritableHeldSelectorFamily, WritablePureSelector, WritablePureSelectorFamily, WritableSelector, WritableSelectorFamily, WritableState, abortTransaction, actUponStore, allocateIntoStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, capitalize, claimWithinStore, clearStore, closeOperation, createJoin, createMutableAtom, createMutableAtomFamily, createReadonlyHeldSelector, createReadonlyPureSelector, createReadonlyPureSelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneSelector, createTimeline, createTransaction, createWritableHeldSelector, createWritablePureSelector, createWritablePureSelectorFamily, deallocateFromStore, deposit, disposeAtom, disposeFromStore, disposeSelector, editRelationsInStore, evictCachedValue, evictDownstreamFromAtom, evictDownstreamFromSelector, findInStore, findRelationsInStore, fuseWithinStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getInternalRelationsFromStore, getJoin, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getTrace, getUpdateFamily, getUpdateToken, hasRole, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestMoleculeTransferEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, installIntoStore, internalRole, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isReservedIntrospectionKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeRootMoleculeInStore, markDone, mint, newest, openOperation, readFromCache, readOrComputeValue, recallState, registerSelector, resetAtomOrSelector, resetInStore, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootDependency, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceRootSelectorAtoms, updateSelectorAtoms, withdraw, writeToCache };
868
+ export { AsJSON, Atom, AtomFamily, AtomIOInternalResource, AtomIOState, AtomKey, BaseExternalStoreConfiguration, COUNTERFEIT, ChildStore, CircularBuffer, ConstructorOf, Count, Each, Empty, EnvironmentData, ExternalStoreConfiguration, ExternalStoreWithContentConfiguration, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Flat, Fn, Future, HeldSelector, HeldSelectorFamily, IMPLICIT, INTERNAL_ROLES, Join, JoinStateFamilies, Junction, JunctionAdvancedConfiguration, JunctionEntries, JunctionEntriesBase, JunctionJSON, JunctionOverlay, JunctionSchema, JunctionSchemaBase, Lineage, MapOverlay, Modify, Molecule, MutableAtom, MutableAtomFamily, NotFoundError, OpenOperation, OperationProgress, PureSelector, PureSelectorFamily, RESET_STATE, ReadableFamily, ReadableState, ReadonlyHeldSelector, ReadonlyHeldSelectorFamily, ReadonlyPureSelector, ReadonlyPureSelectorFamily, ReadonlySelector, ReadonlySelectorFamily, ReadonlySelectorKey, Refinement, RegularAtom, RegularAtomFamily, RelationsOverlay, ReservedIntrospectionKey, RootStore, Selector, SelectorFamily, SelectorKey, SetOverlay, SignalFrom, StateKey, StatefulSubject, Store, StoreEventCarrier, Subject, TRANSACTION_PHASES, Timeline, Tracker, Transaction, TransactionEpoch, TransactionPhase, TransactionProgress, Transceiver, TransceiverConstructor, TransceiverMode, WritableFamily, WritableHeldSelector, WritableHeldSelectorFamily, WritablePureSelector, WritablePureSelectorFamily, WritableSelector, WritableSelectorFamily, WritableState, abortTransaction, actUponStore, allocateIntoStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, capitalize, claimWithinStore, clearStore, closeOperation, createJoin, createMutableAtom, createMutableAtomFamily, createReadonlyHeldSelector, createReadonlyPureSelector, createReadonlyPureSelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneSelector, createTimeline, createTransaction, createWritableHeldSelector, createWritablePureSelector, createWritablePureSelectorFamily, deallocateFromStore, deposit, disposeAtom, disposeFromStore, disposeSelector, editRelationsInStore, evictCachedValue, evictDownstreamFromAtom, evictDownstreamFromSelector, findInStore, findRelationsInStore, fuseWithinStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getInternalRelationsFromStore, getJoin, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getTrace, getUpdateFamily, getUpdateToken, hasRole, ingestAtomUpdateEvent, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestMoleculeTransferEvent, ingestSelectorUpdateEvent, ingestTransactionOutcomeEvent, installIntoStore, internalRole, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isReservedIntrospectionKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeRootMoleculeInStore, markDone, mint, newest, openOperation, readFromCache, readOrComputeValue, recallState, registerSelector, resetAtomOrSelector, resetInStore, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootDependency, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceRootSelectorAtoms, updateSelectorAtoms, withdraw, writeToCache };
826
869
  //# sourceMappingURL=index.d.ts.map