@evolu/common 7.4.0 → 8.0.0-next.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 (251) hide show
  1. package/README.md +4 -61
  2. package/dist/src/Array.d.ts +343 -102
  3. package/dist/src/Array.d.ts.map +1 -1
  4. package/dist/src/Array.js +181 -85
  5. package/dist/src/Assert.d.ts +57 -11
  6. package/dist/src/Assert.d.ts.map +1 -1
  7. package/dist/src/Assert.js +47 -11
  8. package/dist/src/BigInt.d.ts +6 -1
  9. package/dist/src/BigInt.d.ts.map +1 -1
  10. package/dist/src/BigInt.js +5 -0
  11. package/dist/src/Brand.d.ts +40 -12
  12. package/dist/src/Brand.d.ts.map +1 -1
  13. package/dist/src/Brand.js +5 -0
  14. package/dist/src/Buffer.d.ts +6 -1
  15. package/dist/src/Buffer.d.ts.map +1 -1
  16. package/dist/src/Buffer.js +7 -2
  17. package/dist/src/Cache.d.ts +10 -2
  18. package/dist/src/Cache.d.ts.map +1 -1
  19. package/dist/src/Cache.js +6 -0
  20. package/dist/src/Callbacks.d.ts +10 -7
  21. package/dist/src/Callbacks.d.ts.map +1 -1
  22. package/dist/src/Callbacks.js +23 -13
  23. package/dist/src/Console.d.ts +361 -69
  24. package/dist/src/Console.d.ts.map +1 -1
  25. package/dist/src/Console.js +217 -117
  26. package/dist/src/Crypto.d.ts +70 -21
  27. package/dist/src/Crypto.d.ts.map +1 -1
  28. package/dist/src/Crypto.js +72 -27
  29. package/dist/src/Eq.d.ts +22 -2
  30. package/dist/src/Eq.d.ts.map +1 -1
  31. package/dist/src/Eq.js +21 -1
  32. package/dist/src/Error.d.ts +23 -12
  33. package/dist/src/Error.d.ts.map +1 -1
  34. package/dist/src/Error.js +27 -11
  35. package/dist/src/Function.d.ts +128 -56
  36. package/dist/src/Function.d.ts.map +1 -1
  37. package/dist/src/Function.js +118 -14
  38. package/dist/src/Identicon.d.ts +5 -0
  39. package/dist/src/Identicon.d.ts.map +1 -1
  40. package/dist/src/Identicon.js +6 -1
  41. package/dist/src/Lookup.d.ts +160 -0
  42. package/dist/src/Lookup.d.ts.map +1 -0
  43. package/dist/src/Lookup.js +192 -0
  44. package/dist/src/Microtask.d.ts +21 -0
  45. package/dist/src/Microtask.d.ts.map +1 -0
  46. package/dist/src/Microtask.js +37 -0
  47. package/dist/src/Number.d.ts +18 -4
  48. package/dist/src/Number.d.ts.map +1 -1
  49. package/dist/src/Number.js +23 -1
  50. package/dist/src/Object.d.ts +110 -5
  51. package/dist/src/Object.d.ts.map +1 -1
  52. package/dist/src/Object.js +108 -5
  53. package/dist/src/Option.d.ts +58 -0
  54. package/dist/src/Option.d.ts.map +1 -0
  55. package/dist/src/Option.js +43 -0
  56. package/dist/src/Order.d.ts +5 -0
  57. package/dist/src/Order.d.ts.map +1 -1
  58. package/dist/src/Order.js +8 -3
  59. package/dist/src/Platform.d.ts +36 -2
  60. package/dist/src/Platform.d.ts.map +1 -1
  61. package/dist/src/Platform.js +10 -6
  62. package/dist/src/Polyfills.d.ts +27 -0
  63. package/dist/src/Polyfills.d.ts.map +1 -0
  64. package/dist/src/Polyfills.js +299 -0
  65. package/dist/src/Random.d.ts +18 -7
  66. package/dist/src/Random.d.ts.map +1 -1
  67. package/dist/src/Random.js +9 -7
  68. package/dist/src/Redacted.d.ts +7 -4
  69. package/dist/src/Redacted.d.ts.map +1 -1
  70. package/dist/src/Redacted.js +5 -0
  71. package/dist/src/Ref.d.ts +31 -16
  72. package/dist/src/Ref.d.ts.map +1 -1
  73. package/dist/src/Ref.js +35 -7
  74. package/dist/src/RefCount.d.ts +62 -0
  75. package/dist/src/RefCount.d.ts.map +1 -0
  76. package/dist/src/RefCount.js +83 -0
  77. package/dist/src/Relation.d.ts +84 -29
  78. package/dist/src/Relation.d.ts.map +1 -1
  79. package/dist/src/Relation.js +83 -105
  80. package/dist/src/Resource.d.ts +263 -0
  81. package/dist/src/Resource.d.ts.map +1 -0
  82. package/dist/src/Resource.js +389 -0
  83. package/dist/src/Result.d.ts +390 -374
  84. package/dist/src/Result.d.ts.map +1 -1
  85. package/dist/src/Result.js +142 -70
  86. package/dist/src/Schedule.d.ts +953 -0
  87. package/dist/src/Schedule.d.ts.map +1 -0
  88. package/dist/src/Schedule.js +1199 -0
  89. package/dist/src/Set.d.ts +181 -0
  90. package/dist/src/Set.d.ts.map +1 -0
  91. package/dist/src/Set.js +137 -0
  92. package/dist/src/Skiplist.d.ts +6 -1
  93. package/dist/src/Skiplist.d.ts.map +1 -1
  94. package/dist/src/Skiplist.js +5 -0
  95. package/dist/src/Sqlite.d.ts +160 -60
  96. package/dist/src/Sqlite.d.ts.map +1 -1
  97. package/dist/src/Sqlite.js +290 -190
  98. package/dist/src/Store.d.ts +36 -28
  99. package/dist/src/Store.d.ts.map +1 -1
  100. package/dist/src/Store.js +55 -15
  101. package/dist/src/String.d.ts +5 -0
  102. package/dist/src/String.d.ts.map +1 -1
  103. package/dist/src/String.js +5 -0
  104. package/dist/src/Task.d.ts +2263 -423
  105. package/dist/src/Task.d.ts.map +1 -1
  106. package/dist/src/Task.js +1488 -348
  107. package/dist/src/Test.d.ts +122 -0
  108. package/dist/src/Test.d.ts.map +1 -0
  109. package/dist/src/Test.js +66 -0
  110. package/dist/src/Time.d.ts +201 -48
  111. package/dist/src/Time.d.ts.map +1 -1
  112. package/dist/src/Time.js +190 -86
  113. package/dist/src/Tracer.d.ts +48 -0
  114. package/dist/src/Tracer.d.ts.map +1 -0
  115. package/dist/src/Tracer.js +6 -0
  116. package/dist/src/Type.d.ts +582 -209
  117. package/dist/src/Type.d.ts.map +1 -1
  118. package/dist/src/Type.js +362 -240
  119. package/dist/src/Types.d.ts +160 -6
  120. package/dist/src/Types.d.ts.map +1 -1
  121. package/dist/src/Types.js +22 -2
  122. package/dist/src/WebSocket.d.ts +113 -58
  123. package/dist/src/WebSocket.d.ts.map +1 -1
  124. package/dist/src/WebSocket.js +210 -118
  125. package/dist/src/Worker.d.ts +245 -60
  126. package/dist/src/Worker.d.ts.map +1 -1
  127. package/dist/src/Worker.js +220 -64
  128. package/dist/src/index.d.ts +25 -3
  129. package/dist/src/index.d.ts.map +1 -1
  130. package/dist/src/index.js +19 -3
  131. package/dist/src/local-first/Db.d.ts +24 -213
  132. package/dist/src/local-first/Db.d.ts.map +1 -1
  133. package/dist/src/local-first/Db.js +622 -293
  134. package/dist/src/local-first/Error.d.ts +12 -0
  135. package/dist/src/local-first/Error.d.ts.map +1 -0
  136. package/dist/src/local-first/Error.js +6 -0
  137. package/dist/src/local-first/Evolu.d.ts +330 -285
  138. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  139. package/dist/src/local-first/Evolu.js +472 -402
  140. package/dist/src/local-first/LocalAuth.d.ts +10 -10
  141. package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
  142. package/dist/src/local-first/LocalAuth.js +6 -1
  143. package/dist/src/local-first/Owner.d.ts +70 -27
  144. package/dist/src/local-first/Owner.d.ts.map +1 -1
  145. package/dist/src/local-first/Owner.js +27 -14
  146. package/dist/src/local-first/Protocol.d.ts +58 -50
  147. package/dist/src/local-first/Protocol.d.ts.map +1 -1
  148. package/dist/src/local-first/Protocol.js +253 -155
  149. package/dist/src/local-first/Query.d.ts +133 -43
  150. package/dist/src/local-first/Query.d.ts.map +1 -1
  151. package/dist/src/local-first/Query.js +139 -90
  152. package/dist/src/local-first/Relay.d.ts +18 -38
  153. package/dist/src/local-first/Relay.d.ts.map +1 -1
  154. package/dist/src/local-first/Relay.js +59 -171
  155. package/dist/src/local-first/Schema.d.ts +139 -144
  156. package/dist/src/local-first/Schema.d.ts.map +1 -1
  157. package/dist/src/local-first/Schema.js +78 -163
  158. package/dist/src/local-first/Shared.d.ts +125 -0
  159. package/dist/src/local-first/Shared.d.ts.map +1 -0
  160. package/dist/src/local-first/Shared.js +569 -0
  161. package/dist/src/local-first/Storage.d.ts +50 -53
  162. package/dist/src/local-first/Storage.d.ts.map +1 -1
  163. package/dist/src/local-first/Storage.js +121 -173
  164. package/dist/src/local-first/Timestamp.d.ts +28 -35
  165. package/dist/src/local-first/Timestamp.d.ts.map +1 -1
  166. package/dist/src/local-first/Timestamp.js +24 -25
  167. package/dist/src/local-first/index.d.ts +2 -15
  168. package/dist/src/local-first/index.d.ts.map +1 -1
  169. package/dist/src/local-first/index.js +2 -15
  170. package/package.json +36 -26
  171. package/src/Array.ts +467 -106
  172. package/src/Assert.ts +87 -12
  173. package/src/BigInt.ts +7 -1
  174. package/src/Brand.ts +41 -12
  175. package/src/Buffer.ts +10 -4
  176. package/src/Cache.ts +11 -2
  177. package/src/Callbacks.ts +33 -23
  178. package/src/Console.ts +567 -178
  179. package/src/Crypto.ts +111 -62
  180. package/src/Eq.ts +30 -3
  181. package/src/Error.ts +50 -34
  182. package/src/Function.ts +140 -68
  183. package/src/Identicon.ts +7 -1
  184. package/src/Lookup.ts +415 -0
  185. package/src/Microtask.ts +58 -0
  186. package/src/Number.ts +40 -7
  187. package/src/Object.ts +155 -16
  188. package/src/Option.ts +74 -0
  189. package/src/Order.ts +11 -3
  190. package/src/Platform.ts +43 -7
  191. package/src/Polyfills.ts +465 -0
  192. package/src/Random.ts +25 -11
  193. package/src/Redacted.ts +8 -4
  194. package/src/Ref.ts +72 -21
  195. package/src/RefCount.ts +170 -0
  196. package/src/Relation.ts +188 -136
  197. package/src/Resource.ts +864 -0
  198. package/src/Result.ts +548 -381
  199. package/src/Schedule.ts +1471 -0
  200. package/src/Set.ts +247 -0
  201. package/src/Skiplist.ts +7 -1
  202. package/src/Sqlite.ts +409 -304
  203. package/src/Store.ts +94 -48
  204. package/src/String.ts +6 -0
  205. package/src/Task.ts +3685 -740
  206. package/src/Test.ts +162 -0
  207. package/src/Time.ts +348 -145
  208. package/src/Tracer.ts +54 -0
  209. package/src/Type.ts +1064 -630
  210. package/src/Types.ts +202 -7
  211. package/src/WebSocket.ts +311 -178
  212. package/src/Worker.ts +527 -147
  213. package/src/index.ts +74 -3
  214. package/src/local-first/Db.ts +871 -597
  215. package/src/local-first/Error.ts +17 -0
  216. package/src/local-first/Evolu.ts +884 -823
  217. package/src/local-first/LocalAuth.ts +10 -10
  218. package/src/local-first/Owner.ts +94 -42
  219. package/src/local-first/Protocol.ts +440 -303
  220. package/src/local-first/Query.ts +243 -194
  221. package/src/local-first/Relay.ts +91 -252
  222. package/src/local-first/Schema.ts +284 -394
  223. package/src/local-first/Shared.ts +932 -0
  224. package/src/local-first/Storage.ts +209 -282
  225. package/src/local-first/Timestamp.ts +38 -45
  226. package/src/local-first/index.ts +2 -16
  227. package/LICENSE +0 -21
  228. package/dist/src/Instances.d.ts +0 -34
  229. package/dist/src/Instances.d.ts.map +0 -1
  230. package/dist/src/Instances.js +0 -44
  231. package/dist/src/Resources.d.ts +0 -118
  232. package/dist/src/Resources.d.ts.map +0 -1
  233. package/dist/src/Resources.js +0 -197
  234. package/dist/src/local-first/Platform.d.ts +0 -25
  235. package/dist/src/local-first/Platform.d.ts.map +0 -1
  236. package/dist/src/local-first/Platform.js +0 -1
  237. package/dist/src/local-first/Public.d.ts +0 -22
  238. package/dist/src/local-first/Public.d.ts.map +0 -1
  239. package/dist/src/local-first/Public.js +0 -15
  240. package/dist/src/local-first/PublicKysely.d.ts +0 -148
  241. package/dist/src/local-first/PublicKysely.d.ts.map +0 -1
  242. package/dist/src/local-first/PublicKysely.js +0 -184
  243. package/dist/src/local-first/Sync.d.ts +0 -112
  244. package/dist/src/local-first/Sync.d.ts.map +0 -1
  245. package/dist/src/local-first/Sync.js +0 -529
  246. package/src/Instances.ts +0 -90
  247. package/src/Resources.ts +0 -367
  248. package/src/local-first/Platform.ts +0 -27
  249. package/src/local-first/Public.ts +0 -42
  250. package/src/local-first/PublicKysely.ts +0 -239
  251. package/src/local-first/Sync.ts +0 -960
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Test utilities for deterministic testing.
3
+ *
4
+ * @module
5
+ */
6
+ import { type TestConsoleDep } from "./Console.js";
7
+ import { type RandomLibDep } from "./Random.js";
8
+ import { type Run, type RunDeps } from "./Task.js";
9
+ import { type Duration, type TestTimeDep } from "./Time.js";
10
+ /**
11
+ * Cheap deterministic baseline deps for tests.
12
+ *
13
+ * `TestDeps` includes test-friendly replacements for {@link RunDeps}, such as
14
+ * {@link TestConsole} and {@link TestTime}, plus extra helpers commonly useful in
15
+ * tests and fixtures, such as `randomLib` (only that for now).
16
+ *
17
+ * Use it directly for synchronous test setup, fixtures, and helpers. It is also
18
+ * intentionally the base deps used by {@link testCreateRun}.
19
+ */
20
+ export type TestDeps = Omit<RunDeps, "console" | "time"> & TestConsoleDep & TestTimeDep & RandomLibDep;
21
+ /**
22
+ * Creates deterministic {@link TestDeps}.
23
+ *
24
+ * Each call creates fresh instances, so tests don't share state.
25
+ *
26
+ * Includes these deps:
27
+ *
28
+ * - `console`: {@link TestConsole}
29
+ * - `random`: {@link Random}
30
+ * - `randomLib`: seeded `random` package instance
31
+ * - `randomBytes`: {@link RandomBytes}
32
+ * - `time`: {@link TestTime}
33
+ *
34
+ * Use this for synchronous code that accepts deps directly. For tests that run
35
+ * Tasks, use {@link testCreateRun}.
36
+ *
37
+ * ### Example
38
+ *
39
+ * ```ts
40
+ * test("Callbacks with no argument", () => {
41
+ * const deps = testCreateDeps();
42
+ * const callbacks = createCallbacks(deps);
43
+ *
44
+ * let called = false;
45
+ * const id = callbacks.register(() => {
46
+ * called = true;
47
+ * });
48
+ *
49
+ * callbacks.execute(id);
50
+ * expect(called).toBe(true);
51
+ * });
52
+ * ```
53
+ */
54
+ export declare const testCreateDeps: (options?: {
55
+ readonly seed?: string;
56
+ }) => TestDeps;
57
+ /**
58
+ * Creates a test {@link Run} with deterministic default deps or optional custom
59
+ * deps.
60
+ *
61
+ * Use this as the default composition root in tests. Each call creates fresh
62
+ * {@link TestDeps} via {@link testCreateDeps}, then merges any provided custom
63
+ * deps.
64
+ *
65
+ * ### Example
66
+ *
67
+ * ```ts
68
+ * // Built-in TestTime
69
+ * await using run = testCreateRun();
70
+ * const fiber = run(sleep("1s"));
71
+ * run.deps.time.advance("1s");
72
+ * await fiber;
73
+ *
74
+ * // For a single test, create the dependency using the Run.
75
+ * await using run = testCreateRun();
76
+ * await using foo = await run.orThrow(createFoo());
77
+ * const runWithFoo = run.addDeps({ foo });
78
+ *
79
+ * expect(runWithFoo.deps.foo).toBe(foo);
80
+ *
81
+ * // If multiple tests need the same setup, create a disposable helper.
82
+ * // Then `await using setup` disposes everything the helper owns.
83
+ * const setupFoo = async () => {
84
+ * await using stack = new AsyncDisposableStack();
85
+ * const run = stack.use(testCreateRun());
86
+ * const foo = stack.use(await run.orThrow(createFoo()));
87
+ * const moved = stack.move();
88
+ *
89
+ * // Return whatever the tests need: a Run with the dependency,
90
+ * // the dependency itself, or both.
91
+ * return {
92
+ * run: run.addDeps({ foo }),
93
+ * foo,
94
+ * [Symbol.asyncDispose]: () => moved.disposeAsync(),
95
+ * };
96
+ * };
97
+ *
98
+ * await using setup = await setupFoo();
99
+ * const { run, foo } = setup;
100
+ * expect(run.deps.foo).toBe(foo);
101
+ * ```
102
+ *
103
+ * Name reusable setup helpers after what they set up:
104
+ *
105
+ * - `setupFoo` for reusable test setup for `Foo`
106
+ * - `testSetupFoo` when a library module exports the helper as part of its public
107
+ * test API, e.g. `testSetupSqlite`.
108
+ */
109
+ export declare function testCreateRun(): Run<TestDeps>;
110
+ /** With custom dependencies merged into {@link TestDeps}. */
111
+ export declare function testCreateRun<D>(deps: D): Run<TestDeps & D>;
112
+ /**
113
+ * Returns a Promise that resolves after a macrotask delay.
114
+ *
115
+ * Use this to model a real async boundary in a test double, for example an
116
+ * async disposer that should not complete in the same turn.
117
+ *
118
+ * Avoid using it to coordinate assertions. Waiting for a macrotask tends to
119
+ * make tests indirect and brittle.
120
+ */
121
+ export declare const testWaitForMacrotask: (duration?: Duration) => Promise<void>;
122
+ //# sourceMappingURL=Test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Test.d.ts","sourceRoot":"","sources":["../../src/Test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAa,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,GACtD,cAAc,GACd,WAAW,GACX,YAAY,CAAC;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,KAAG,QAQH,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;AAE/C,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;AAO7D;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAC/B,WAAU,QAAoB,KAC7B,OAAO,CAAC,IAAI,CAAyB,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Test utilities for deterministic testing.
3
+ *
4
+ * @module
5
+ */
6
+ import { testCreateConsole, } from "./Console.js";
7
+ import { testCreateRandomBytes } from "./Crypto.js";
8
+ import { testCreateRandom, testCreateRandomLib, } from "./Random.js";
9
+ import { createRun } from "./Task.js";
10
+ import { minMillis, setTimeout, testCreateTime, } from "./Time.js";
11
+ /**
12
+ * Creates deterministic {@link TestDeps}.
13
+ *
14
+ * Each call creates fresh instances, so tests don't share state.
15
+ *
16
+ * Includes these deps:
17
+ *
18
+ * - `console`: {@link TestConsole}
19
+ * - `random`: {@link Random}
20
+ * - `randomLib`: seeded `random` package instance
21
+ * - `randomBytes`: {@link RandomBytes}
22
+ * - `time`: {@link TestTime}
23
+ *
24
+ * Use this for synchronous code that accepts deps directly. For tests that run
25
+ * Tasks, use {@link testCreateRun}.
26
+ *
27
+ * ### Example
28
+ *
29
+ * ```ts
30
+ * test("Callbacks with no argument", () => {
31
+ * const deps = testCreateDeps();
32
+ * const callbacks = createCallbacks(deps);
33
+ *
34
+ * let called = false;
35
+ * const id = callbacks.register(() => {
36
+ * called = true;
37
+ * });
38
+ *
39
+ * callbacks.execute(id);
40
+ * expect(called).toBe(true);
41
+ * });
42
+ * ```
43
+ */
44
+ export const testCreateDeps = (options) => {
45
+ const seed = options?.seed ?? "evolu";
46
+ const console = testCreateConsole();
47
+ const random = testCreateRandom(seed);
48
+ const randomLib = testCreateRandomLib(seed);
49
+ const randomBytes = testCreateRandomBytes({ randomLib });
50
+ const time = testCreateTime();
51
+ return { console, randomBytes, random, randomLib, time };
52
+ };
53
+ export function testCreateRun(deps) {
54
+ const defaults = testCreateDeps();
55
+ return createRun({ ...defaults, ...deps });
56
+ }
57
+ /**
58
+ * Returns a Promise that resolves after a macrotask delay.
59
+ *
60
+ * Use this to model a real async boundary in a test double, for example an
61
+ * async disposer that should not complete in the same turn.
62
+ *
63
+ * Avoid using it to coordinate assertions. Waiting for a macrotask tends to
64
+ * make tests indirect and brittle.
65
+ */
66
+ export const testWaitForMacrotask = (duration = minMillis) => setTimeout(duration);
@@ -1,80 +1,233 @@
1
- import { DateIso, NonNegativeInt } from "./Type.js";
2
- /** Retrieves the current time in milliseconds, similar to `Date.now()`. */
1
+ /**
2
+ * Time representations, durations, and scheduling utilities.
3
+ *
4
+ * @module
5
+ */
6
+ import type { Brand } from "./Brand.js";
7
+ import { type DateIso } from "./Type.js";
8
+ import type { Digit, Digit1To23, Digit1To51, Digit1To59, Digit1To6, Digit1To9, Digit1To99 } from "./Types.js";
9
+ /** Time and timer operations. */
3
10
  export interface Time {
4
- readonly now: () => number;
5
- readonly nowIso: () => DateIso;
11
+ /** Returns current time as Unix epoch milliseconds. */
12
+ readonly now: () => Millis;
13
+ /** Returns current time as an ISO 8601 UTC string. */
14
+ readonly nowDateIso: () => DateIso;
15
+ /** Schedules a callback after the specified delay. */
16
+ readonly setTimeout: (fn: () => void, delay: Duration) => TimeoutId;
17
+ /** Cancels a timeout scheduled with {@link Time.setTimeout}. */
18
+ readonly clearTimeout: (id: TimeoutId) => void;
6
19
  }
7
20
  export interface TimeDep {
8
21
  readonly time: Time;
9
22
  }
10
23
  /**
11
- * Creates a {@link Time} using Date.now().
24
+ * Opaque type for timeout handles.
12
25
  *
13
- * If the system clock is misconfigured (out of allowed range), the application
14
- * will fail with an assertion error. This is intentional - there's no
15
- * reasonable fallback when the system clock is fundamentally wrong.
26
+ * Use with {@link Time.clearTimeout} to cancel a pending timeout.
27
+ */
28
+ export type TimeoutId = Brand<"TimeoutId">;
29
+ /**
30
+ * Creates a {@link Time} using `Date.now()` and `globalThis.setTimeout`.
31
+ *
32
+ * Throws if the system clock returns an out-of-range value. This is intentional
33
+ * — there's no reasonable fallback for a misconfigured clock.
16
34
  */
17
35
  export declare const createTime: () => Time;
18
36
  /**
19
- * Creates a {@link Time} that returns a monotonically increasing number based on
20
- * a queueMicrotask.
37
+ * Test {@link Time} with controllable timers.
38
+ *
39
+ * Call `advance(ms)` to move time forward and trigger any pending timeouts.
21
40
  */
22
- export declare const createTestTime: () => Time;
23
- /** Single digit 0-9. Used internally for {@link DurationString} validation. */
24
- export type D = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
41
+ export interface TestTime extends Time {
42
+ /** Advances time by the specified duration, triggering pending timeouts. */
43
+ readonly advance: (duration: Duration) => void;
44
+ }
45
+ export interface TestTimeDep {
46
+ readonly time: TestTime;
47
+ }
25
48
  /**
26
- * Minutes and seconds 1-59. Used internally for {@link DurationString}
27
- * validation. Uses single digits for 1-9, full numbers for 10-59.
49
+ * Creates a {@link TestTime} with controllable timers for testing.
50
+ *
51
+ * Time starts at `startAt` (default 0) and only advances when `advance()` is
52
+ * called. Timeouts scheduled via `setTimeout` fire when time is advanced past
53
+ * their deadline.
54
+ *
55
+ * Set `autoIncrement` to automatically increment time by 1ms after each `now()`
56
+ * call via microtask (useful for tests that need monotonically increasing
57
+ * values without explicit `advance()` calls).
28
58
  */
29
- export type MmSs = Exclude<D, "0"> | `1${D}` | `2${D}` | `3${D}` | `4${D}` | `5${D}`;
30
- /** Hours 1-23. Used internally for {@link DurationString} validation. */
31
- export type Hours = Exclude<D, "0"> | `1${D}` | `2${"0" | "1" | "2" | "3"}`;
32
- /** Days 1-99. Used internally for {@link DurationString} validation. */
33
- export type Days = Exclude<D, "0"> | `${Exclude<D, "0">}${D}`;
59
+ export declare const testCreateTime: (options?: {
60
+ readonly startAt?: Millis;
61
+ readonly autoIncrement?: boolean;
62
+ }) => TestTime;
34
63
  /**
35
- * Template literal type for compile-time validated duration strings.
64
+ * Milliseconds timestamp, like `Date.now()`.
65
+ *
66
+ * The maximum value is 281474976710654 (281474976710655 - 1, reserved for
67
+ * infinity). This enables efficient binary serialization, saving 2 bytes
68
+ * compared to typical 8-byte (64-bit) timestamps.
69
+ *
70
+ * `new Date(281474976710654).toString()` = Tue Aug 02 10889 07:31:49
36
71
  *
37
- * Allowed patterns: basic units (ms, s, m, h, d) and logical combinations
38
- * (s+ms, m+s, h+m, d+h).
72
+ * If a system clock exceeds this range, operations will throw. This is
73
+ * intentional — there's no reasonable fallback for a misconfigured clock.
74
+ */
75
+ export declare const Millis: import("./Type.js").BrandType<import("./Type.js").BrandType<import("./Type.js").Type<"Brand", number & Brand<"Int"> & Brand<"NonNegative">, number, import("./Type.js").NonNegativeError, number & Brand<"Int">, import("./Type.js").NumberError | import("./Type.js").IntError>, "LessThan281474976710655", import("./Type.js").LessThanError<281474976710655>, import("./Type.js").NumberError | import("./Type.js").NonNegativeError | import("./Type.js").IntError>, "Millis", import("./Type.js").BrandWithoutRefineError<"Millis", import("./Type.js").NumberError | import("./Type.js").LessThanError<281474976710655> | import("./Type.js").NonNegativeError | import("./Type.js").IntError>, never>;
76
+ export type Millis = typeof Millis.Type;
77
+ /** Minimum {@link Millis} value. */
78
+ export declare const minMillis: Millis;
79
+ /** Maximum {@link Millis} value. */
80
+ export declare const maxMillis: Millis;
81
+ /**
82
+ * Converts {@link Millis} to {@link DateIso}.
83
+ *
84
+ * This is a safe cast because {@link Millis} guarantees a valid timestamp range
85
+ * that always produces a valid ISO string.
86
+ */
87
+ export declare const millisToDateIso: (value: Millis) => DateIso;
88
+ /**
89
+ * Duration can be either a {@link DurationLiteral} or milliseconds as
90
+ * {@link Millis}.
91
+ */
92
+ export type Duration = DurationLiteral | Millis;
93
+ /**
94
+ * Duration literal with compile-time validation.
39
95
  *
40
96
  * Supported formats:
41
97
  *
42
- * - Milliseconds: `0ms`, `1ms`, `500ms`, `999ms`
43
- * - Seconds: `5s`, `30s` (1-59, single digit for 1-9)
44
- * - Minutes: `5m`, `30m` (1-59, single digit for 1-9)
45
- * - Hours: `1h`, `12h`, `23h` (1-23)
46
- * - Days: `1d`, `30d`, `99d` (1-99)
47
- * - Combinations: `1s 250ms`, `30m 15s`, `2h 45m`, `7d 12h`
98
+ * - Milliseconds: `1ms`, `500ms`, `999ms` (1-999)
99
+ * - Seconds: `1s`, `59s`, `12.5s` (1-59, 1.1-59.9)
100
+ * - Minutes: `1m`, `59m`, `12.5m` (1-59, 1.1-59.9)
101
+ * - Hours: `1h`, `23h`, `12.5h` (1-23, 1.1-23.9)
102
+ * - Days: `1d`, `6d`, `1.5d` (1-6, 1.1-6.9)
103
+ * - Weeks: `1w`, `51w`, `1.5w` (1-51, 1.1-51.9)
104
+ * - Months: not supported (variable length)
105
+ * - Years: `1y`, `99y`, `1.5y` (1-99, 1.1-99.9)
106
+ *
107
+ * Each unit is limited to values that can't be expressed in the next larger
108
+ * unit, ensuring every duration has exactly one canonical representation (e.g.,
109
+ * 1000ms must be written as `"1s"`, not `"1000ms"`).
48
110
  *
49
- * Note: Duration strings are for developer experience only - they provide
50
- * readable, compile-time validated expressions but should never be persisted or
51
- * parsed from users as they are not localized. Always convert to NonNegativeInt
52
- * (milliseconds) for storage and APIs.
111
+ * Decimal values cover cases like 1.5s (1500ms) or 1.5h (90 minutes) without
112
+ * allowing redundant forms. For precise values that don't fit (e.g., 1050ms),
113
+ * use {@link Millis} directly.
114
+ *
115
+ * Zero duration (0ms) is not supported. For yielding without delay, use `await
116
+ * Promise.resolve()` for microtasks or the {@link yieldNow} for macrotasks.
117
+ *
118
+ * See {@link Duration} for a type that also accepts {@link Millis}. Use
119
+ * {@link durationToMillis} to convert to milliseconds.
120
+ */
121
+ export type DurationLiteral = DurationLiteralMilliseconds | DurationLiteralSeconds | DurationLiteralMinutes | DurationLiteralHours | DurationLiteralDays | DurationLiteralWeeks | DurationLiteralYears;
122
+ /** Milliseconds duration: `"1ms"` to `"999ms"`. See {@link DurationLiteral}. */
123
+ export type DurationLiteralMilliseconds = `${Digit1To9}ms` | `${Digit1To9}${Digit}ms` | `${Digit1To9}${Digit}${Digit}ms`;
124
+ /**
125
+ * Seconds duration: `"1s"` to `"59s"` or `"1.1s"` to `"59.9s"`. See
126
+ * {@link DurationLiteral}.
127
+ */
128
+ export type DurationLiteralSeconds = `${Digit1To59}s` | `${Digit1To59}.${Digit1To9}s`;
129
+ /**
130
+ * Minutes duration: `"1m"` to `"59m"` or `"1.1m"` to `"59.9m"`. See
131
+ * {@link DurationLiteral}.
132
+ */
133
+ export type DurationLiteralMinutes = `${Digit1To59}m` | `${Digit1To59}.${Digit1To9}m`;
134
+ /**
135
+ * Hours duration: `"1h"` to `"23h"` or `"1.1h"` to `"23.9h"`. See
136
+ * {@link DurationLiteral}.
137
+ */
138
+ export type DurationLiteralHours = `${Digit1To23}h` | `${Digit1To23}.${Digit1To9}h`;
139
+ /**
140
+ * Days duration: `"1d"` to `"6d"` or `"1.1d"` to `"6.9d"`. See
141
+ * {@link DurationLiteral}.
142
+ */
143
+ export type DurationLiteralDays = `${Digit1To6}d` | `${Digit1To6}.${Digit1To9}d`;
144
+ /**
145
+ * Weeks duration: `"1w"` to `"51w"` or `"1.1w"` to `"51.9w"`. See
146
+ * {@link DurationLiteral}.
53
147
  */
54
- export type DurationString = `${D}ms` | `${D}${D}ms` | `${D}${D}${D}ms` | `${MmSs}s` | `${MmSs}m` | `${Hours}h` | `${Days}d` | `${MmSs}s ${D}ms` | `${MmSs}s ${D}${D}ms` | `${MmSs}s ${D}${D}${D}ms` | `${MmSs}m ${MmSs}s` | `${Hours}h ${MmSs}m` | `${Days}d ${Hours}h`;
148
+ export type DurationLiteralWeeks = `${Digit1To51}w` | `${Digit1To51}.${Digit1To9}w`;
55
149
  /**
56
- * Duration can be either a {@link DurationString} or milliseconds as
57
- * {@link NonNegativeInt}.
150
+ * Years duration: `"1y"` to `"99y"` or `"1.1y"` to `"99.9y"`. See
151
+ * {@link DurationLiteral}.
58
152
  */
59
- export type Duration = DurationString | NonNegativeInt;
153
+ export type DurationLiteralYears = `${Digit1To99}y` | `${Digit1To99}.${Digit1To9}y`;
60
154
  /**
61
155
  * Converts a duration to milliseconds.
62
156
  *
63
- * Accepts either a {@link DurationString} (e.g., "5m", "1h 30m") or milliseconds
64
- * as {@link NonNegativeInt}.
157
+ * Accepts either a {@link DurationLiteral} (e.g., "5m", "1.5s") or
158
+ * {@link Millis}.
159
+ *
160
+ * ### Example
161
+ *
162
+ * ```ts
163
+ * durationToMillis("1ms"); // 1
164
+ * durationToMillis("500ms"); // 500
165
+ * durationToMillis("1.5s"); // 1500
166
+ * durationToMillis("30s"); // 30000
167
+ * durationToMillis("5m"); // 300000
168
+ * durationToMillis("12h"); // 43200000
169
+ * durationToMillis("7d"); // 604800000
170
+ * durationToMillis(Millis.orThrow(5000)); // 5000 (already Millis)
171
+ * ```
172
+ */
173
+ export declare const durationToMillis: (duration: Duration) => Millis;
174
+ /**
175
+ * Returns a Promise that resolves after the specified duration.
176
+ *
177
+ * Uses {@link Duration} parsing and `globalThis.setTimeout`.
178
+ *
179
+ * ### Example
180
+ *
181
+ * ```ts
182
+ * await setTimeout("1ms");
183
+ * ```
184
+ */
185
+ export declare const setTimeout: (duration: Duration) => Promise<void>;
186
+ /**
187
+ * Frame budget at 60fps (16ms).
188
+ *
189
+ * Work exceeding this blocks a frame, causing visible jank in animations.
190
+ */
191
+ export declare const ms60fps: Millis;
192
+ /**
193
+ * Frame budget at 120fps (8ms).
194
+ *
195
+ * For high refresh rate displays. Work exceeding this blocks a frame.
196
+ */
197
+ export declare const ms120fps: Millis;
198
+ /**
199
+ * Long task threshold (50ms).
200
+ *
201
+ * Tasks exceeding this are "long tasks" per web standards. Use with
202
+ * {@link yieldNow} to yield periodically and keep UI responsive.
203
+ *
204
+ * @see https://web.dev/articles/optimize-long-tasks
205
+ */
206
+ export declare const msLongTask: Millis;
207
+ /**
208
+ * Formats {@link Millis} as a human-readable duration string.
209
+ *
210
+ * - Under 1 minute: `1.234s`
211
+ * - Under 1 hour: `1m30.000s`
212
+ * - 1 hour or more: `1h30m45.000s`
213
+ *
214
+ * ### Example
215
+ *
216
+ * ```ts
217
+ * formatMillisAsDuration(1234 as Millis); // "1.234s"
218
+ * formatMillisAsDuration(90000 as Millis); // "1m30.000s"
219
+ * formatMillisAsDuration(3661000 as Millis); // "1h1m1.000s"
220
+ * ```
221
+ */
222
+ export declare const formatMillisAsDuration: (millis: Millis) => string;
223
+ /**
224
+ * Formats {@link Millis} as `HH:MM:SS.mmm`.
65
225
  *
66
226
  * ### Example
67
227
  *
68
228
  * ```ts
69
- * durationToNonNegativeInt("0ms"); // 0 ✅
70
- * durationToNonNegativeInt("500ms"); // 500 ✅
71
- * durationToNonNegativeInt("30s"); // 30000 ✅
72
- * durationToNonNegativeInt("5m"); // 300000 ✅
73
- * durationToNonNegativeInt("12h"); // 43200000 ✅
74
- * durationToNonNegativeInt("7d"); // 604800000 ✅
75
- * durationToNonNegativeInt("2h 45m"); // 9900000 ✅
76
- * durationToNonNegativeInt(5000); // 5000 ✅ (already milliseconds)
229
+ * formatMillisAsClockTime(Millis.orThrow(Date.now())); // "14:32:15.234"
77
230
  * ```
78
231
  */
79
- export declare const durationToNonNegativeInt: (duration: Duration) => NonNegativeInt;
232
+ export declare const formatMillisAsClockTime: (millis: Millis) => string;
80
233
  //# sourceMappingURL=Time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../src/Time.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAAO,IAa7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,IAcjC,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,IAAI,GACZ,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,GACf,IAAI,CAAC,EAAE,GACP,IAAI,CAAC,EAAE,GACP,IAAI,CAAC,EAAE,GACP,IAAI,CAAC,EAAE,GACP,IAAI,CAAC,EAAE,CAAC;AAEZ,yEAAyE;AACzE,MAAM,MAAM,KAAK,GACb,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,GACf,IAA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