foldkit-remote 0.20.0 → 0.22.0

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 (198) hide show
  1. package/README.md +987 -198
  2. package/dist/answerGaps.d.ts +16 -0
  3. package/dist/answerGaps.d.ts.map +1 -0
  4. package/dist/answerGaps.js +60 -0
  5. package/dist/answerGaps.js.map +1 -0
  6. package/dist/client-B055kQuP.d.ts +110 -0
  7. package/dist/client-B055kQuP.d.ts.map +1 -0
  8. package/dist/client.d.ts +2 -0
  9. package/dist/client.js +142 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/coalesce-CLAr92Nk.d.ts +34 -0
  12. package/dist/coalesce-CLAr92Nk.d.ts.map +1 -0
  13. package/dist/coalesce.d.ts +2 -0
  14. package/dist/coalesce.js +131 -0
  15. package/dist/coalesce.js.map +1 -0
  16. package/dist/connection-BRyaJy89.d.ts +45 -0
  17. package/dist/connection-BRyaJy89.d.ts.map +1 -0
  18. package/dist/connection.d.ts +2 -0
  19. package/dist/connection.js +170 -0
  20. package/dist/connection.js.map +1 -0
  21. package/dist/data.d.ts +7 -0
  22. package/dist/data.d.ts.map +1 -0
  23. package/dist/data.js +21 -0
  24. package/dist/data.js.map +1 -0
  25. package/dist/diagnostics-DHhVYflV.d.ts +125 -0
  26. package/dist/diagnostics-DHhVYflV.d.ts.map +1 -0
  27. package/dist/diagnostics.d.ts +2 -0
  28. package/dist/diagnostics.js +60 -0
  29. package/dist/diagnostics.js.map +1 -0
  30. package/dist/entity-CgsG5Uel.d.ts +196 -0
  31. package/dist/entity-CgsG5Uel.d.ts.map +1 -0
  32. package/dist/entity-DuDxaa3n.js +279 -0
  33. package/dist/entity-DuDxaa3n.js.map +1 -0
  34. package/dist/entity.d.ts +2 -0
  35. package/dist/entity.js +1 -0
  36. package/dist/held.d.ts +19 -0
  37. package/dist/held.d.ts.map +1 -0
  38. package/dist/held.js +70 -0
  39. package/dist/held.js.map +1 -0
  40. package/dist/impact.d.ts +79 -0
  41. package/dist/impact.d.ts.map +1 -0
  42. package/dist/impact.js +166 -0
  43. package/dist/impact.js.map +1 -0
  44. package/dist/index.d.ts +1542 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +2791 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/inspect-DtRQGCRP.d.ts +134 -0
  49. package/dist/inspect-DtRQGCRP.d.ts.map +1 -0
  50. package/dist/inspect.d.ts +2 -0
  51. package/dist/inspect.js +33 -0
  52. package/dist/inspect.js.map +1 -0
  53. package/dist/json-DowLl1eB.d.ts +52 -0
  54. package/dist/json-DowLl1eB.d.ts.map +1 -0
  55. package/dist/json.d.ts +2 -0
  56. package/dist/json.js +123 -0
  57. package/dist/json.js.map +1 -0
  58. package/dist/law.d.ts +56 -0
  59. package/dist/law.d.ts.map +1 -0
  60. package/dist/law.js +201 -0
  61. package/dist/law.js.map +1 -0
  62. package/dist/live-BpTzlCnY.d.ts +79 -0
  63. package/dist/live-BpTzlCnY.d.ts.map +1 -0
  64. package/dist/live.d.ts +2 -0
  65. package/dist/live.js +126 -0
  66. package/dist/live.js.map +1 -0
  67. package/dist/matching-DF5F9Us8.d.ts +100 -0
  68. package/dist/matching-DF5F9Us8.d.ts.map +1 -0
  69. package/dist/matching.d.ts +2 -0
  70. package/dist/matching.js +172 -0
  71. package/dist/matching.js.map +1 -0
  72. package/dist/model-B6zk1NMB.d.ts +710 -0
  73. package/dist/model-B6zk1NMB.d.ts.map +1 -0
  74. package/dist/model.d.ts +2 -0
  75. package/dist/model.js +1308 -0
  76. package/dist/model.js.map +1 -0
  77. package/dist/mutation.d.ts +2 -0
  78. package/dist/mutation.js +612 -0
  79. package/dist/mutation.js.map +1 -0
  80. package/dist/optimistic-CECsfNGY.d.ts +523 -0
  81. package/dist/optimistic-CECsfNGY.d.ts.map +1 -0
  82. package/dist/optimistic.d.ts +2 -0
  83. package/dist/optimistic.js +336 -0
  84. package/dist/optimistic.js.map +1 -0
  85. package/dist/outbox-DNuc4kZp.d.ts +259 -0
  86. package/dist/outbox-DNuc4kZp.d.ts.map +1 -0
  87. package/dist/outbox.d.ts +2 -0
  88. package/dist/outbox.js +326 -0
  89. package/dist/outbox.js.map +1 -0
  90. package/dist/patchValues.d.ts +10 -0
  91. package/dist/patchValues.d.ts.map +1 -0
  92. package/dist/patchValues.js +57 -0
  93. package/dist/patchValues.js.map +1 -0
  94. package/dist/persistence-CCMnvg7-.d.ts +114 -0
  95. package/dist/persistence-CCMnvg7-.d.ts.map +1 -0
  96. package/dist/persistence.d.ts +2 -0
  97. package/dist/persistence.js +205 -0
  98. package/dist/persistence.js.map +1 -0
  99. package/dist/placement-jZdsIpmj.d.ts +50 -0
  100. package/dist/placement-jZdsIpmj.d.ts.map +1 -0
  101. package/dist/placement.d.ts +2 -0
  102. package/dist/placement.js +116 -0
  103. package/dist/placement.js.map +1 -0
  104. package/dist/plan-D9cftxC_.d.ts +35 -0
  105. package/dist/plan-D9cftxC_.d.ts.map +1 -0
  106. package/dist/plan.d.ts +2 -0
  107. package/dist/plan.js +100 -0
  108. package/dist/plan.js.map +1 -0
  109. package/dist/policy-DsWHmIAq.d.ts +42 -0
  110. package/dist/policy-DsWHmIAq.d.ts.map +1 -0
  111. package/dist/policy.d.ts +2 -0
  112. package/dist/policy.js +32 -0
  113. package/dist/policy.js.map +1 -0
  114. package/dist/{port.d.mts → port.d.ts} +3 -2
  115. package/dist/port.d.ts.map +1 -0
  116. package/dist/{port.mjs → port.js} +3 -2
  117. package/dist/port.js.map +1 -0
  118. package/dist/query-BuIU93xA.d.ts +141 -0
  119. package/dist/query-BuIU93xA.d.ts.map +1 -0
  120. package/dist/query.d.ts +2 -0
  121. package/dist/query.js +0 -0
  122. package/dist/query.js.map +1 -0
  123. package/dist/record.d.ts +11 -0
  124. package/dist/record.d.ts.map +1 -0
  125. package/dist/record.js +21 -0
  126. package/dist/record.js.map +1 -0
  127. package/dist/relation-BLBGOZom.d.ts +59 -0
  128. package/dist/relation-BLBGOZom.d.ts.map +1 -0
  129. package/dist/relation.d.ts +2 -0
  130. package/dist/relation.js +93 -0
  131. package/dist/relation.js.map +1 -0
  132. package/dist/remoteData-mK1suYi1.d.ts +148 -0
  133. package/dist/remoteData-mK1suYi1.d.ts.map +1 -0
  134. package/dist/remoteData.d.ts +2 -0
  135. package/dist/remoteData.js +179 -0
  136. package/dist/remoteData.js.map +1 -0
  137. package/dist/reporting.d.ts +12 -0
  138. package/dist/reporting.d.ts.map +1 -0
  139. package/dist/reporting.js +45 -0
  140. package/dist/reporting.js.map +1 -0
  141. package/dist/requirement-D57S2LpH.d.ts +64 -0
  142. package/dist/requirement-D57S2LpH.d.ts.map +1 -0
  143. package/dist/requirement.d.ts +2 -0
  144. package/dist/requirement.js +114 -0
  145. package/dist/requirement.js.map +1 -0
  146. package/dist/resume-Ct5R6yli.d.ts +92 -0
  147. package/dist/resume-Ct5R6yli.d.ts.map +1 -0
  148. package/dist/resume.d.ts +2 -0
  149. package/dist/resume.js +222 -0
  150. package/dist/resume.js.map +1 -0
  151. package/dist/retain-BfNTvBRb.d.ts +48 -0
  152. package/dist/retain-BfNTvBRb.d.ts.map +1 -0
  153. package/dist/retain.d.ts +2 -0
  154. package/dist/retain.js +107 -0
  155. package/dist/retain.js.map +1 -0
  156. package/dist/selection.d.ts +2 -0
  157. package/dist/selection.js +1 -0
  158. package/dist/shown.d.ts +20 -0
  159. package/dist/shown.d.ts.map +1 -0
  160. package/dist/shown.js +40 -0
  161. package/dist/shown.js.map +1 -0
  162. package/dist/sse-C7LhdbiQ.d.ts +17 -0
  163. package/dist/sse-C7LhdbiQ.d.ts.map +1 -0
  164. package/dist/sse.d.ts +2 -0
  165. package/dist/sse.js +127 -0
  166. package/dist/sse.js.map +1 -0
  167. package/dist/store-ah2qjcJW.d.ts +100 -0
  168. package/dist/store-ah2qjcJW.d.ts.map +1 -0
  169. package/dist/store.d.ts +2 -0
  170. package/dist/store.js +218 -0
  171. package/dist/store.js.map +1 -0
  172. package/dist/testing.d.ts +133 -0
  173. package/dist/testing.d.ts.map +1 -0
  174. package/dist/testing.js +0 -0
  175. package/dist/testing.js.map +1 -0
  176. package/dist/why-kgp_Wr3z.d.ts +483 -0
  177. package/dist/why-kgp_Wr3z.d.ts.map +1 -0
  178. package/dist/why.d.ts +2 -0
  179. package/dist/why.js +293 -0
  180. package/dist/why.js.map +1 -0
  181. package/dist/whyReasons.d.ts +42 -0
  182. package/dist/whyReasons.d.ts.map +1 -0
  183. package/dist/whyReasons.js +211 -0
  184. package/dist/whyReasons.js.map +1 -0
  185. package/dist/wire-DthPcTM6.d.ts +787 -0
  186. package/dist/wire-DthPcTM6.d.ts.map +1 -0
  187. package/dist/wire.d.ts +2 -0
  188. package/dist/wire.js +329 -0
  189. package/dist/wire.js.map +1 -0
  190. package/package.json +19 -14
  191. package/dist/index-BEvVAL76.d.mts +0 -4097
  192. package/dist/index-BEvVAL76.d.mts.map +0 -1
  193. package/dist/index.d.mts +0 -2
  194. package/dist/index.mjs +0 -1
  195. package/dist/port.d.mts.map +0 -1
  196. package/dist/port.mjs.map +0 -1
  197. package/dist/src-BDqn7Ocr.mjs +0 -6344
  198. package/dist/src-BDqn7Ocr.mjs.map +0 -1
@@ -0,0 +1,483 @@
1
+ import { r as RemoteData } from "./remoteData-mK1suYi1.js";
2
+ import { Option, Schema } from "effect";
3
+ /** A list by its query's name and its connection identity (the query and its encoded input). */
4
+ declare const ListRef: Schema.Struct<{
5
+ readonly query: Schema.String;
6
+ readonly identity: Schema.String;
7
+ }>;
8
+ type ListRef = typeof ListRef.Type;
9
+ /** What shows something the server has not said: a write, an overlay, or a live event. */
10
+ declare const ShownBy: import("foldkit/schema").TaggedUnion<{
11
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
12
+ readonly Write: {
13
+ requestId: Schema.String;
14
+ mutation: Schema.OptionFromNullOr<Schema.String>;
15
+ };
16
+ /** `Data.overlay`'s id. */
17
+ readonly Overlay: {
18
+ id: Schema.String;
19
+ };
20
+ /** A live event's insert or remove, by its cursor. */
21
+ readonly Live: {
22
+ cursor: Schema.String;
23
+ };
24
+ }>;
25
+ type ShownBy = typeof ShownBy.Type;
26
+ /**
27
+ * One `where` predicate of a list's body, judged over the row as the client
28
+ * placed it. `Null` is SQL's unknown, which keeps a row out; `Unknown` rests
29
+ * on what the store lacks, and `reason` says what.
30
+ */
31
+ declare const WhyTerm: Schema.Struct<{
32
+ readonly term: Schema.String;
33
+ readonly truth: Schema.Literals<readonly ["True", "False", "Null", "Unknown"]>;
34
+ readonly reason: Schema.OptionFromNullOr<Schema.String>;
35
+ }>;
36
+ type WhyTerm = typeof WhyTerm.Type;
37
+ /** One fact about a read. `ReadWhy.because` lists every one the Model holds. */
38
+ declare const Why: import("foldkit/schema").TaggedUnion<{
39
+ /** `Initial`, and no active Surface asks for all of the read. */
40
+ readonly NotObserved: {};
41
+ /** `Initial`, and these active Surfaces read it: Remote's Subscriptions are not running. */
42
+ readonly NotFetching: {
43
+ surfaces: Schema.$Array<Schema.String>;
44
+ };
45
+ /** `Initial`, and no active record was given to tell which mistake it is. */
46
+ readonly NoActiveRecord: {};
47
+ /** The list's own page is missing or stale; `inFlight` while its query is out. */
48
+ readonly List: {
49
+ list: Schema.Struct<{
50
+ readonly query: Schema.String;
51
+ readonly identity: Schema.String;
52
+ }>;
53
+ held: Schema.Literals<readonly ["Missing", "Stale"]>;
54
+ inFlight: Schema.Boolean;
55
+ };
56
+ /** Fields of one row are missing or stale; `via` is the relation path from the read's row. */
57
+ readonly Fields: {
58
+ row: Schema.Struct<{
59
+ readonly entity: Schema.String;
60
+ readonly id: Schema.String;
61
+ }>;
62
+ via: Schema.$Array<Schema.String>;
63
+ fields: Schema.$Array<Schema.String>;
64
+ held: Schema.Literals<readonly ["Missing", "Stale"]>;
65
+ inFlight: Schema.Boolean;
66
+ };
67
+ /** The list's query failed, and nothing has settled it. Nothing retries it on its own. */
68
+ readonly ListFailed: {
69
+ list: Schema.Struct<{
70
+ readonly query: Schema.String;
71
+ readonly identity: Schema.String;
72
+ }>;
73
+ error: Schema.Struct<{
74
+ readonly _tag: Schema.String;
75
+ readonly message: Schema.String;
76
+ readonly refusal: Schema.optional<Schema.Unknown>;
77
+ readonly reason: Schema.optional<Schema.String>;
78
+ }>;
79
+ };
80
+ /** Reading these fields failed, and nothing has settled it. Nothing retries it on its own. */
81
+ readonly FieldsFailed: {
82
+ row: Schema.Struct<{
83
+ readonly entity: Schema.String;
84
+ readonly id: Schema.String;
85
+ }>;
86
+ via: Schema.$Array<Schema.String>;
87
+ fields: Schema.$Array<Schema.String>;
88
+ error: Schema.Struct<{
89
+ readonly _tag: Schema.String;
90
+ readonly message: Schema.String;
91
+ readonly refusal: Schema.optional<Schema.Unknown>;
92
+ readonly reason: Schema.optional<Schema.String>;
93
+ }>;
94
+ };
95
+ /** The server settled these fields without a value for this principal. */
96
+ readonly Unavailable: {
97
+ row: Schema.Struct<{
98
+ readonly entity: Schema.String;
99
+ readonly id: Schema.String;
100
+ }>;
101
+ via: Schema.$Array<Schema.String>;
102
+ fields: Schema.$Array<Schema.String>;
103
+ };
104
+ /** What the store holds does not decode against the Selection. */
105
+ readonly Undecodable: {
106
+ message: Schema.String;
107
+ };
108
+ /** The row is shown only by an overlay, which lacks fields nothing will fetch. */
109
+ readonly OverlayOnly: {
110
+ message: Schema.String;
111
+ };
112
+ /** The row is gone: the server said so (`by` none), or a pending write deletes it. */
113
+ readonly Deleted: {
114
+ row: Schema.Struct<{
115
+ readonly entity: Schema.String;
116
+ readonly id: Schema.String;
117
+ }>;
118
+ by: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
119
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
120
+ readonly Write: {
121
+ requestId: Schema.String;
122
+ mutation: Schema.OptionFromNullOr<Schema.String>;
123
+ };
124
+ /** `Data.overlay`'s id. */
125
+ readonly Overlay: {
126
+ id: Schema.String;
127
+ };
128
+ /** A live event's insert or remove, by its cursor. */
129
+ readonly Live: {
130
+ cursor: Schema.String;
131
+ };
132
+ }>>;
133
+ };
134
+ /** A live stream of a Surface reading it broke; the live entry resubscribes on its own. */
135
+ readonly LiveReconnecting: {
136
+ surface: Schema.String;
137
+ attempt: Schema.Number;
138
+ error: Schema.OptionFromNullOr<Schema.Struct<{
139
+ readonly _tag: Schema.String;
140
+ readonly message: Schema.String;
141
+ readonly refusal: Schema.optional<Schema.Unknown>;
142
+ readonly reason: Schema.optional<Schema.String>;
143
+ }>>;
144
+ };
145
+ /** The server refused a Surface's live stream; nothing asks again until what it reads changes. */
146
+ readonly LiveRefused: {
147
+ surface: Schema.String;
148
+ error: Schema.Struct<{
149
+ readonly _tag: Schema.String;
150
+ readonly message: Schema.String;
151
+ readonly refusal: Schema.optional<Schema.Unknown>;
152
+ readonly reason: Schema.optional<Schema.String>;
153
+ }>;
154
+ };
155
+ /** A pending layer writes these fields of a row the read shows. */
156
+ readonly Pending: {
157
+ row: Schema.Struct<{
158
+ readonly entity: Schema.String;
159
+ readonly id: Schema.String;
160
+ }>;
161
+ fields: Schema.$Array<Schema.String>;
162
+ by: import("foldkit/schema").TaggedUnion<{
163
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
164
+ readonly Write: {
165
+ requestId: Schema.String;
166
+ mutation: Schema.OptionFromNullOr<Schema.String>;
167
+ };
168
+ /** `Data.overlay`'s id. */
169
+ readonly Overlay: {
170
+ id: Schema.String;
171
+ };
172
+ /** A live event's insert or remove, by its cursor. */
173
+ readonly Live: {
174
+ cursor: Schema.String;
175
+ };
176
+ }>;
177
+ };
178
+ /** The list shows a row its server pages do not hold. */
179
+ readonly Joined: {
180
+ list: Schema.Struct<{
181
+ readonly query: Schema.String;
182
+ readonly identity: Schema.String;
183
+ }>;
184
+ row: Schema.Struct<{
185
+ readonly entity: Schema.String;
186
+ readonly id: Schema.String;
187
+ }>;
188
+ by: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
189
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
190
+ readonly Write: {
191
+ requestId: Schema.String;
192
+ mutation: Schema.OptionFromNullOr<Schema.String>;
193
+ };
194
+ /** `Data.overlay`'s id. */
195
+ readonly Overlay: {
196
+ id: Schema.String;
197
+ };
198
+ /** A live event's insert or remove, by its cursor. */
199
+ readonly Live: {
200
+ cursor: Schema.String;
201
+ };
202
+ }>>;
203
+ terms: Schema.$Array<Schema.Struct<{
204
+ readonly term: Schema.String;
205
+ readonly truth: Schema.Literals<readonly ["True", "False", "Null", "Unknown"]>;
206
+ readonly reason: Schema.OptionFromNullOr<Schema.String>;
207
+ }>>;
208
+ };
209
+ /** The list's server pages hold a row it does not show. */
210
+ readonly Left: {
211
+ list: Schema.Struct<{
212
+ readonly query: Schema.String;
213
+ readonly identity: Schema.String;
214
+ }>;
215
+ row: Schema.Struct<{
216
+ readonly entity: Schema.String;
217
+ readonly id: Schema.String;
218
+ }>;
219
+ by: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
220
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
221
+ readonly Write: {
222
+ requestId: Schema.String;
223
+ mutation: Schema.OptionFromNullOr<Schema.String>;
224
+ };
225
+ /** `Data.overlay`'s id. */
226
+ readonly Overlay: {
227
+ id: Schema.String;
228
+ };
229
+ /** A live event's insert or remove, by its cursor. */
230
+ readonly Live: {
231
+ cursor: Schema.String;
232
+ };
233
+ }>>;
234
+ terms: Schema.$Array<Schema.Struct<{
235
+ readonly term: Schema.String;
236
+ readonly truth: Schema.Literals<readonly ["True", "False", "Null", "Unknown"]>;
237
+ readonly reason: Schema.OptionFromNullOr<Schema.String>;
238
+ }>>;
239
+ };
240
+ }>;
241
+ type Why = typeof Why.Type;
242
+ declare const State: Schema.Literals<readonly ["Initial", "Loading", "Ready", "Refreshing", "Failed", "NotFound"]>;
243
+ type State = typeof State.Type;
244
+ /**
245
+ * Why a read shows what it shows. `because` is every fact the Model holds
246
+ * about what it reads, the reason that decides `state` first; `message` is
247
+ * that reason in words. `surfaces` are the active Surfaces reading all of it,
248
+ * when the active record was given. Encode it with this schema for JSON.
249
+ */
250
+ declare const ReadWhy: Schema.Struct<{
251
+ readonly state: Schema.Literals<readonly ["Initial", "Loading", "Ready", "Refreshing", "Failed", "NotFound"]>;
252
+ readonly because: Schema.$Array<import("foldkit/schema").TaggedUnion<{
253
+ /** `Initial`, and no active Surface asks for all of the read. */
254
+ readonly NotObserved: {};
255
+ /** `Initial`, and these active Surfaces read it: Remote's Subscriptions are not running. */
256
+ readonly NotFetching: {
257
+ surfaces: Schema.$Array<Schema.String>;
258
+ };
259
+ /** `Initial`, and no active record was given to tell which mistake it is. */
260
+ readonly NoActiveRecord: {};
261
+ /** The list's own page is missing or stale; `inFlight` while its query is out. */
262
+ readonly List: {
263
+ list: Schema.Struct<{
264
+ readonly query: Schema.String;
265
+ readonly identity: Schema.String;
266
+ }>;
267
+ held: Schema.Literals<readonly ["Missing", "Stale"]>;
268
+ inFlight: Schema.Boolean;
269
+ };
270
+ /** Fields of one row are missing or stale; `via` is the relation path from the read's row. */
271
+ readonly Fields: {
272
+ row: Schema.Struct<{
273
+ readonly entity: Schema.String;
274
+ readonly id: Schema.String;
275
+ }>;
276
+ via: Schema.$Array<Schema.String>;
277
+ fields: Schema.$Array<Schema.String>;
278
+ held: Schema.Literals<readonly ["Missing", "Stale"]>;
279
+ inFlight: Schema.Boolean;
280
+ };
281
+ /** The list's query failed, and nothing has settled it. Nothing retries it on its own. */
282
+ readonly ListFailed: {
283
+ list: Schema.Struct<{
284
+ readonly query: Schema.String;
285
+ readonly identity: Schema.String;
286
+ }>;
287
+ error: Schema.Struct<{
288
+ readonly _tag: Schema.String;
289
+ readonly message: Schema.String;
290
+ readonly refusal: Schema.optional<Schema.Unknown>;
291
+ readonly reason: Schema.optional<Schema.String>;
292
+ }>;
293
+ };
294
+ /** Reading these fields failed, and nothing has settled it. Nothing retries it on its own. */
295
+ readonly FieldsFailed: {
296
+ row: Schema.Struct<{
297
+ readonly entity: Schema.String;
298
+ readonly id: Schema.String;
299
+ }>;
300
+ via: Schema.$Array<Schema.String>;
301
+ fields: Schema.$Array<Schema.String>;
302
+ error: Schema.Struct<{
303
+ readonly _tag: Schema.String;
304
+ readonly message: Schema.String;
305
+ readonly refusal: Schema.optional<Schema.Unknown>;
306
+ readonly reason: Schema.optional<Schema.String>;
307
+ }>;
308
+ };
309
+ /** The server settled these fields without a value for this principal. */
310
+ readonly Unavailable: {
311
+ row: Schema.Struct<{
312
+ readonly entity: Schema.String;
313
+ readonly id: Schema.String;
314
+ }>;
315
+ via: Schema.$Array<Schema.String>;
316
+ fields: Schema.$Array<Schema.String>;
317
+ };
318
+ /** What the store holds does not decode against the Selection. */
319
+ readonly Undecodable: {
320
+ message: Schema.String;
321
+ };
322
+ /** The row is shown only by an overlay, which lacks fields nothing will fetch. */
323
+ readonly OverlayOnly: {
324
+ message: Schema.String;
325
+ };
326
+ /** The row is gone: the server said so (`by` none), or a pending write deletes it. */
327
+ readonly Deleted: {
328
+ row: Schema.Struct<{
329
+ readonly entity: Schema.String;
330
+ readonly id: Schema.String;
331
+ }>;
332
+ by: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
333
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
334
+ readonly Write: {
335
+ requestId: Schema.String;
336
+ mutation: Schema.OptionFromNullOr<Schema.String>;
337
+ };
338
+ /** `Data.overlay`'s id. */
339
+ readonly Overlay: {
340
+ id: Schema.String;
341
+ };
342
+ /** A live event's insert or remove, by its cursor. */
343
+ readonly Live: {
344
+ cursor: Schema.String;
345
+ };
346
+ }>>;
347
+ };
348
+ /** A live stream of a Surface reading it broke; the live entry resubscribes on its own. */
349
+ readonly LiveReconnecting: {
350
+ surface: Schema.String;
351
+ attempt: Schema.Number;
352
+ error: Schema.OptionFromNullOr<Schema.Struct<{
353
+ readonly _tag: Schema.String;
354
+ readonly message: Schema.String;
355
+ readonly refusal: Schema.optional<Schema.Unknown>;
356
+ readonly reason: Schema.optional<Schema.String>;
357
+ }>>;
358
+ };
359
+ /** The server refused a Surface's live stream; nothing asks again until what it reads changes. */
360
+ readonly LiveRefused: {
361
+ surface: Schema.String;
362
+ error: Schema.Struct<{
363
+ readonly _tag: Schema.String;
364
+ readonly message: Schema.String;
365
+ readonly refusal: Schema.optional<Schema.Unknown>;
366
+ readonly reason: Schema.optional<Schema.String>;
367
+ }>;
368
+ };
369
+ /** A pending layer writes these fields of a row the read shows. */
370
+ readonly Pending: {
371
+ row: Schema.Struct<{
372
+ readonly entity: Schema.String;
373
+ readonly id: Schema.String;
374
+ }>;
375
+ fields: Schema.$Array<Schema.String>;
376
+ by: import("foldkit/schema").TaggedUnion<{
377
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
378
+ readonly Write: {
379
+ requestId: Schema.String;
380
+ mutation: Schema.OptionFromNullOr<Schema.String>;
381
+ };
382
+ /** `Data.overlay`'s id. */
383
+ readonly Overlay: {
384
+ id: Schema.String;
385
+ };
386
+ /** A live event's insert or remove, by its cursor. */
387
+ readonly Live: {
388
+ cursor: Schema.String;
389
+ };
390
+ }>;
391
+ };
392
+ /** The list shows a row its server pages do not hold. */
393
+ readonly Joined: {
394
+ list: Schema.Struct<{
395
+ readonly query: Schema.String;
396
+ readonly identity: Schema.String;
397
+ }>;
398
+ row: Schema.Struct<{
399
+ readonly entity: Schema.String;
400
+ readonly id: Schema.String;
401
+ }>;
402
+ by: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
403
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
404
+ readonly Write: {
405
+ requestId: Schema.String;
406
+ mutation: Schema.OptionFromNullOr<Schema.String>;
407
+ };
408
+ /** `Data.overlay`'s id. */
409
+ readonly Overlay: {
410
+ id: Schema.String;
411
+ };
412
+ /** A live event's insert or remove, by its cursor. */
413
+ readonly Live: {
414
+ cursor: Schema.String;
415
+ };
416
+ }>>;
417
+ terms: Schema.$Array<Schema.Struct<{
418
+ readonly term: Schema.String;
419
+ readonly truth: Schema.Literals<readonly ["True", "False", "Null", "Unknown"]>;
420
+ readonly reason: Schema.OptionFromNullOr<Schema.String>;
421
+ }>>;
422
+ };
423
+ /** The list's server pages hold a row it does not show. */
424
+ readonly Left: {
425
+ list: Schema.Struct<{
426
+ readonly query: Schema.String;
427
+ readonly identity: Schema.String;
428
+ }>;
429
+ row: Schema.Struct<{
430
+ readonly entity: Schema.String;
431
+ readonly id: Schema.String;
432
+ }>;
433
+ by: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
434
+ /** `Data.mutate`'s request; the mutation is none once the ledger no longer holds its write. */
435
+ readonly Write: {
436
+ requestId: Schema.String;
437
+ mutation: Schema.OptionFromNullOr<Schema.String>;
438
+ };
439
+ /** `Data.overlay`'s id. */
440
+ readonly Overlay: {
441
+ id: Schema.String;
442
+ };
443
+ /** A live event's insert or remove, by its cursor. */
444
+ readonly Live: {
445
+ cursor: Schema.String;
446
+ };
447
+ }>>;
448
+ terms: Schema.$Array<Schema.Struct<{
449
+ readonly term: Schema.String;
450
+ readonly truth: Schema.Literals<readonly ["True", "False", "Null", "Unknown"]>;
451
+ readonly reason: Schema.OptionFromNullOr<Schema.String>;
452
+ }>>;
453
+ };
454
+ }>>;
455
+ readonly message: Schema.String;
456
+ readonly surfaces: Schema.OptionFromNullOr<Schema.$Array<Schema.String>>;
457
+ }>;
458
+ type ReadWhy = typeof ReadWhy.Type;
459
+ /** One reason in words, with what restarts it. */
460
+ declare const whyWords: (why: Why) => string;
461
+ /** The explanation of a read in `state`, from its reasons. */
462
+ declare const readWhy: (state: State, because: ReadonlyArray<Why>, surfaces: Option.Option<ReadonlyArray<string>>) => ReadWhy;
463
+ /**
464
+ * #234's rule: a read that showed a value stopped showing it with no reason
465
+ * a reader can see (`Loading`, `Initial`, or `Failed` without the value).
466
+ */
467
+ declare const regressed: (from: RemoteData<unknown>, to: RemoteData<unknown>) => boolean;
468
+ /** One change of a read's tag in a history, with the Message that made it. */
469
+ interface ReadStep<Message> {
470
+ /** The read's name, as `Data.timeline` was given it. */
471
+ readonly read: string;
472
+ /** The history entry it changed at, from 0. */
473
+ readonly index: number;
474
+ readonly message: Message;
475
+ readonly from: State;
476
+ readonly to: State;
477
+ /** `Data.why` at the Model it changed to. */
478
+ readonly why: ReadWhy;
479
+ /** It showed a value and stopped, with no reason a reader can see (#234). */
480
+ readonly regression: boolean;
481
+ }
482
+ export { Why as a, regressed as c, ShownBy as i, whyWords as l, ReadStep as n, WhyTerm as o, ReadWhy as r, readWhy as s, ListRef as t };
483
+ //# sourceMappingURL=why-kgp_Wr3z.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"why-kgp_Wr3z.d.ts","names":[],"sources":["../src/why.ts"],"mappings":"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"}
package/dist/why.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { a as Why, c as regressed, i as ShownBy, l as whyWords, n as ReadStep, o as WhyTerm, r as ReadWhy, s as readWhy, t as ListRef } from "./why-kgp_Wr3z.js";
2
+ export { ListRef, ReadStep, ReadWhy, ShownBy, Why, WhyTerm, readWhy, regressed, whyWords };