@evolu/common 8.4.0 → 8.6.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 (353) hide show
  1. package/dist/src/Array.d.ts +191 -94
  2. package/dist/src/Array.d.ts.map +1 -1
  3. package/dist/src/Array.js +91 -40
  4. package/dist/src/Assert.d.ts +233 -30
  5. package/dist/src/Assert.d.ts.map +1 -1
  6. package/dist/src/Assert.js +151 -30
  7. package/dist/src/BigInt.d.ts +3 -3
  8. package/dist/src/BigInt.js +3 -3
  9. package/dist/src/Brand.d.ts +7 -7
  10. package/dist/src/Buffer.d.ts +12 -4
  11. package/dist/src/Buffer.d.ts.map +1 -1
  12. package/dist/src/Cache.d.ts +8 -3
  13. package/dist/src/Cache.d.ts.map +1 -1
  14. package/dist/src/Cache.js +8 -3
  15. package/dist/src/Callbacks.d.ts +8 -4
  16. package/dist/src/Callbacks.d.ts.map +1 -1
  17. package/dist/src/Console.d.ts +45 -30
  18. package/dist/src/Console.d.ts.map +1 -1
  19. package/dist/src/Console.js +32 -21
  20. package/dist/src/Crypto.d.ts +13 -8
  21. package/dist/src/Crypto.d.ts.map +1 -1
  22. package/dist/src/Crypto.js +6 -3
  23. package/dist/src/Eq.d.ts +107 -58
  24. package/dist/src/Eq.d.ts.map +1 -1
  25. package/dist/src/Eq.js +308 -112
  26. package/dist/src/Function.d.ts +54 -24
  27. package/dist/src/Function.d.ts.map +1 -1
  28. package/dist/src/Function.js +34 -17
  29. package/dist/src/Http.d.ts +52 -19
  30. package/dist/src/Http.d.ts.map +1 -1
  31. package/dist/src/Identicon.d.ts +9 -4
  32. package/dist/src/Identicon.d.ts.map +1 -1
  33. package/dist/src/Identicon.js +9 -4
  34. package/dist/src/LeakDetector.d.ts.map +1 -1
  35. package/dist/src/LeakDetector.js +4 -1
  36. package/dist/src/LockManager.d.ts +12 -10
  37. package/dist/src/LockManager.d.ts.map +1 -1
  38. package/dist/src/Lookup.d.ts +4 -2
  39. package/dist/src/Lookup.d.ts.map +1 -1
  40. package/dist/src/Lookup.js +5 -2
  41. package/dist/src/Number.d.ts +28 -24
  42. package/dist/src/Number.d.ts.map +1 -1
  43. package/dist/src/Number.js +16 -17
  44. package/dist/src/Object.d.ts +89 -47
  45. package/dist/src/Object.d.ts.map +1 -1
  46. package/dist/src/Object.js +88 -41
  47. package/dist/src/Option.d.ts +14 -5
  48. package/dist/src/Option.d.ts.map +1 -1
  49. package/dist/src/Option.js +14 -5
  50. package/dist/src/Order.d.ts +12 -12
  51. package/dist/src/Order.js +12 -12
  52. package/dist/src/Platform.d.ts +2 -2
  53. package/dist/src/Platform.js +1 -0
  54. package/dist/src/Random.d.ts +7 -4
  55. package/dist/src/Random.d.ts.map +1 -1
  56. package/dist/src/Redacted.d.ts +13 -6
  57. package/dist/src/Redacted.d.ts.map +1 -1
  58. package/dist/src/Redacted.js +4 -2
  59. package/dist/src/Ref.d.ts +4 -4
  60. package/dist/src/Relation.d.ts +5 -7
  61. package/dist/src/Relation.d.ts.map +1 -1
  62. package/dist/src/Relation.js +3 -3
  63. package/dist/src/Resource.d.ts +27 -12
  64. package/dist/src/Resource.d.ts.map +1 -1
  65. package/dist/src/Resource.js +9 -3
  66. package/dist/src/Result.d.ts +258 -114
  67. package/dist/src/Result.d.ts.map +1 -1
  68. package/dist/src/Result.js +74 -39
  69. package/dist/src/Schedule.d.ts +233 -116
  70. package/dist/src/Schedule.d.ts.map +1 -1
  71. package/dist/src/Schedule.js +204 -110
  72. package/dist/src/Set.d.ts +43 -24
  73. package/dist/src/Set.d.ts.map +1 -1
  74. package/dist/src/Set.js +25 -13
  75. package/dist/src/Sqlite.d.ts +4 -4
  76. package/dist/src/Sqlite.d.ts.map +1 -1
  77. package/dist/src/Sqlite.js +18 -15
  78. package/dist/src/Store.d.ts.map +1 -1
  79. package/dist/src/Store.js +3 -1
  80. package/dist/src/String.d.ts.map +1 -1
  81. package/dist/src/String.js +1 -1
  82. package/dist/src/Task.d.ts +555 -264
  83. package/dist/src/Task.d.ts.map +1 -1
  84. package/dist/src/Task.js +278 -168
  85. package/dist/src/Test.d.ts +10 -4
  86. package/dist/src/Test.d.ts.map +1 -1
  87. package/dist/src/Test.js +11 -4
  88. package/dist/src/Time.d.ts +27 -17
  89. package/dist/src/Time.d.ts.map +1 -1
  90. package/dist/src/Time.js +25 -8
  91. package/dist/src/Type.d.ts +1218 -372
  92. package/dist/src/Type.d.ts.map +1 -1
  93. package/dist/src/Type.js +1056 -379
  94. package/dist/src/Types.d.ts +95 -40
  95. package/dist/src/Types.d.ts.map +1 -1
  96. package/dist/src/Types.js +13 -4
  97. package/dist/src/WebSocket.d.ts +14 -6
  98. package/dist/src/WebSocket.d.ts.map +1 -1
  99. package/dist/src/WebSocket.js +8 -0
  100. package/dist/src/Worker.d.ts +10 -6
  101. package/dist/src/Worker.d.ts.map +1 -1
  102. package/dist/src/Worker.js +1 -1
  103. package/dist/src/intl/_en.d.ts +3 -1
  104. package/dist/src/intl/_en.d.ts.map +1 -1
  105. package/dist/src/intl/_en.js +17 -3
  106. package/dist/src/intl/ar.d.ts +3 -1
  107. package/dist/src/intl/ar.d.ts.map +1 -1
  108. package/dist/src/intl/ar.js +15 -2
  109. package/dist/src/intl/bn.d.ts +3 -1
  110. package/dist/src/intl/bn.d.ts.map +1 -1
  111. package/dist/src/intl/bn.js +16 -3
  112. package/dist/src/intl/ca.d.ts +3 -1
  113. package/dist/src/intl/ca.d.ts.map +1 -1
  114. package/dist/src/intl/ca.js +16 -3
  115. package/dist/src/intl/cs.d.ts +3 -1
  116. package/dist/src/intl/cs.d.ts.map +1 -1
  117. package/dist/src/intl/cs.js +16 -3
  118. package/dist/src/intl/da.d.ts +3 -1
  119. package/dist/src/intl/da.d.ts.map +1 -1
  120. package/dist/src/intl/da.js +16 -3
  121. package/dist/src/intl/de.d.ts +3 -1
  122. package/dist/src/intl/de.d.ts.map +1 -1
  123. package/dist/src/intl/de.js +16 -3
  124. package/dist/src/intl/el.d.ts +3 -1
  125. package/dist/src/intl/el.d.ts.map +1 -1
  126. package/dist/src/intl/el.js +16 -3
  127. package/dist/src/intl/es.d.ts +3 -1
  128. package/dist/src/intl/es.d.ts.map +1 -1
  129. package/dist/src/intl/es.js +16 -3
  130. package/dist/src/intl/fa.d.ts +3 -1
  131. package/dist/src/intl/fa.d.ts.map +1 -1
  132. package/dist/src/intl/fa.js +16 -3
  133. package/dist/src/intl/fi.d.ts +3 -1
  134. package/dist/src/intl/fi.d.ts.map +1 -1
  135. package/dist/src/intl/fi.js +16 -3
  136. package/dist/src/intl/fil.d.ts +3 -1
  137. package/dist/src/intl/fil.d.ts.map +1 -1
  138. package/dist/src/intl/fil.js +16 -3
  139. package/dist/src/intl/fr.d.ts +3 -1
  140. package/dist/src/intl/fr.d.ts.map +1 -1
  141. package/dist/src/intl/fr.js +16 -3
  142. package/dist/src/intl/he.d.ts +3 -1
  143. package/dist/src/intl/he.d.ts.map +1 -1
  144. package/dist/src/intl/he.js +16 -3
  145. package/dist/src/intl/hi.d.ts +3 -1
  146. package/dist/src/intl/hi.d.ts.map +1 -1
  147. package/dist/src/intl/hi.js +16 -3
  148. package/dist/src/intl/hr.d.ts +3 -1
  149. package/dist/src/intl/hr.d.ts.map +1 -1
  150. package/dist/src/intl/hr.js +16 -3
  151. package/dist/src/intl/hu.d.ts +2 -1
  152. package/dist/src/intl/hu.d.ts.map +1 -1
  153. package/dist/src/intl/hu.js +15 -3
  154. package/dist/src/intl/id.d.ts +3 -1
  155. package/dist/src/intl/id.d.ts.map +1 -1
  156. package/dist/src/intl/id.js +16 -3
  157. package/dist/src/intl/it.d.ts +3 -1
  158. package/dist/src/intl/it.d.ts.map +1 -1
  159. package/dist/src/intl/it.js +16 -3
  160. package/dist/src/intl/ja.d.ts +3 -1
  161. package/dist/src/intl/ja.d.ts.map +1 -1
  162. package/dist/src/intl/ja.js +16 -3
  163. package/dist/src/intl/ko.d.ts +3 -1
  164. package/dist/src/intl/ko.d.ts.map +1 -1
  165. package/dist/src/intl/ko.js +16 -3
  166. package/dist/src/intl/ml.d.ts +3 -1
  167. package/dist/src/intl/ml.d.ts.map +1 -1
  168. package/dist/src/intl/ml.js +16 -3
  169. package/dist/src/intl/mr.d.ts +3 -1
  170. package/dist/src/intl/mr.d.ts.map +1 -1
  171. package/dist/src/intl/mr.js +16 -3
  172. package/dist/src/intl/ms.d.ts +3 -1
  173. package/dist/src/intl/ms.d.ts.map +1 -1
  174. package/dist/src/intl/ms.js +15 -2
  175. package/dist/src/intl/nb.d.ts +2 -1
  176. package/dist/src/intl/nb.d.ts.map +1 -1
  177. package/dist/src/intl/nb.js +14 -2
  178. package/dist/src/intl/nl.d.ts +3 -1
  179. package/dist/src/intl/nl.d.ts.map +1 -1
  180. package/dist/src/intl/nl.js +16 -3
  181. package/dist/src/intl/pa.d.ts +3 -1
  182. package/dist/src/intl/pa.d.ts.map +1 -1
  183. package/dist/src/intl/pa.js +16 -3
  184. package/dist/src/intl/pl.d.ts +2 -0
  185. package/dist/src/intl/pl.d.ts.map +1 -1
  186. package/dist/src/intl/pl.js +15 -2
  187. package/dist/src/intl/pt-BR.d.ts +3 -1
  188. package/dist/src/intl/pt-BR.d.ts.map +1 -1
  189. package/dist/src/intl/pt-BR.js +16 -3
  190. package/dist/src/intl/pt.d.ts +3 -1
  191. package/dist/src/intl/pt.d.ts.map +1 -1
  192. package/dist/src/intl/pt.js +15 -2
  193. package/dist/src/intl/ro.d.ts +3 -1
  194. package/dist/src/intl/ro.d.ts.map +1 -1
  195. package/dist/src/intl/ro.js +16 -3
  196. package/dist/src/intl/sk.d.ts +3 -1
  197. package/dist/src/intl/sk.d.ts.map +1 -1
  198. package/dist/src/intl/sk.js +15 -2
  199. package/dist/src/intl/sl.d.ts +3 -1
  200. package/dist/src/intl/sl.d.ts.map +1 -1
  201. package/dist/src/intl/sl.js +16 -3
  202. package/dist/src/intl/sv.d.ts +3 -1
  203. package/dist/src/intl/sv.d.ts.map +1 -1
  204. package/dist/src/intl/sv.js +16 -3
  205. package/dist/src/intl/sw.d.ts +1 -0
  206. package/dist/src/intl/sw.d.ts.map +1 -1
  207. package/dist/src/intl/sw.js +14 -2
  208. package/dist/src/intl/ta.d.ts +3 -1
  209. package/dist/src/intl/ta.d.ts.map +1 -1
  210. package/dist/src/intl/ta.js +16 -3
  211. package/dist/src/intl/te.d.ts +3 -1
  212. package/dist/src/intl/te.d.ts.map +1 -1
  213. package/dist/src/intl/te.js +16 -3
  214. package/dist/src/intl/th.d.ts +3 -1
  215. package/dist/src/intl/th.d.ts.map +1 -1
  216. package/dist/src/intl/th.js +16 -3
  217. package/dist/src/intl/tr.d.ts +3 -1
  218. package/dist/src/intl/tr.d.ts.map +1 -1
  219. package/dist/src/intl/tr.js +16 -3
  220. package/dist/src/intl/uk.d.ts +3 -1
  221. package/dist/src/intl/uk.d.ts.map +1 -1
  222. package/dist/src/intl/uk.js +16 -3
  223. package/dist/src/intl/ur.d.ts +3 -1
  224. package/dist/src/intl/ur.d.ts.map +1 -1
  225. package/dist/src/intl/ur.js +15 -2
  226. package/dist/src/intl/vi.d.ts +3 -1
  227. package/dist/src/intl/vi.d.ts.map +1 -1
  228. package/dist/src/intl/vi.js +16 -3
  229. package/dist/src/intl/zh-CN.d.ts +3 -1
  230. package/dist/src/intl/zh-CN.d.ts.map +1 -1
  231. package/dist/src/intl/zh-CN.js +16 -3
  232. package/dist/src/intl/zh-TW.d.ts +3 -1
  233. package/dist/src/intl/zh-TW.d.ts.map +1 -1
  234. package/dist/src/intl/zh-TW.js +16 -3
  235. package/dist/src/local-first/Db.js +3 -2
  236. package/dist/src/local-first/Evolu.d.ts +47 -24
  237. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  238. package/dist/src/local-first/Evolu.js +1 -0
  239. package/dist/src/local-first/Owner.d.ts +18 -14
  240. package/dist/src/local-first/Owner.d.ts.map +1 -1
  241. package/dist/src/local-first/Owner.js +14 -11
  242. package/dist/src/local-first/Protocol.d.ts +5 -5
  243. package/dist/src/local-first/Protocol.d.ts.map +1 -1
  244. package/dist/src/local-first/Protocol.js +35 -29
  245. package/dist/src/local-first/Query.d.ts +34 -21
  246. package/dist/src/local-first/Query.d.ts.map +1 -1
  247. package/dist/src/local-first/Query.js +27 -14
  248. package/dist/src/local-first/Relay.d.ts +12 -5
  249. package/dist/src/local-first/Relay.d.ts.map +1 -1
  250. package/dist/src/local-first/Relay.js +1 -1
  251. package/dist/src/local-first/Schema.d.ts +19 -11
  252. package/dist/src/local-first/Schema.d.ts.map +1 -1
  253. package/dist/src/local-first/Schema.js +11 -6
  254. package/dist/src/local-first/Shared.d.ts.map +1 -1
  255. package/dist/src/local-first/Shared.js +4 -2
  256. package/dist/src/local-first/Storage.d.ts +4 -2
  257. package/dist/src/local-first/Storage.d.ts.map +1 -1
  258. package/dist/src/local-first/Timestamp.d.ts.map +1 -1
  259. package/dist/src/local-first/Timestamp.js +1 -1
  260. package/package.json +3 -4
  261. package/src/Array.ts +195 -95
  262. package/src/Assert.ts +337 -31
  263. package/src/BigInt.ts +3 -3
  264. package/src/Brand.ts +7 -7
  265. package/src/Buffer.ts +12 -4
  266. package/src/Cache.ts +8 -3
  267. package/src/Callbacks.ts +8 -4
  268. package/src/Console.ts +45 -30
  269. package/src/Crypto.ts +13 -8
  270. package/src/Eq.ts +450 -122
  271. package/src/Function.ts +54 -24
  272. package/src/Http.ts +52 -19
  273. package/src/Identicon.ts +9 -4
  274. package/src/LeakDetector.ts +4 -3
  275. package/src/LockManager.ts +12 -10
  276. package/src/Lookup.ts +5 -2
  277. package/src/Number.ts +28 -24
  278. package/src/Object.ts +115 -49
  279. package/src/Option.ts +14 -5
  280. package/src/Order.ts +12 -12
  281. package/src/Platform.ts +3 -2
  282. package/src/Random.ts +7 -4
  283. package/src/Redacted.ts +13 -6
  284. package/src/Ref.ts +4 -4
  285. package/src/Relation.ts +8 -10
  286. package/src/Resource.ts +36 -15
  287. package/src/Result.ts +263 -119
  288. package/src/Schedule.ts +233 -116
  289. package/src/Set.ts +43 -24
  290. package/src/Sqlite.ts +18 -15
  291. package/src/Store.ts +3 -1
  292. package/src/String.ts +1 -1
  293. package/src/Task.ts +566 -286
  294. package/src/Test.ts +11 -4
  295. package/src/Time.ts +36 -19
  296. package/src/Type.ts +2191 -590
  297. package/src/Types.ts +108 -40
  298. package/src/WebSocket.ts +22 -6
  299. package/src/Worker.ts +11 -7
  300. package/src/intl/_en.ts +20 -4
  301. package/src/intl/ar.ts +17 -2
  302. package/src/intl/bn.ts +19 -4
  303. package/src/intl/ca.ts +19 -4
  304. package/src/intl/cs.ts +19 -4
  305. package/src/intl/da.ts +19 -4
  306. package/src/intl/de.ts +19 -4
  307. package/src/intl/el.ts +19 -4
  308. package/src/intl/es.ts +19 -4
  309. package/src/intl/fa.ts +19 -4
  310. package/src/intl/fi.ts +19 -4
  311. package/src/intl/fil.ts +19 -4
  312. package/src/intl/fr.ts +19 -4
  313. package/src/intl/he.ts +19 -4
  314. package/src/intl/hi.ts +19 -4
  315. package/src/intl/hr.ts +19 -4
  316. package/src/intl/hu.ts +18 -4
  317. package/src/intl/id.ts +19 -4
  318. package/src/intl/it.ts +19 -4
  319. package/src/intl/ja.ts +19 -4
  320. package/src/intl/ko.ts +19 -4
  321. package/src/intl/ml.ts +19 -4
  322. package/src/intl/mr.ts +19 -4
  323. package/src/intl/ms.ts +17 -2
  324. package/src/intl/nb.ts +16 -2
  325. package/src/intl/nl.ts +19 -4
  326. package/src/intl/pa.ts +19 -4
  327. package/src/intl/pl.ts +18 -2
  328. package/src/intl/pt-BR.ts +19 -4
  329. package/src/intl/pt.ts +17 -2
  330. package/src/intl/ro.ts +19 -4
  331. package/src/intl/sk.ts +17 -2
  332. package/src/intl/sl.ts +19 -4
  333. package/src/intl/sv.ts +19 -4
  334. package/src/intl/sw.ts +15 -2
  335. package/src/intl/ta.ts +19 -4
  336. package/src/intl/te.ts +19 -4
  337. package/src/intl/th.ts +19 -4
  338. package/src/intl/tr.ts +19 -4
  339. package/src/intl/uk.ts +19 -4
  340. package/src/intl/ur.ts +17 -2
  341. package/src/intl/vi.ts +19 -3
  342. package/src/intl/zh-CN.ts +19 -4
  343. package/src/intl/zh-TW.ts +19 -4
  344. package/src/local-first/Db.ts +2 -1
  345. package/src/local-first/Evolu.ts +48 -24
  346. package/src/local-first/Owner.ts +18 -14
  347. package/src/local-first/Protocol.ts +45 -35
  348. package/src/local-first/Query.ts +40 -24
  349. package/src/local-first/Relay.ts +13 -6
  350. package/src/local-first/Schema.ts +19 -11
  351. package/src/local-first/Shared.ts +4 -2
  352. package/src/local-first/Storage.ts +4 -2
  353. package/src/local-first/Timestamp.ts +1 -1
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Runtime assertions for invariant checking.
2
+ * Runtime assertions for invariants and value checks.
3
3
  *
4
4
  * @module
5
5
  */
6
+ import { eqData, eqStrict } from "./Eq.js";
6
7
  /**
7
8
  * Ensures a condition is true, throwing an error with the provided message if
8
9
  * not.
@@ -17,19 +18,103 @@
17
18
  * ### Example
18
19
  *
19
20
  * ```ts
20
- * import { assert as assertInvariant } from "@evolu/common";
21
+ * import { assert, assertEqual, assertErr, trySync } from "@evolu/common";
21
22
  *
22
- * expect(() => assertInvariant(true, "Expected true.")).not.toThrow();
23
- * expect(() => assertInvariant(false, "Expected true.")).toThrow(
24
- * "Expected true.",
25
- * );
23
+ * assert(true, "Expected true.");
24
+ * const result = trySync(() => assert(false, "Expected true."));
25
+ * assertErr(result);
26
+ * assert(result.error instanceof Error, "Expected an Error.");
27
+ * assertEqual(result.error.message, "Expected true.");
26
28
  * ```
27
29
  */
28
30
  export const assert = (condition, message) => {
31
+ // oxlint-disable-next-line typescript/strict-boolean-expressions -- JavaScript truthiness is the contract of assert.
29
32
  if (!condition) {
30
33
  throw new Error(message);
31
34
  }
32
35
  };
36
+ /**
37
+ * Asserts that two values are the same according to {@link eqStrict}.
38
+ *
39
+ * `eqStrict` uses SameValue equality: it considers `NaN` the same as itself,
40
+ * distinguishes `0` from `-0`, and compares objects by reference identity.
41
+ *
42
+ * ### Example
43
+ *
44
+ * ```ts
45
+ * import { assertSame, assertType } from "@evolu/common";
46
+ *
47
+ * interface User {
48
+ * readonly name: string;
49
+ * }
50
+ *
51
+ * const user: User = { name: "Ada" };
52
+ * const value: unknown = user;
53
+ *
54
+ * assertSame(value, user);
55
+ * assertType<User, typeof value>();
56
+ * ```
57
+ */
58
+ export const assertSame = (actual, expected) => {
59
+ assert(eqStrict(actual, expected), "Expected values to be the same.");
60
+ };
61
+ /**
62
+ * Asserts that a value is exactly `true` and narrows it to `true`.
63
+ *
64
+ * Unlike {@link assert}, this checks an exact boolean value instead of
65
+ * truthiness and does not require a custom message.
66
+ *
67
+ * ### Example
68
+ *
69
+ * ```ts
70
+ * import { assertTrue, assertType } from "@evolu/common";
71
+ *
72
+ * const value: unknown = true;
73
+ * assertTrue(value);
74
+ * assertType<true, typeof value>();
75
+ * ```
76
+ */
77
+ export const assertTrue = (value) => {
78
+ assert(value === true, "Expected true.");
79
+ };
80
+ /**
81
+ * Asserts that a value is exactly `false` and narrows it to `false`.
82
+ *
83
+ * Unlike {@link assert}, this checks an exact boolean value instead of falsiness
84
+ * and does not require a custom message.
85
+ *
86
+ * ### Example
87
+ *
88
+ * ```ts
89
+ * import { assertFalse, assertType } from "@evolu/common";
90
+ *
91
+ * const value: unknown = false;
92
+ * assertFalse(value);
93
+ * assertType<false, typeof value>();
94
+ * ```
95
+ */
96
+ export const assertFalse = (value) => {
97
+ assert(value === false, "Expected false.");
98
+ };
99
+ export function assertEqual(actual, expected) {
100
+ assert(eqData(actual, expected), "Expected values to be equal.");
101
+ }
102
+ export function assertOk(result, ...comparison) {
103
+ assert(result.ok, "Expected an Ok result.");
104
+ if (comparison.length === 0)
105
+ return;
106
+ const expectedValue = comparison[0];
107
+ const eq = comparison[1] ?? eqData;
108
+ assert(eq(result.value, expectedValue), "Expected the value to equal the expected value.");
109
+ }
110
+ export function assertErr(result, ...comparison) {
111
+ assert(!result.ok, "Expected an Err result.");
112
+ if (comparison.length === 0)
113
+ return;
114
+ const expectedError = comparison[0];
115
+ const eq = comparison[1] ?? eqData;
116
+ assert(eq(result.error, expectedError), "Expected the error to equal the expected error.");
117
+ }
33
118
  /**
34
119
  * Asserts that a value is non-nullable.
35
120
  *
@@ -49,15 +134,23 @@ export const assertNonNullable = (value, message = "Expected value to be non-nul
49
134
  * ### Example
50
135
  *
51
136
  * ```ts
52
- * import { assertNotNull } from "@evolu/common";
137
+ * import {
138
+ * assert,
139
+ * assertEqual,
140
+ * assertErr,
141
+ * assertNotNull,
142
+ * assertType,
143
+ * trySync,
144
+ * } from "@evolu/common";
53
145
  *
54
146
  * const value = undefined as string | null | undefined;
55
147
  * assertNotNull(value);
56
- * expectTypeOf(value).toEqualTypeOf<string | undefined>();
57
- * expect(value).toBeUndefined();
58
- * expect(() => assertNotNull(null)).toThrow(
59
- * "Expected value not to be null.",
60
- * );
148
+ * assertType<string | undefined, typeof value>();
149
+ * assertEqual(value, undefined);
150
+ * const result = trySync(() => assertNotNull(null));
151
+ * assertErr(result);
152
+ * assert(result.error instanceof Error, "Expected an Error.");
153
+ * assertEqual(result.error.message, "Expected value not to be null.");
61
154
  * ```
62
155
  */
63
156
  export const assertNotNull = (value, message = "Expected value not to be null.") => {
@@ -72,15 +165,23 @@ export const assertNotNull = (value, message = "Expected value not to be null.")
72
165
  * ### Example
73
166
  *
74
167
  * ```ts
75
- * import { assertNotUndefined } from "@evolu/common";
168
+ * import {
169
+ * assert,
170
+ * assertEqual,
171
+ * assertErr,
172
+ * assertNotUndefined,
173
+ * assertType,
174
+ * trySync,
175
+ * } from "@evolu/common";
76
176
  *
77
177
  * const value = null as string | null | undefined;
78
178
  * assertNotUndefined(value);
79
- * expectTypeOf(value).toEqualTypeOf<string | null>();
80
- * expect(value).toBeNull();
81
- * expect(() => assertNotUndefined(undefined)).toThrow(
82
- * "Expected value not to be undefined.",
83
- * );
179
+ * assertType<string | null, typeof value>();
180
+ * assertEqual(value, null);
181
+ * const result = trySync(() => assertNotUndefined(undefined));
182
+ * assertErr(result);
183
+ * assert(result.error instanceof Error, "Expected an Error.");
184
+ * assertEqual(result.error.message, "Expected value not to be undefined.");
84
185
  * ```
85
186
  */
86
187
  export const assertNotUndefined = (value, message = "Expected value not to be undefined.") => {
@@ -95,13 +196,21 @@ export const assertNotUndefined = (value, message = "Expected value not to be un
95
196
  * ### Example
96
197
  *
97
198
  * ```ts
98
- * import { assertNonEmptyArray, type NonEmptyArray } from "@evolu/common";
199
+ * import {
200
+ * assertEqual,
201
+ * assertErr,
202
+ * assertNonEmptyArray,
203
+ * assertType,
204
+ * trySync,
205
+ * type NonEmptyArray,
206
+ * } from "@evolu/common";
99
207
  *
100
208
  * const values = [1, 2, 3];
101
209
  * assertNonEmptyArray(values);
102
- * expectTypeOf(values).toEqualTypeOf<NonEmptyArray<number>>();
103
- * expect(values[0]).toBe(1);
104
- * expect(() => assertNonEmptyArray([])).toThrow();
210
+ * assertType<NonEmptyArray<number>, typeof values>();
211
+ * assertEqual(values[0], 1);
212
+ * const result = trySync(() => assertNonEmptyArray([]));
213
+ * assertErr(result);
105
214
  * ```
106
215
  */
107
216
  export const assertNonEmptyArray = (arr, message = "Expected a non-empty array.") => {
@@ -117,15 +226,20 @@ export const assertNonEmptyArray = (arr, message = "Expected a non-empty array."
117
226
  *
118
227
  * ```ts
119
228
  * import {
229
+ * assertEqual,
230
+ * assertErr,
120
231
  * assertNonEmptyReadonlyArray,
232
+ * assertType,
233
+ * trySync,
121
234
  * type NonEmptyReadonlyArray,
122
235
  * } from "@evolu/common";
123
236
  *
124
237
  * const values: ReadonlyArray<number> = [1, 2, 3];
125
238
  * assertNonEmptyReadonlyArray(values);
126
- * expectTypeOf(values).toEqualTypeOf<NonEmptyReadonlyArray<number>>();
127
- * expect(values[0]).toBe(1);
128
- * expect(() => assertNonEmptyReadonlyArray([])).toThrow();
239
+ * assertType<NonEmptyReadonlyArray<number>, typeof values>();
240
+ * assertEqual(values[0], 1);
241
+ * const result = trySync(() => assertNonEmptyReadonlyArray([]));
242
+ * assertErr(result);
129
243
  * ```
130
244
  */
131
245
  export const assertNonEmptyReadonlyArray = (arr, message = "Expected a non-empty readonly array.") => {
@@ -139,14 +253,21 @@ export const assertNonEmptyReadonlyArray = (arr, message = "Expected a non-empty
139
253
  * ### Example
140
254
  *
141
255
  * ```ts
142
- * import { assertNotDisposed } from "@evolu/common";
256
+ * import {
257
+ * assert,
258
+ * assertEqual,
259
+ * assertErr,
260
+ * assertNotDisposed,
261
+ * trySync,
262
+ * } from "@evolu/common";
143
263
  *
144
264
  * await using disposer = new globalThis.AsyncDisposableStack();
145
- * expect(() => assertNotDisposed(disposer)).not.toThrow();
265
+ * assertNotDisposed(disposer);
146
266
  * await disposer.disposeAsync();
147
- * expect(() => assertNotDisposed(disposer)).toThrow(
148
- * "Cannot use a disposed object.",
149
- * );
267
+ * const result = trySync(() => assertNotDisposed(disposer));
268
+ * assertErr(result);
269
+ * assert(result.error instanceof Error, "Expected an Error.");
270
+ * assertEqual(result.error.message, "Cannot use a disposed object.");
150
271
  * ```
151
272
  *
152
273
  * This is the JavaScript equivalent of the .NET `ObjectDisposedException`
@@ -16,12 +16,12 @@ export declare const clampBigInt: (min: bigint, max: bigint) => (n: bigint) => b
16
16
  * ### Example
17
17
  *
18
18
  * ```ts
19
- * import { isBetweenBigInt } from "@evolu/common";
19
+ * import { assertFalse, assertTrue, isBetweenBigInt } from "@evolu/common";
20
20
  *
21
21
  * const isBetween10And20 = isBetweenBigInt(10n, 20n);
22
22
  *
23
- * expect(isBetween10And20(20n)).toBe(true);
24
- * expect(isBetween10And20(25n)).toBe(false);
23
+ * assertTrue(isBetween10And20(20n));
24
+ * assertFalse(isBetween10And20(25n));
25
25
  * ```
26
26
  */
27
27
  export declare const isBetweenBigInt: (min: bigint, max: bigint) => Predicate<bigint>;
@@ -15,12 +15,12 @@ export const clampBigInt = (min, max) => (n) => n < min ? min : n > max ? max :
15
15
  * ### Example
16
16
  *
17
17
  * ```ts
18
- * import { isBetweenBigInt } from "@evolu/common";
18
+ * import { assertFalse, assertTrue, isBetweenBigInt } from "@evolu/common";
19
19
  *
20
20
  * const isBetween10And20 = isBetweenBigInt(10n, 20n);
21
21
  *
22
- * expect(isBetween10And20(20n)).toBe(true);
23
- * expect(isBetween10And20(25n)).toBe(false);
22
+ * assertTrue(isBetween10And20(20n));
23
+ * assertFalse(isBetween10And20(25n));
24
24
  * ```
25
25
  */
26
26
  export const isBetweenBigInt = (min, max) => (value) => value >= min && value <= max;
@@ -17,7 +17,7 @@
17
17
  * ### Single brand
18
18
  *
19
19
  * ```ts
20
- * import type { Brand } from "@evolu/common";
20
+ * import { assertEqual, type Brand } from "@evolu/common";
21
21
  *
22
22
  * type UserId = number & Brand<"UserId">;
23
23
  *
@@ -26,7 +26,7 @@
26
26
  * const createUserId = (value: number): UserId => value as UserId;
27
27
  * const getUser = (id: UserId): number => id;
28
28
  * const userId = createUserId(123);
29
- * expect(getUser(userId)).toBe(123);
29
+ * assertEqual(getUser(userId), 123);
30
30
  * // @ts-expect-error A plain number is not a UserId.
31
31
  * getUser(123);
32
32
  * ```
@@ -34,7 +34,7 @@
34
34
  * ### Multiple brands
35
35
  *
36
36
  * ```ts
37
- * import type { Brand } from "@evolu/common";
37
+ * import { assertEqual, type Brand } from "@evolu/common";
38
38
  *
39
39
  * type Min1 = string & Brand<"Min1">;
40
40
  * type Max100 = string & Brand<"Max100">;
@@ -45,8 +45,8 @@
45
45
  *
46
46
  * const min1Max100Value: Min1Max100 = "typescript" as Min1Max100;
47
47
  *
48
- * expect(requiresMin1(min1Max100Value)).toBe("typescript");
49
- * expect(requiresMax100(min1Max100Value)).toBe("typescript");
48
+ * assertEqual(requiresMin1(min1Max100Value), "typescript");
49
+ * assertEqual(requiresMax100(min1Max100Value), "typescript");
50
50
  * ```
51
51
  *
52
52
  * ### Standalone brand
@@ -58,7 +58,7 @@
58
58
  * code platform-agnostic.
59
59
  *
60
60
  * ```ts
61
- * import type { Brand } from "@evolu/common";
61
+ * import { assertSame, type Brand } from "@evolu/common";
62
62
  *
63
63
  * type NativePort = Brand<"NativePort">;
64
64
  *
@@ -66,7 +66,7 @@
66
66
  *
67
67
  * const nativeValue: unknown = { id: 1 };
68
68
  * const port = nativeValue as NativePort;
69
- * expect(requiresNativePort(port)).toBe(nativeValue);
69
+ * assertSame(requiresNativePort(port), nativeValue);
70
70
  * // @ts-expect-error An unknown value is not a NativePort.
71
71
  * requiresNativePort(nativeValue);
72
72
  * ```
@@ -37,6 +37,9 @@ export declare class BufferError extends Error {
37
37
  *
38
38
  * ```ts
39
39
  * import {
40
+ * assert,
41
+ * assertEqual,
42
+ * assertErr,
40
43
  * createBuffer,
41
44
  * createIdFromString,
42
45
  * IdBytes,
@@ -44,6 +47,7 @@ export declare class BufferError extends Error {
44
47
  * idBytesTypeValueLength,
45
48
  * idToIdBytes,
46
49
  * NonNegativeInt,
50
+ * trySync,
47
51
  * } from "@evolu/common";
48
52
  * import {
49
53
  * decodeNonNegativeInt,
@@ -56,13 +60,17 @@ export declare class BufferError extends Error {
56
60
  * buffer.extend(idToIdBytes(id));
57
61
  *
58
62
  * const decoder = createBuffer(buffer.unwrap());
59
- * expect(decodeNonNegativeInt(decoder)).toBe(300);
63
+ * assertEqual(decodeNonNegativeInt(decoder), 300);
60
64
  * const decodedId = idBytesToId(
61
65
  * IdBytes.orThrow(decoder.shiftN(idBytesTypeValueLength)),
62
66
  * );
63
- * expect(decodedId).toBe(id);
64
- * expect(() => decodeNonNegativeInt(decoder)).toThrow(
65
- * "Buffer parse ended prematurely",
67
+ * assertEqual(decodedId, id);
68
+ * const result = trySync(() => decodeNonNegativeInt(decoder));
69
+ * assertErr(result);
70
+ * assert(
71
+ * result.error instanceof Error &&
72
+ * result.error.message === "Buffer parse ended prematurely",
73
+ * "Expected the premature-buffer-end error.",
66
74
  * );
67
75
  * ```
68
76
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["../../src/Buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAO,EAAE,MAAM,EAK1B;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,WAAW,MAAM;IACrB,kDAAkD;IAClD,WAAW,EAAE,MAAM,cAAc,CAAC;IAElC,gEAAgE;IAChE,SAAS,EAAE,MAAM,cAAc,CAAC;IAEhC;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAEtD;;;OAGG;IACH,KAAK,EAAE,MAAM,cAAc,CAAC;IAE5B;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,CAAC;IAE1C;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE3C;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,MAAM,UAAU,CAAC;CAC1B;AAED,8DAA8D;AAC9D,eAAO,MAAM,YAAY,eACX,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,KACzC,MA4DF,CAAC"}
1
+ {"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["../../src/Buffer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAC;AAC/D,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAO,EAAE,MAAM,EAK1B;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAM,WAAW,MAAM;IACrB,kDAAkD;IAClD,WAAW,EAAE,MAAM,cAAc,CAAC;IAElC,gEAAgE;IAChE,SAAS,EAAE,MAAM,cAAc,CAAC;IAEhC;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAEtD;;;OAGG;IACH,KAAK,EAAE,MAAM,cAAc,CAAC;IAE5B;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,UAAU,CAAC;IAE1C;;;OAGG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE3C;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,MAAM,UAAU,CAAC;CAC1B;AAED,8DAA8D;AAC9D,eAAO,MAAM,YAAY,eACX,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,KACzC,MA4DF,CAAC"}
@@ -36,16 +36,21 @@ export interface Cache<K, V> {
36
36
  * ### Example
37
37
  *
38
38
  * ```ts
39
- * import { createLruCache, PositiveInt } from "@evolu/common";
39
+ * import {
40
+ * assertEqual,
41
+ * assertFalse,
42
+ * createLruCache,
43
+ * PositiveInt,
44
+ * } from "@evolu/common";
40
45
  *
41
46
  * const cache = createLruCache<string, number>(PositiveInt.orThrow(2));
42
47
  * cache.set("a", 1);
43
48
  * cache.set("b", 2);
44
49
  * // Reading "a" makes "b" the least recently used entry.
45
- * expect(cache.get("a")).toBe(1);
50
+ * assertEqual(cache.get("a"), 1);
46
51
  * cache.set("c", 3);
47
52
  *
48
- * expect(cache.has("b")).toBe(false);
53
+ * assertFalse(cache.has("b"));
49
54
  * ```
50
55
  */
51
56
  export declare const createLruCache: <K, V>(capacity: PositiveInt) => Cache<K, V>;
@@ -1 +1 @@
1
- {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../src/Cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,2CAA2C;IAC3C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAEzB,kEAAkE;IAClE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAE/B,4CAA4C;IAC5C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAE9B,oCAAoC;IACpC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAEzB,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,YAAY,WAAW,KAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAmCtE,CAAC"}
1
+ {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../src/Cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,EAAE,CAAC;IACzB,2CAA2C;IAC3C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAEzB,kEAAkE;IAClE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IAE/B,4CAA4C;IAC5C,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAE9B,oCAAoC;IACpC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;IAEzB,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,YAAY,WAAW,KAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAmCtE,CAAC"}
package/dist/src/Cache.js CHANGED
@@ -13,16 +13,21 @@ import { PositiveInt } from "./Type.js";
13
13
  * ### Example
14
14
  *
15
15
  * ```ts
16
- * import { createLruCache, PositiveInt } from "@evolu/common";
16
+ * import {
17
+ * assertEqual,
18
+ * assertFalse,
19
+ * createLruCache,
20
+ * PositiveInt,
21
+ * } from "@evolu/common";
17
22
  *
18
23
  * const cache = createLruCache<string, number>(PositiveInt.orThrow(2));
19
24
  * cache.set("a", 1);
20
25
  * cache.set("b", 2);
21
26
  * // Reading "a" makes "b" the least recently used entry.
22
- * expect(cache.get("a")).toBe(1);
27
+ * assertEqual(cache.get("a"), 1);
23
28
  * cache.set("c", 3);
24
29
  *
25
- * expect(cache.has("b")).toBe(false);
30
+ * assertFalse(cache.has("b"));
26
31
  * ```
27
32
  */
28
33
  export const createLruCache = (capacity) => {
@@ -22,7 +22,11 @@ import type { Callback } from "./Types.ts";
22
22
  * ### Correlating callback responses
23
23
  *
24
24
  * ```ts
25
- * import { createCallbacks, testCreateDeps } from "@evolu/common";
25
+ * import {
26
+ * assertEqual,
27
+ * createCallbacks,
28
+ * testCreateDeps,
29
+ * } from "@evolu/common";
26
30
  *
27
31
  * const deps = testCreateDeps();
28
32
  *
@@ -34,7 +38,7 @@ import type { Callback } from "./Types.ts";
34
38
  * });
35
39
  * callbacks.execute(noArgumentId);
36
40
  * callbacks.execute(noArgumentId);
37
- * expect(noArgumentCalls).toBe(1);
41
+ * assertEqual(noArgumentCalls, 1);
38
42
  *
39
43
  * // Typed callback
40
44
  * using stringCallbacks = createCallbacks<string>(deps);
@@ -43,14 +47,14 @@ import type { Callback } from "./Types.ts";
43
47
  * received = value;
44
48
  * });
45
49
  * stringCallbacks.execute(stringCallbackId, "hello");
46
- * expect(received).toBe("hello");
50
+ * assertEqual(received, "hello");
47
51
  *
48
52
  * // Promise.withResolvers
49
53
  * using promiseCallbacks = createCallbacks<string>(deps);
50
54
  * const { promise, resolve } = Promise.withResolvers<string>();
51
55
  * const promiseCallbackId = promiseCallbacks.register(resolve);
52
56
  * promiseCallbacks.execute(promiseCallbackId, "resolved value");
53
- * expect(await promise).toBe("resolved value");
57
+ * assertEqual(await promise, "resolved value");
54
58
  * ```
55
59
  *
56
60
  * @template T - The type of argument passed to callbacks (defaults to undefined
@@ -1 +1 @@
1
- {"version":3,"file":"Callbacks.d.ts","sourceRoot":"","sources":["../../src/Callbacks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAY,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,SAAS,CAAE,SAAQ,UAAU;IAC1D,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAEjD,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,SAAS,GACjC,CAAC,EAAE,EAAE,EAAE,KAAK,SAAS,GACrB,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC;CACnC;AAED,mEAAmE;AACnE,eAAO,MAAM,eAAe,GAAI,CAAC,GAAG,SAAS,QACrC,cAAc,KACnB,SAAS,CAAC,CAAC,CA6Bb,CAAC"}
1
+ {"version":3,"file":"Callbacks.d.ts","sourceRoot":"","sources":["../../src/Callbacks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAY,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,SAAS,CAAE,SAAQ,UAAU;IAC1D,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAEjD,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,SAAS,GACjC,CAAC,EAAE,EAAE,EAAE,KAAK,SAAS,GACrB,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC;CACnC;AAED,mEAAmE;AACnE,eAAO,MAAM,eAAe,GAAI,CAAC,GAAG,SAAS,QACrC,cAAc,KACnB,SAAS,CAAC,CAAC,CA6Bb,CAAC"}