@evolu/common 8.9.0 → 8.11.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 (337) hide show
  1. package/dist/src/Bytes.d.ts +647 -0
  2. package/dist/src/Bytes.d.ts.map +1 -0
  3. package/dist/src/{Binary.js → Bytes.js} +266 -16
  4. package/dist/src/Config.d.ts +142 -0
  5. package/dist/src/Config.d.ts.map +1 -0
  6. package/dist/src/Config.js +181 -0
  7. package/dist/src/Console.d.ts +62 -7
  8. package/dist/src/Console.d.ts.map +1 -1
  9. package/dist/src/Console.js +20 -4
  10. package/dist/src/Crypto.d.ts +76 -4
  11. package/dist/src/Crypto.d.ts.map +1 -1
  12. package/dist/src/Crypto.js +55 -4
  13. package/dist/src/Error.d.ts +45 -0
  14. package/dist/src/Error.d.ts.map +1 -1
  15. package/dist/src/Error.js +69 -0
  16. package/dist/src/Fs.d.ts +376 -0
  17. package/dist/src/Fs.d.ts.map +1 -0
  18. package/dist/src/Fs.js +113 -0
  19. package/dist/src/Identicon.d.ts +2 -2
  20. package/dist/src/Identicon.js +2 -2
  21. package/dist/src/LeakDetector.d.ts +22 -3
  22. package/dist/src/LeakDetector.d.ts.map +1 -1
  23. package/dist/src/LeakDetector.js +12 -2
  24. package/dist/src/LockManager.d.ts +8 -0
  25. package/dist/src/LockManager.d.ts.map +1 -1
  26. package/dist/src/LockManager.js +6 -0
  27. package/dist/src/Number.d.ts +50 -7
  28. package/dist/src/Number.d.ts.map +1 -1
  29. package/dist/src/Number.js +47 -8
  30. package/dist/src/Object.d.ts +32 -0
  31. package/dist/src/Object.d.ts.map +1 -1
  32. package/dist/src/Object.js +46 -0
  33. package/dist/src/Platform.d.ts +47 -7
  34. package/dist/src/Platform.d.ts.map +1 -1
  35. package/dist/src/Platform.js +24 -5
  36. package/dist/src/Random.d.ts +25 -2
  37. package/dist/src/Random.d.ts.map +1 -1
  38. package/dist/src/Random.js +14 -2
  39. package/dist/src/Resource.d.ts +156 -1
  40. package/dist/src/Resource.d.ts.map +1 -1
  41. package/dist/src/Resource.js +201 -72
  42. package/dist/src/Schedule.d.ts +11 -10
  43. package/dist/src/Schedule.d.ts.map +1 -1
  44. package/dist/src/Schedule.js +1 -1
  45. package/dist/src/Sqlite.d.ts +132 -16
  46. package/dist/src/Sqlite.d.ts.map +1 -1
  47. package/dist/src/Sqlite.js +64 -10
  48. package/dist/src/Task.d.ts +15 -4
  49. package/dist/src/Task.d.ts.map +1 -1
  50. package/dist/src/Task.js +41 -15
  51. package/dist/src/Test.d.ts +9 -0
  52. package/dist/src/Test.d.ts.map +1 -1
  53. package/dist/src/Test.js +4 -0
  54. package/dist/src/Time.d.ts +179 -20
  55. package/dist/src/Time.d.ts.map +1 -1
  56. package/dist/src/Time.js +95 -6
  57. package/dist/src/Type.d.ts +3056 -1539
  58. package/dist/src/Type.d.ts.map +1 -1
  59. package/dist/src/Type.js +2548 -584
  60. package/dist/src/WebSocket.d.ts +164 -13
  61. package/dist/src/WebSocket.d.ts.map +1 -1
  62. package/dist/src/WebSocket.js +133 -24
  63. package/dist/src/Worker.d.ts +90 -8
  64. package/dist/src/Worker.d.ts.map +1 -1
  65. package/dist/src/Worker.js +28 -2
  66. package/dist/src/index.d.ts +9 -8
  67. package/dist/src/index.d.ts.map +1 -1
  68. package/dist/src/index.js +5 -4
  69. package/dist/src/intl/_en.d.ts +24 -1
  70. package/dist/src/intl/_en.d.ts.map +1 -1
  71. package/dist/src/intl/_en.js +20 -0
  72. package/dist/src/intl/ar.d.ts +24 -1
  73. package/dist/src/intl/ar.d.ts.map +1 -1
  74. package/dist/src/intl/ar.js +20 -0
  75. package/dist/src/intl/bn.d.ts +24 -1
  76. package/dist/src/intl/bn.d.ts.map +1 -1
  77. package/dist/src/intl/bn.js +20 -0
  78. package/dist/src/intl/ca.d.ts +24 -1
  79. package/dist/src/intl/ca.d.ts.map +1 -1
  80. package/dist/src/intl/ca.js +20 -0
  81. package/dist/src/intl/cs.d.ts +24 -1
  82. package/dist/src/intl/cs.d.ts.map +1 -1
  83. package/dist/src/intl/cs.js +20 -0
  84. package/dist/src/intl/da.d.ts +24 -1
  85. package/dist/src/intl/da.d.ts.map +1 -1
  86. package/dist/src/intl/da.js +20 -0
  87. package/dist/src/intl/de.d.ts +24 -1
  88. package/dist/src/intl/de.d.ts.map +1 -1
  89. package/dist/src/intl/de.js +20 -0
  90. package/dist/src/intl/el.d.ts +24 -1
  91. package/dist/src/intl/el.d.ts.map +1 -1
  92. package/dist/src/intl/el.js +20 -0
  93. package/dist/src/intl/es.d.ts +24 -1
  94. package/dist/src/intl/es.d.ts.map +1 -1
  95. package/dist/src/intl/es.js +20 -0
  96. package/dist/src/intl/fa.d.ts +24 -1
  97. package/dist/src/intl/fa.d.ts.map +1 -1
  98. package/dist/src/intl/fa.js +20 -0
  99. package/dist/src/intl/fi.d.ts +24 -1
  100. package/dist/src/intl/fi.d.ts.map +1 -1
  101. package/dist/src/intl/fi.js +20 -0
  102. package/dist/src/intl/fil.d.ts +24 -1
  103. package/dist/src/intl/fil.d.ts.map +1 -1
  104. package/dist/src/intl/fil.js +20 -0
  105. package/dist/src/intl/fr.d.ts +24 -1
  106. package/dist/src/intl/fr.d.ts.map +1 -1
  107. package/dist/src/intl/fr.js +20 -0
  108. package/dist/src/intl/he.d.ts +24 -1
  109. package/dist/src/intl/he.d.ts.map +1 -1
  110. package/dist/src/intl/he.js +20 -0
  111. package/dist/src/intl/hi.d.ts +24 -1
  112. package/dist/src/intl/hi.d.ts.map +1 -1
  113. package/dist/src/intl/hi.js +20 -0
  114. package/dist/src/intl/hr.d.ts +24 -1
  115. package/dist/src/intl/hr.d.ts.map +1 -1
  116. package/dist/src/intl/hr.js +20 -0
  117. package/dist/src/intl/hu.d.ts +22 -1
  118. package/dist/src/intl/hu.d.ts.map +1 -1
  119. package/dist/src/intl/hu.js +18 -0
  120. package/dist/src/intl/id.d.ts +24 -1
  121. package/dist/src/intl/id.d.ts.map +1 -1
  122. package/dist/src/intl/id.js +20 -0
  123. package/dist/src/intl/it.d.ts +24 -1
  124. package/dist/src/intl/it.d.ts.map +1 -1
  125. package/dist/src/intl/it.js +20 -0
  126. package/dist/src/intl/ja.d.ts +24 -1
  127. package/dist/src/intl/ja.d.ts.map +1 -1
  128. package/dist/src/intl/ja.js +20 -0
  129. package/dist/src/intl/ko.d.ts +24 -1
  130. package/dist/src/intl/ko.d.ts.map +1 -1
  131. package/dist/src/intl/ko.js +20 -0
  132. package/dist/src/intl/ml.d.ts +24 -1
  133. package/dist/src/intl/ml.d.ts.map +1 -1
  134. package/dist/src/intl/ml.js +20 -0
  135. package/dist/src/intl/mr.d.ts +24 -1
  136. package/dist/src/intl/mr.d.ts.map +1 -1
  137. package/dist/src/intl/mr.js +20 -0
  138. package/dist/src/intl/ms.d.ts +24 -1
  139. package/dist/src/intl/ms.d.ts.map +1 -1
  140. package/dist/src/intl/ms.js +20 -0
  141. package/dist/src/intl/nb.d.ts +22 -1
  142. package/dist/src/intl/nb.d.ts.map +1 -1
  143. package/dist/src/intl/nb.js +18 -0
  144. package/dist/src/intl/nl.d.ts +24 -1
  145. package/dist/src/intl/nl.d.ts.map +1 -1
  146. package/dist/src/intl/nl.js +20 -0
  147. package/dist/src/intl/pa.d.ts +24 -1
  148. package/dist/src/intl/pa.d.ts.map +1 -1
  149. package/dist/src/intl/pa.js +20 -0
  150. package/dist/src/intl/pl.d.ts +23 -0
  151. package/dist/src/intl/pl.d.ts.map +1 -1
  152. package/dist/src/intl/pl.js +20 -0
  153. package/dist/src/intl/pt-BR.d.ts +24 -1
  154. package/dist/src/intl/pt-BR.d.ts.map +1 -1
  155. package/dist/src/intl/pt-BR.js +20 -0
  156. package/dist/src/intl/pt.d.ts +24 -1
  157. package/dist/src/intl/pt.d.ts.map +1 -1
  158. package/dist/src/intl/pt.js +20 -0
  159. package/dist/src/intl/ro.d.ts +24 -1
  160. package/dist/src/intl/ro.d.ts.map +1 -1
  161. package/dist/src/intl/ro.js +20 -0
  162. package/dist/src/intl/sk.d.ts +24 -1
  163. package/dist/src/intl/sk.d.ts.map +1 -1
  164. package/dist/src/intl/sk.js +20 -0
  165. package/dist/src/intl/sl.d.ts +24 -1
  166. package/dist/src/intl/sl.d.ts.map +1 -1
  167. package/dist/src/intl/sl.js +20 -0
  168. package/dist/src/intl/sv.d.ts +24 -1
  169. package/dist/src/intl/sv.d.ts.map +1 -1
  170. package/dist/src/intl/sv.js +20 -0
  171. package/dist/src/intl/sw.d.ts +21 -0
  172. package/dist/src/intl/sw.d.ts.map +1 -1
  173. package/dist/src/intl/sw.js +18 -0
  174. package/dist/src/intl/ta.d.ts +24 -1
  175. package/dist/src/intl/ta.d.ts.map +1 -1
  176. package/dist/src/intl/ta.js +20 -0
  177. package/dist/src/intl/te.d.ts +24 -1
  178. package/dist/src/intl/te.d.ts.map +1 -1
  179. package/dist/src/intl/te.js +20 -0
  180. package/dist/src/intl/th.d.ts +24 -1
  181. package/dist/src/intl/th.d.ts.map +1 -1
  182. package/dist/src/intl/th.js +20 -0
  183. package/dist/src/intl/tr.d.ts +24 -1
  184. package/dist/src/intl/tr.d.ts.map +1 -1
  185. package/dist/src/intl/tr.js +20 -0
  186. package/dist/src/intl/uk.d.ts +80 -57
  187. package/dist/src/intl/uk.d.ts.map +1 -1
  188. package/dist/src/intl/uk.js +174 -149
  189. package/dist/src/intl/ur.d.ts +24 -1
  190. package/dist/src/intl/ur.d.ts.map +1 -1
  191. package/dist/src/intl/ur.js +20 -0
  192. package/dist/src/intl/vi.d.ts +24 -1
  193. package/dist/src/intl/vi.d.ts.map +1 -1
  194. package/dist/src/intl/vi.js +20 -0
  195. package/dist/src/intl/zh-CN.d.ts +24 -1
  196. package/dist/src/intl/zh-CN.d.ts.map +1 -1
  197. package/dist/src/intl/zh-CN.js +20 -0
  198. package/dist/src/intl/zh-TW.d.ts +24 -1
  199. package/dist/src/intl/zh-TW.d.ts.map +1 -1
  200. package/dist/src/intl/zh-TW.js +20 -0
  201. package/dist/src/local-first/Db.d.ts +52 -3
  202. package/dist/src/local-first/Db.d.ts.map +1 -1
  203. package/dist/src/local-first/Db.js +412 -137
  204. package/dist/src/local-first/Evolu.d.ts +336 -211
  205. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  206. package/dist/src/local-first/Evolu.js +102 -15
  207. package/dist/src/local-first/Owner.d.ts +13 -30
  208. package/dist/src/local-first/Owner.d.ts.map +1 -1
  209. package/dist/src/local-first/Owner.js +13 -30
  210. package/dist/src/local-first/Protocol.d.ts +95 -17
  211. package/dist/src/local-first/Protocol.d.ts.map +1 -1
  212. package/dist/src/local-first/Protocol.js +119 -39
  213. package/dist/src/local-first/Query.d.ts +8 -15
  214. package/dist/src/local-first/Query.d.ts.map +1 -1
  215. package/dist/src/local-first/Schema.d.ts +345 -21
  216. package/dist/src/local-first/Schema.d.ts.map +1 -1
  217. package/dist/src/local-first/Schema.js +214 -17
  218. package/dist/src/local-first/Shared.d.ts +537 -22
  219. package/dist/src/local-first/Shared.d.ts.map +1 -1
  220. package/dist/src/local-first/Shared.js +1437 -234
  221. package/dist/src/local-first/Storage.d.ts +192 -14
  222. package/dist/src/local-first/Storage.d.ts.map +1 -1
  223. package/dist/src/local-first/Storage.js +82 -21
  224. package/dist/src/local-first/Timestamp.d.ts +392 -41
  225. package/dist/src/local-first/Timestamp.d.ts.map +1 -1
  226. package/dist/src/local-first/Timestamp.js +404 -82
  227. package/dist/src/local-first/index.d.ts +0 -1
  228. package/dist/src/local-first/index.d.ts.map +1 -1
  229. package/dist/src/local-first/index.js +0 -1
  230. package/package.json +1 -1
  231. package/src/Assert.test.ts +2 -5
  232. package/src/{Binary.test.ts → Bytes.test.ts} +286 -1
  233. package/src/{Binary.ts → Bytes.ts} +652 -21
  234. package/src/Config.test.ts +668 -0
  235. package/src/Config.ts +410 -0
  236. package/src/Console.ts +62 -7
  237. package/src/Crypto.ts +76 -4
  238. package/src/Eq.test.ts +2 -3
  239. package/src/Error.test.ts +76 -3
  240. package/src/Error.ts +71 -0
  241. package/src/Fs.test.ts +105 -0
  242. package/src/Fs.ts +488 -0
  243. package/src/Identicon.ts +2 -2
  244. package/src/LeakDetector.ts +22 -3
  245. package/src/LockManager.ts +8 -0
  246. package/src/Number.test.ts +82 -18
  247. package/src/Number.ts +76 -8
  248. package/src/Object.test.ts +139 -10
  249. package/src/Object.ts +49 -0
  250. package/src/Platform.ts +50 -8
  251. package/src/Random.ts +25 -2
  252. package/src/Resource.test.ts +837 -0
  253. package/src/Resource.ts +235 -15
  254. package/src/Schedule.test.ts +50 -12
  255. package/src/Schedule.ts +24 -14
  256. package/src/Sqlite.ts +138 -18
  257. package/src/Task.test.ts +189 -8
  258. package/src/Task.ts +56 -17
  259. package/src/Test.ts +9 -0
  260. package/src/Time.test.ts +82 -11
  261. package/src/Time.ts +246 -24
  262. package/src/Type.test.ts +3994 -1119
  263. package/src/Type.ts +7258 -3842
  264. package/src/Types.test.ts +4 -14
  265. package/src/WebSocket.ts +313 -40
  266. package/src/Worker.ts +90 -8
  267. package/src/index.ts +18 -7
  268. package/src/intl/_en.ts +70 -0
  269. package/src/intl/ar.ts +71 -0
  270. package/src/intl/bn.ts +70 -0
  271. package/src/intl/ca.ts +70 -0
  272. package/src/intl/cs.ts +70 -0
  273. package/src/intl/da.ts +70 -0
  274. package/src/intl/de.ts +70 -0
  275. package/src/intl/el.ts +70 -0
  276. package/src/intl/es.ts +70 -0
  277. package/src/intl/fa.ts +70 -0
  278. package/src/intl/fi.ts +70 -0
  279. package/src/intl/fil.ts +70 -0
  280. package/src/intl/fr.ts +70 -0
  281. package/src/intl/he.ts +70 -0
  282. package/src/intl/hi.ts +70 -0
  283. package/src/intl/hr.ts +70 -0
  284. package/src/intl/hu.ts +69 -0
  285. package/src/intl/id.ts +70 -0
  286. package/src/intl/intl.test.ts +819 -1
  287. package/src/intl/it.ts +70 -0
  288. package/src/intl/ja.ts +70 -0
  289. package/src/intl/ko.ts +68 -0
  290. package/src/intl/ml.ts +70 -0
  291. package/src/intl/mr.ts +70 -0
  292. package/src/intl/ms.ts +71 -0
  293. package/src/intl/nb.ts +69 -0
  294. package/src/intl/nl.ts +70 -0
  295. package/src/intl/pa.ts +70 -0
  296. package/src/intl/pl.ts +63 -0
  297. package/src/intl/pt-BR.ts +70 -0
  298. package/src/intl/pt.ts +71 -0
  299. package/src/intl/ro.ts +70 -0
  300. package/src/intl/sk.ts +71 -0
  301. package/src/intl/sl.ts +70 -0
  302. package/src/intl/sv.ts +70 -0
  303. package/src/intl/sw.ts +62 -0
  304. package/src/intl/ta.ts +70 -0
  305. package/src/intl/te.ts +70 -0
  306. package/src/intl/th.ts +68 -0
  307. package/src/intl/tr.ts +70 -0
  308. package/src/intl/uk.ts +228 -155
  309. package/src/intl/ur.ts +70 -0
  310. package/src/intl/vi.ts +70 -0
  311. package/src/intl/zh-CN.ts +68 -0
  312. package/src/intl/zh-TW.ts +68 -0
  313. package/src/local-first/Db.ts +644 -339
  314. package/src/local-first/Evolu.test.ts +686 -21
  315. package/src/local-first/Evolu.ts +450 -228
  316. package/src/local-first/Owner.ts +13 -30
  317. package/src/local-first/Protocol.test.ts +618 -11
  318. package/src/local-first/Protocol.ts +197 -73
  319. package/src/local-first/Query.ts +8 -15
  320. package/src/local-first/Schema.test.ts +143 -0
  321. package/src/local-first/Schema.ts +374 -24
  322. package/src/local-first/Shared.test.ts +7731 -559
  323. package/src/local-first/Shared.ts +2036 -267
  324. package/src/local-first/Storage.ts +219 -33
  325. package/src/local-first/Timestamp.test.ts +344 -70
  326. package/src/local-first/Timestamp.ts +435 -119
  327. package/src/local-first/index.ts +0 -1
  328. package/dist/src/Binary.d.ts +0 -254
  329. package/dist/src/Binary.d.ts.map +0 -1
  330. package/dist/src/local-first/Error.d.ts +0 -12
  331. package/dist/src/local-first/Error.d.ts.map +0 -1
  332. package/dist/src/local-first/Error.js +0 -6
  333. package/dist/src/local-first/LocalAuth.d.ts +0 -150
  334. package/dist/src/local-first/LocalAuth.d.ts.map +0 -1
  335. package/dist/src/local-first/LocalAuth.js +0 -179
  336. package/src/local-first/Error.ts +0 -17
  337. package/src/local-first/LocalAuth.ts +0 -457
@@ -15,6 +15,8 @@ import { type ArrayType, type InferType, type Name, type ObjectType, type Record
15
15
  * API is synchronous because it provides
16
16
  * {@link https://github.com/WiseLibs/better-sqlite3/issues/262 | better concurrency}
17
17
  * for SQLite.
18
+ *
19
+ * @group Core
18
20
  */
19
21
  export interface Sqlite extends AsyncDisposable {
20
22
  readonly exec: <R extends SqliteRow = SqliteRow>(query: SqliteQuery) => SqliteExecResult<R>;
@@ -37,22 +39,44 @@ export interface Sqlite extends AsyncDisposable {
37
39
  */
38
40
  readonly export: () => Uint8Array<ArrayBuffer>;
39
41
  }
42
+ /**
43
+ * Dependency wrapper for {@link Sqlite}.
44
+ *
45
+ * @group Core
46
+ */
40
47
  export interface SqliteDep {
41
48
  readonly sqlite: Sqlite;
42
49
  }
50
+ /**
51
+ * Runs a callback inside a SQLite transaction.
52
+ *
53
+ * @group Core
54
+ */
43
55
  export interface SqliteTransaction {
44
56
  <T, E>(callback: () => Result<T, E>): Result<T, E>;
45
57
  (callback: () => void): void;
46
58
  }
47
- /** Represents a SQL query to be executed on a {@link Sqlite} database. */
59
+ /**
60
+ * Represents a SQL query to be executed on a {@link Sqlite} database.
61
+ *
62
+ * @group Queries
63
+ */
48
64
  export interface SqliteQuery {
49
65
  readonly sql: SafeSql;
50
66
  readonly parameters: SqliteQueryParameters;
51
67
  readonly options?: SqliteQueryOptions;
52
68
  }
53
- /** Serialized {@link SqliteQuery} used as a stable string key. */
69
+ /**
70
+ * Serialized {@link SqliteQuery} used as a stable string key.
71
+ *
72
+ * @group Queries
73
+ */
54
74
  export type SqliteQueryString = string & Brand<"SqliteQueryString">;
55
- /** A sanitized SQL string for {@link SqliteQuery}. */
75
+ /**
76
+ * A sanitized SQL string for {@link SqliteQuery}.
77
+ *
78
+ * @group Queries
79
+ */
56
80
  export type SafeSql = string & Brand<"SafeSql">;
57
81
  /**
58
82
  * A value that can be stored in {@link Sqlite}.
@@ -64,10 +88,16 @@ export type SafeSql = string & Brand<"SafeSql">;
64
88
  *
65
89
  * Note that Evolu can't support Int64 because expo-sqlite (and some others) do
66
90
  * not support it.
91
+ *
92
+ * @group Values
67
93
  */
68
94
  export declare const SqliteValue: import("./Type.ts").UnionType<readonly [import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").Type<"Number", number, number, import("./Type.ts").TypeOfError<"Number">, null, import("./Type.ts").TypeOfError<"Number">, never, number, true>, "NonNaN", import("./Type.ts").NonNaNError>, "Finite", import("./Type.ts").FiniteError>, import("./Type.ts").LiteralType<null>, import("./Type.ts").Type<"String", string, string, import("./Type.ts").TypeOfError<"String">, null, import("./Type.ts").TypeOfError<"String">, never, string, true>, import("./Type.ts").Type<"Uint8Array", Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, import("./Type.ts").ObjectTagError<"Uint8Array">, null, import("./Type.ts").ObjectTagError<"Uint8Array">, never, Uint8Array<ArrayBufferLike>, true>]>;
69
95
  export type SqliteValue = typeof SqliteValue.Output;
70
- /** Parameters of a {@link SqliteQuery}. */
96
+ /**
97
+ * Parameters of a {@link SqliteQuery}.
98
+ *
99
+ * @group Queries
100
+ */
71
101
  export declare const SqliteQueryParameters: ArrayType<import("./Type.ts").UnionType<readonly [import("./Type.ts").BrandType<import("./Type.ts").BrandType<import("./Type.ts").Type<"Number", number, number, import("./Type.ts").TypeOfError<"Number">, null, import("./Type.ts").TypeOfError<"Number">, never, number, true>, "NonNaN", import("./Type.ts").NonNaNError>, "Finite", import("./Type.ts").FiniteError>, import("./Type.ts").LiteralType<null>, import("./Type.ts").Type<"String", string, string, import("./Type.ts").TypeOfError<"String">, null, import("./Type.ts").TypeOfError<"String">, never, string, true>, import("./Type.ts").Type<"Uint8Array", Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, import("./Type.ts").ObjectTagError<"Uint8Array">, null, import("./Type.ts").ObjectTagError<"Uint8Array">, never, Uint8Array<ArrayBufferLike>, true>]>>;
72
102
  export type SqliteQueryParameters = typeof SqliteQueryParameters.Output;
73
103
  /**
@@ -76,11 +106,21 @@ export type SqliteQueryParameters = typeof SqliteQueryParameters.Output;
76
106
  *
77
107
  * It differs from {@link SqliteValue} only by using `number` instead of
78
108
  * {@link FiniteNumber}.
109
+ *
110
+ * @group Values
79
111
  */
80
112
  export type SqliteValueInput = typeof SqliteValue.Input;
81
- /** Equality comparison for {@link SqliteValueInput}. */
113
+ /**
114
+ * Equality comparison for {@link SqliteValueInput}.
115
+ *
116
+ * @group Values
117
+ */
82
118
  export declare const eqSqliteValue: Eq<SqliteValueInput>;
83
- /** Options for configuring {@link SqliteQuery} execution behavior. */
119
+ /**
120
+ * Options for configuring {@link SqliteQuery} execution behavior.
121
+ *
122
+ * @group Queries
123
+ */
84
124
  export interface SqliteQueryOptions {
85
125
  /**
86
126
  * If set to `true`, logs the time taken to execute the SQL query. Useful for
@@ -104,24 +144,41 @@ export interface SqliteQueryOptions {
104
144
  */
105
145
  readonly prepare?: boolean;
106
146
  }
107
- /** Converts a {@link SqliteQuery} into a stable {@link SqliteQueryString}. */
147
+ /**
148
+ * Converts a {@link SqliteQuery} into a stable {@link SqliteQueryString}.
149
+ *
150
+ * @group Queries
151
+ */
108
152
  export declare const sqliteQueryToSqliteQueryString: (query: SqliteQuery) => SqliteQueryString;
109
- /** Converts a {@link SqliteQueryString} back into a {@link SqliteQuery}. */
153
+ /**
154
+ * Converts a {@link SqliteQueryString} back into a {@link SqliteQuery}.
155
+ *
156
+ * @group Queries
157
+ */
110
158
  export declare const sqliteQueryStringToSqliteQuery: (query: SqliteQueryString) => SqliteQuery;
111
- /** Result of executing a SQLite query. */
159
+ /**
160
+ * Result of executing a SQLite query.
161
+ *
162
+ * @group Queries
163
+ */
112
164
  export interface SqliteExecResult<R extends SqliteRow = SqliteRow> {
113
165
  readonly rows: ReadonlyArray<R>;
166
+ /** The number of rows an insert, update, or delete statement changed. */
114
167
  readonly changes: number;
115
168
  }
116
169
  /**
117
170
  * A row returned from a {@link Sqlite} query, mapping column names to
118
171
  * {@link SqliteValueInput}.
172
+ *
173
+ * @group Values
119
174
  */
120
175
  export type SqliteRow = Record<string, SqliteValueInput>;
121
176
  /**
122
177
  * SQLite driver interface.
123
178
  *
124
179
  * Platform-specific drivers must implement this interface.
180
+ *
181
+ * @group Core
125
182
  */
126
183
  export interface SqliteDriver extends Disposable {
127
184
  readonly exec: (query: SqliteQuery) => SqliteExecResult;
@@ -135,8 +192,17 @@ export interface SqliteDriver extends Disposable {
135
192
  */
136
193
  readonly export: () => Uint8Array<ArrayBuffer>;
137
194
  }
138
- /** Creates a {@link SqliteDriver}. */
195
+ /**
196
+ * Creates a {@link SqliteDriver}.
197
+ *
198
+ * @group Core
199
+ */
139
200
  export type CreateSqliteDriver = (name: Name, options?: SqliteDriverOptions) => Task<SqliteDriver>;
201
+ /**
202
+ * Dependency wrapper for {@link CreateSqliteDriver}.
203
+ *
204
+ * @group Core
205
+ */
140
206
  export interface CreateSqliteDriverDep {
141
207
  createSqliteDriver: CreateSqliteDriver;
142
208
  }
@@ -145,6 +211,8 @@ export interface CreateSqliteDriverDep {
145
211
  *
146
212
  * Three mutually exclusive modes: in-memory (for testing), encrypted persistent
147
213
  * (OPFS/file with encryption key), or persistent (default when omitted).
214
+ *
215
+ * @group Core
148
216
  */
149
217
  export type SqliteDriverOptions = {
150
218
  readonly mode: "memory";
@@ -157,15 +225,23 @@ export type SqliteDriverOptions = {
157
225
  *
158
226
  * The driver is created via {@link CreateSqliteDriver} and wrapped with logging,
159
227
  * error handling, and transaction helpers.
228
+ *
229
+ * @group Core
160
230
  */
161
231
  export declare const createSqlite: (name: Name, options?: SqliteDriverOptions) => Task<Sqlite, never, CreateSqliteDriverDep>;
162
- /** Creates a test setup with a in-memory {@link Sqlite}. */
232
+ /**
233
+ * Creates a test setup with a in-memory {@link Sqlite}.
234
+ *
235
+ * @group Testing
236
+ */
163
237
  export declare const testSetupSqlite: (deps: CreateSqliteDriverDep) => Promise<AsyncDisposable & SqliteDep & TestRunDep<CreateSqliteDriverDep & SqliteDep>>;
164
238
  /**
165
239
  * Cache for compiled prepared statements.
166
240
  *
167
241
  * Statements are created on first access and reused for subsequent calls with
168
242
  * the same SQL. Disposing the cache finalizes all cached statements.
243
+ *
244
+ * @group Core
169
245
  */
170
246
  export interface PreparedStatements<P> extends Disposable {
171
247
  readonly get: <T extends boolean>(query: SqliteQuery, alwaysPrepare?: T) => T extends true ? P : P | null;
@@ -173,9 +249,15 @@ export interface PreparedStatements<P> extends Disposable {
173
249
  /**
174
250
  * Creates a {@link PreparedStatements} cache backed by the given factory and
175
251
  * dispose function.
252
+ *
253
+ * @group Core
176
254
  */
177
255
  export declare const createPreparedStatementsCache: <P>(factory: (sql: SafeSql) => P, disposeFn: (statement: P) => void) => PreparedStatements<P>;
178
- /** A double-quoted SQL identifier for safe column or table name interpolation. */
256
+ /**
257
+ * A double-quoted SQL identifier for safe column or table name interpolation.
258
+ *
259
+ * @group Queries
260
+ */
179
261
  export interface SqlIdentifier extends Typed<"SqlIdentifier"> {
180
262
  readonly sql: SafeSql;
181
263
  }
@@ -183,11 +265,17 @@ export interface SqlIdentifier extends Typed<"SqlIdentifier"> {
183
265
  * An unescaped SQL fragment inserted verbatim into a query.
184
266
  *
185
267
  * **Warning**: Use only with trusted, constant strings to avoid SQL injection.
268
+ *
269
+ * @group Queries
186
270
  */
187
271
  export interface RawSql extends Typed<"RawSql"> {
188
272
  readonly sql: string;
189
273
  }
190
- /** A parameter accepted by the {@link sql} tagged template. */
274
+ /**
275
+ * A parameter accepted by the {@link sql} tagged template.
276
+ *
277
+ * @group Queries
278
+ */
191
279
  export type SqlTemplateParam = SqliteValueInput | SqlIdentifier | RawSql;
192
280
  export declare function sql(strings: TemplateStringsArray, ...parameters: Array<SqlTemplateParam>): SqliteQuery;
193
281
  export declare namespace sql {
@@ -195,19 +283,29 @@ export declare namespace sql {
195
283
  var raw: (raw: string) => RawSql;
196
284
  var prepared: (strings: TemplateStringsArray, ...parameters: Array<SqlTemplateParam>) => SqliteQuery;
197
285
  }
198
- /** Index metadata stored in `sqlite_master` for a {@link Sqlite} database. */
286
+ /**
287
+ * Index metadata stored in `sqlite_master` for a {@link Sqlite} database.
288
+ *
289
+ * @group Schema
290
+ */
199
291
  export declare const SqliteIndex: ObjectType<{
200
292
  readonly name: typeof String;
201
293
  readonly sql: typeof String;
202
294
  }>;
203
295
  export interface SqliteIndex extends InferType<typeof SqliteIndex> {
204
296
  }
205
- /** {@link Eq} instance for {@link SqliteIndex}. */
297
+ /**
298
+ * {@link Eq} instance for {@link SqliteIndex}.
299
+ *
300
+ * @group Schema
301
+ */
206
302
  export declare const eqSqliteIndex: Eq<SqliteIndex>;
207
303
  /**
208
304
  * Full schema metadata for a {@link Sqlite} database.
209
305
  *
210
306
  * Includes table-column mappings and user-visible indexes.
307
+ *
308
+ * @group Schema
211
309
  */
212
310
  export declare const SqliteSchema: ObjectType<{
213
311
  readonly tables: RecordType<typeof String, SetType<typeof String>>;
@@ -215,7 +313,11 @@ export declare const SqliteSchema: ObjectType<{
215
313
  }>;
216
314
  export interface SqliteSchema extends InferType<typeof SqliteSchema> {
217
315
  }
218
- /** Get the current SQLite schema by reading SQLite metadata. */
316
+ /**
317
+ * Get the current SQLite schema by reading SQLite metadata.
318
+ *
319
+ * @group Schema
320
+ */
219
321
  export declare const getSqliteSchema: (deps: SqliteDep) => ({ excludeIndexNamePrefix, }?: {
220
322
  /**
221
323
  * If provided, indexes with names starting with this prefix are excluded in
@@ -226,6 +328,8 @@ export declare const getSqliteSchema: (deps: SqliteDep) => ({ excludeIndexNamePr
226
328
  /**
227
329
  * Returns {@link SqliteSchema} and full {@link SqliteRow} table contents for
228
330
  * inspection and testing.
331
+ *
332
+ * @group Schema
229
333
  */
230
334
  export interface SqliteSnapshot {
231
335
  readonly schema: SqliteSchema;
@@ -239,6 +343,8 @@ export interface SqliteSnapshot {
239
343
  *
240
344
  * The snapshot includes current {@link SqliteSchema} and all rows from every
241
345
  * discovered table. Table order follows `schema.tables` iteration order.
346
+ *
347
+ * @group Schema
242
348
  */
243
349
  export declare const getSqliteSnapshot: (deps: SqliteDep) => SqliteSnapshot;
244
350
  /**
@@ -251,6 +357,8 @@ export declare const getSqliteSnapshot: (deps: SqliteDep) => SqliteSnapshot;
251
357
  * readability.
252
358
  * - Use {@link booleanToSqliteBoolean} and {@link sqliteBooleanToBoolean} for
253
359
  * converting between JavaScript booleans and SQLite boolean values.
360
+ *
361
+ * @group Values
254
362
  */
255
363
  export declare const SqliteBoolean: import("./Type.ts").UnionType<readonly [import("./Type.ts").LiteralType<0>, import("./Type.ts").LiteralType<1>]>;
256
364
  export type SqliteBoolean = typeof SqliteBoolean.Output;
@@ -258,12 +366,16 @@ export type SqliteBoolean = typeof SqliteBoolean.Output;
258
366
  * Represents the {@link SqliteBoolean} value for `true`.
259
367
  *
260
368
  * See {@link SqliteBoolean}.
369
+ *
370
+ * @group Values
261
371
  */
262
372
  export declare const sqliteTrue = 1;
263
373
  /**
264
374
  * Represents the {@link SqliteBoolean} value for `false`.
265
375
  *
266
376
  * See {@link SqliteBoolean}.
377
+ *
378
+ * @group Values
267
379
  */
268
380
  export declare const sqliteFalse = 0;
269
381
  /**
@@ -276,6 +388,8 @@ export declare const sqliteFalse = 0;
276
388
  *
277
389
  * assertEqual(booleanToSqliteBoolean(true), 1);
278
390
  * ```
391
+ *
392
+ * @group Values
279
393
  */
280
394
  export declare const booleanToSqliteBoolean: (value: boolean) => SqliteBoolean;
281
395
  /**
@@ -288,6 +402,8 @@ export declare const booleanToSqliteBoolean: (value: boolean) => SqliteBoolean;
288
402
  *
289
403
  * assertTrue(sqliteBooleanToBoolean(1));
290
404
  * ```
405
+ *
406
+ * @group Values
291
407
  */
292
408
  export declare const sqliteBooleanToBoolean: (value: SqliteBoolean) => boolean;
293
409
  //# sourceMappingURL=Sqlite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sqlite.d.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ACpC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,MAAM,EAAE,OAAO,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,WAAW,CAAC,CAAC;CACjD,CAGC,CAAC;AACH,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,OAAO,YAAY,CAAC;CAAG;AAEvE;;;;GAIG;AACH,eAAO,MAAM,eAAe,SACnB,SAAS,oCAGb;IACD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,KAAQ,YAiDR,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;QACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACzC,CAAC,CAAC;CACJ;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,SAAU,SAAS,KAAG,cAiBnD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,kHAA4B,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,UAAW,OAAO,KAAG,aACtB,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,UAAW,aAAa,KAAG,OACxC,CAAC"}
@@ -55,7 +55,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
55
55
  var e = new Error(message);
56
56
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
57
  });
58
- import { bytesToHex, hexToBytes } from "./Binary.js";
58
+ import { bytesToHex, hexToBytes } from "./Bytes.js";
59
59
  import { createEqObject, eqString, eqUint8Array } from "./Eq.js";
60
60
  import { disposable } from "./Function.js";
61
61
  import { createMutableRecord, objectToEntries } from "./Object.js";
@@ -72,13 +72,27 @@ import { array, FiniteNumber, Null, object, record, set, String, testName, Uint8
72
72
  *
73
73
  * Note that Evolu can't support Int64 because expo-sqlite (and some others) do
74
74
  * not support it.
75
+ *
76
+ * @group Values
75
77
  */
76
78
  export const SqliteValue = /*#__PURE__*/ union(FiniteNumber, Null, String, Uint8Array);
77
- /** Parameters of a {@link SqliteQuery}. */
79
+ /**
80
+ * Parameters of a {@link SqliteQuery}.
81
+ *
82
+ * @group Queries
83
+ */
78
84
  export const SqliteQueryParameters = /*#__PURE__*/ array(SqliteValue);
79
- /** Equality comparison for {@link SqliteValueInput}. */
85
+ /**
86
+ * Equality comparison for {@link SqliteValueInput}.
87
+ *
88
+ * @group Values
89
+ */
80
90
  export const eqSqliteValue = (x, y) => Uint8Array.is(x) && Uint8Array.is(y) ? eqUint8Array(x, y) : x === y;
81
- /** Converts a {@link SqliteQuery} into a stable {@link SqliteQueryString}. */
91
+ /**
92
+ * Converts a {@link SqliteQuery} into a stable {@link SqliteQueryString}.
93
+ *
94
+ * @group Queries
95
+ */
82
96
  export const sqliteQueryToSqliteQueryString = (query) => {
83
97
  const params = query.parameters.map((value) => Uint8Array.is(value)
84
98
  ? ["b", bytesToHex(value)]
@@ -88,7 +102,11 @@ export const sqliteQueryToSqliteQueryString = (query) => {
88
102
  : [];
89
103
  return JSON.stringify([query.sql, params, options]);
90
104
  };
91
- /** Converts a {@link SqliteQueryString} back into a {@link SqliteQuery}. */
105
+ /**
106
+ * Converts a {@link SqliteQueryString} back into a {@link SqliteQuery}.
107
+ *
108
+ * @group Queries
109
+ */
92
110
  export const sqliteQueryStringToSqliteQuery = (query) => {
93
111
  const [sql, paramsArr, optionsArr] = JSON.parse(query);
94
112
  const parameters = paramsArr.map(([type, value]) => type === "b" ? hexToBytes(value) : value);
@@ -106,6 +124,8 @@ export const sqliteQueryStringToSqliteQuery = (query) => {
106
124
  *
107
125
  * The driver is created via {@link CreateSqliteDriver} and wrapped with logging,
108
126
  * error handling, and transaction helpers.
127
+ *
128
+ * @group Core
109
129
  */
110
130
  export const createSqlite = (name, options) => async (run) => {
111
131
  const env_1 = { stack: [], error: void 0, hasError: false };
@@ -179,7 +199,11 @@ export const createSqlite = (name, options) => async (run) => {
179
199
  await result_1;
180
200
  }
181
201
  };
182
- /** Creates a test setup with a in-memory {@link Sqlite}. */
202
+ /**
203
+ * Creates a test setup with a in-memory {@link Sqlite}.
204
+ *
205
+ * @group Testing
206
+ */
183
207
  export const testSetupSqlite = async (deps) => {
184
208
  const env_3 = { stack: [], error: void 0, hasError: false };
185
209
  try {
@@ -223,6 +247,8 @@ const drawSqliteQueryPlan = (rows) => rows
223
247
  /**
224
248
  * Creates a {@link PreparedStatements} cache backed by the given factory and
225
249
  * dispose function.
250
+ *
251
+ * @group Core
226
252
  */
227
253
  export const createPreparedStatementsCache = (factory, disposeFn) => {
228
254
  const env_4 = { stack: [], error: void 0, hasError: false };
@@ -312,6 +338,8 @@ export const createPreparedStatementsCache = (factory, disposeFn) => {
312
338
  * Use `prettier-plugin-sql-cst` for SQL formatting. Like Prettier for
313
339
  * JavaScript, this plugin formats SQL expressions differently depending on
314
340
  * their length.
341
+ *
342
+ * @group Queries
315
343
  */
316
344
  export const sql = (strings, ...parameters) => {
317
345
  let sql = "";
@@ -325,7 +353,7 @@ export const sql = (strings, ...parameters) => {
325
353
  }
326
354
  else {
327
355
  sql += "?";
328
- values.push(SqliteValue.orThrow(param));
356
+ values.push(typeof param === "number" ? FiniteNumber.orThrow(param) : param);
329
357
  }
330
358
  }
331
359
  }
@@ -348,9 +376,17 @@ sql.prepared = (strings, ...parameters) => {
348
376
  const query = sql(strings, ...parameters);
349
377
  return { ...query, options: { prepare: true } };
350
378
  };
351
- /** Index metadata stored in `sqlite_master` for a {@link Sqlite} database. */
379
+ /**
380
+ * Index metadata stored in `sqlite_master` for a {@link Sqlite} database.
381
+ *
382
+ * @group Schema
383
+ */
352
384
  export const SqliteIndex = /*#__PURE__*/ object({ name: String, sql: String });
353
- /** {@link Eq} instance for {@link SqliteIndex}. */
385
+ /**
386
+ * {@link Eq} instance for {@link SqliteIndex}.
387
+ *
388
+ * @group Schema
389
+ */
354
390
  export const eqSqliteIndex = /*#__PURE__*/ createEqObject({
355
391
  name: eqString,
356
392
  sql: eqString,
@@ -359,12 +395,18 @@ export const eqSqliteIndex = /*#__PURE__*/ createEqObject({
359
395
  * Full schema metadata for a {@link Sqlite} database.
360
396
  *
361
397
  * Includes table-column mappings and user-visible indexes.
398
+ *
399
+ * @group Schema
362
400
  */
363
401
  export const SqliteSchema = /*#__PURE__*/ object({
364
402
  tables: /*#__PURE__*/ record(String, /*#__PURE__*/ set(String)),
365
403
  indexes: /*#__PURE__*/ array(SqliteIndex),
366
404
  });
367
- /** Get the current SQLite schema by reading SQLite metadata. */
405
+ /**
406
+ * Get the current SQLite schema by reading SQLite metadata.
407
+ *
408
+ * @group Schema
409
+ */
368
410
  export const getSqliteSchema = (deps) => ({ excludeIndexNamePrefix, } = {}) => {
369
411
  const tables = createMutableRecord();
370
412
  const tableAndColumnInfoRows = deps.sqlite.exec(sql `
@@ -408,6 +450,8 @@ export const getSqliteSchema = (deps) => ({ excludeIndexNamePrefix, } = {}) => {
408
450
  *
409
451
  * The snapshot includes current {@link SqliteSchema} and all rows from every
410
452
  * discovered table. Table order follows `schema.tables` iteration order.
453
+ *
454
+ * @group Schema
411
455
  */
412
456
  export const getSqliteSnapshot = (deps) => {
413
457
  const schema = getSqliteSchema(deps)();
@@ -433,18 +477,24 @@ export const getSqliteSnapshot = (deps) => {
433
477
  * readability.
434
478
  * - Use {@link booleanToSqliteBoolean} and {@link sqliteBooleanToBoolean} for
435
479
  * converting between JavaScript booleans and SQLite boolean values.
480
+ *
481
+ * @group Values
436
482
  */
437
483
  export const SqliteBoolean = /*#__PURE__*/ union(0, 1);
438
484
  /**
439
485
  * Represents the {@link SqliteBoolean} value for `true`.
440
486
  *
441
487
  * See {@link SqliteBoolean}.
488
+ *
489
+ * @group Values
442
490
  */
443
491
  export const sqliteTrue = 1;
444
492
  /**
445
493
  * Represents the {@link SqliteBoolean} value for `false`.
446
494
  *
447
495
  * See {@link SqliteBoolean}.
496
+ *
497
+ * @group Values
448
498
  */
449
499
  export const sqliteFalse = 0;
450
500
  /**
@@ -457,6 +507,8 @@ export const sqliteFalse = 0;
457
507
  *
458
508
  * assertEqual(booleanToSqliteBoolean(true), 1);
459
509
  * ```
510
+ *
511
+ * @group Values
460
512
  */
461
513
  export const booleanToSqliteBoolean = (value) => value ? sqliteTrue : sqliteFalse;
462
514
  /**
@@ -469,5 +521,7 @@ export const booleanToSqliteBoolean = (value) => value ? sqliteTrue : sqliteFals
469
521
  *
470
522
  * assertTrue(sqliteBooleanToBoolean(1));
471
523
  * ```
524
+ *
525
+ * @group Values
472
526
  */
473
527
  export const sqliteBooleanToBoolean = (value) => value === sqliteTrue;
@@ -1314,9 +1314,19 @@ export interface Run<D = unknown> {
1314
1314
  * ```
1315
1315
  */
1316
1316
  readonly onAbort: (callback: (abortError: AbortError) => void) => Disposable | null;
1317
- /** Returns the current {@link RunState} of this {@link Run}. */
1317
+ /**
1318
+ * Returns the current {@link RunState} of this {@link Run}.
1319
+ *
1320
+ * Abort requests are recorded before propagating to descendants. Observed
1321
+ * aborts are recorded before this Run's abort callbacks execute.
1322
+ */
1318
1323
  readonly getState: () => RunState;
1319
- /** Creates a memoized recursive {@link RunSnapshot} of the current Run tree. */
1324
+ /**
1325
+ * Creates a memoized recursive {@link RunSnapshot} of the current Run tree.
1326
+ *
1327
+ * Reflects abort requests and observations with the same timing as
1328
+ * {@link Run.getState}.
1329
+ */
1320
1330
  readonly snapshot: () => RunSnapshot;
1321
1331
  /**
1322
1332
  * Callback for monitoring Run events emitted by this Run or descendants.
@@ -1867,8 +1877,9 @@ export interface ReportDefectDep {
1867
1877
  * platforms without native global error reporting. Browser adapters use the
1868
1878
  * native
1869
1879
  * {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/reportError | reportError}
1870
- * API; other platform adapters can use platform-specific reporting and preserve
1871
- * nested panic defects as cause or detail data.
1880
+ * API, and other platform adapters can use platform-specific reporting.
1881
+ * Adapters report an `Error` from {@link defectToError}, which such reporting
1882
+ * shows readably.
1872
1883
  *
1873
1884
  * @group Run
1874
1885
  */