@evolu/common 5.4.7 → 6.0.0-preview.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 (242) hide show
  1. package/README.md +30 -34
  2. package/dist/src/Array.d.ts +17 -0
  3. package/dist/src/Array.d.ts.map +1 -0
  4. package/dist/src/Array.js +12 -0
  5. package/dist/src/Assert.d.ts +68 -0
  6. package/dist/src/Assert.d.ts.map +1 -0
  7. package/dist/src/Assert.js +77 -0
  8. package/dist/src/BigInt.d.ts +20 -0
  9. package/dist/src/BigInt.d.ts.map +1 -0
  10. package/dist/src/BigInt.js +18 -0
  11. package/dist/src/Buffer.d.ts +92 -0
  12. package/dist/src/Buffer.d.ts.map +1 -0
  13. package/dist/src/Buffer.js +62 -0
  14. package/dist/src/Callbacks.d.ts +20 -0
  15. package/dist/src/Callbacks.d.ts.map +1 -0
  16. package/dist/src/Callbacks.js +18 -0
  17. package/dist/src/Console.d.ts +78 -0
  18. package/dist/src/Console.d.ts.map +1 -0
  19. package/dist/src/Console.js +103 -0
  20. package/dist/src/Crypto.d.ts +72 -39
  21. package/dist/src/Crypto.d.ts.map +1 -1
  22. package/dist/src/Crypto.js +89 -54
  23. package/dist/src/Eq.d.ts +97 -0
  24. package/dist/src/Eq.d.ts.map +1 -0
  25. package/dist/src/Eq.js +167 -0
  26. package/dist/src/Error.d.ts +14 -10
  27. package/dist/src/Error.d.ts.map +1 -1
  28. package/dist/src/Error.js +43 -11
  29. package/dist/src/Evolu/Config.d.ts +69 -0
  30. package/dist/src/Evolu/Config.d.ts.map +1 -0
  31. package/dist/src/Evolu/Config.js +9 -0
  32. package/dist/src/Evolu/Db.d.ts +126 -0
  33. package/dist/src/Evolu/Db.d.ts.map +1 -0
  34. package/dist/src/Evolu/Db.js +774 -0
  35. package/dist/src/Evolu/Diff.d.ts +43 -0
  36. package/dist/src/Evolu/Diff.d.ts.map +1 -0
  37. package/dist/src/Evolu/Diff.js +95 -0
  38. package/dist/src/Evolu/Evolu.d.ts +334 -0
  39. package/dist/src/Evolu/Evolu.d.ts.map +1 -0
  40. package/dist/src/Evolu/Evolu.js +434 -0
  41. package/dist/src/Evolu/Internal.d.ts +26 -0
  42. package/dist/src/Evolu/Internal.d.ts.map +1 -0
  43. package/dist/src/Evolu/Internal.js +25 -0
  44. package/dist/src/Evolu/Kysely.d.ts +6 -0
  45. package/dist/src/Evolu/Kysely.d.ts.map +1 -0
  46. package/dist/src/Evolu/Kysely.js +21 -0
  47. package/dist/src/Evolu/Owner.d.ts +155 -0
  48. package/dist/src/Evolu/Owner.d.ts.map +1 -0
  49. package/dist/src/Evolu/Owner.js +126 -0
  50. package/dist/src/Evolu/Platform.d.ts +23 -0
  51. package/dist/src/Evolu/Platform.d.ts.map +1 -0
  52. package/dist/src/Evolu/Platform.js +1 -0
  53. package/dist/src/Evolu/Protocol.d.ts +401 -0
  54. package/dist/src/Evolu/Protocol.d.ts.map +1 -0
  55. package/dist/src/Evolu/Protocol.js +1151 -0
  56. package/dist/src/Evolu/Public.d.ts +18 -0
  57. package/dist/src/Evolu/Public.d.ts.map +1 -0
  58. package/dist/src/Evolu/Public.js +11 -0
  59. package/dist/src/Evolu/PublicKysely.d.ts +148 -0
  60. package/dist/src/Evolu/PublicKysely.d.ts.map +1 -0
  61. package/dist/src/Evolu/PublicKysely.js +185 -0
  62. package/dist/src/Evolu/Query.d.ts +63 -0
  63. package/dist/src/Evolu/Query.d.ts.map +1 -0
  64. package/dist/src/Evolu/Query.js +61 -0
  65. package/dist/src/Evolu/Relay.d.ts +13 -0
  66. package/dist/src/Evolu/Relay.d.ts.map +1 -0
  67. package/dist/src/Evolu/Relay.js +109 -0
  68. package/dist/src/Evolu/Schema.d.ts +201 -0
  69. package/dist/src/Evolu/Schema.d.ts.map +1 -0
  70. package/dist/src/Evolu/Schema.js +150 -0
  71. package/dist/src/Evolu/Storage.d.ts +49 -0
  72. package/dist/src/Evolu/Storage.d.ts.map +1 -0
  73. package/dist/src/Evolu/Storage.js +1111 -0
  74. package/dist/src/Evolu/Sync.d.ts +59 -0
  75. package/dist/src/Evolu/Sync.d.ts.map +1 -0
  76. package/dist/src/Evolu/Sync.js +29 -0
  77. package/dist/src/Evolu/Timestamp.d.ts +106 -0
  78. package/dist/src/Evolu/Timestamp.d.ts.map +1 -0
  79. package/dist/src/Evolu/Timestamp.js +179 -0
  80. package/dist/src/Function.d.ts +54 -0
  81. package/dist/src/Function.d.ts.map +1 -0
  82. package/dist/src/Function.js +38 -0
  83. package/dist/src/ManyToManyMap.d.ts +26 -0
  84. package/dist/src/ManyToManyMap.d.ts.map +1 -0
  85. package/dist/src/ManyToManyMap.js +92 -0
  86. package/dist/src/NanoId.d.ts +27 -0
  87. package/dist/src/NanoId.d.ts.map +1 -0
  88. package/dist/src/NanoId.js +6 -0
  89. package/dist/src/Number.d.ts +42 -0
  90. package/dist/src/Number.d.ts.map +1 -0
  91. package/dist/src/Number.js +55 -0
  92. package/dist/src/Object.d.ts +35 -0
  93. package/dist/src/Object.d.ts.map +1 -0
  94. package/dist/src/Object.js +36 -0
  95. package/dist/src/Order.d.ts +90 -0
  96. package/dist/src/Order.d.ts.map +1 -0
  97. package/dist/src/Order.js +85 -0
  98. package/dist/src/Promise.d.ts +180 -0
  99. package/dist/src/Promise.d.ts.map +1 -0
  100. package/dist/src/Promise.js +176 -0
  101. package/dist/src/Random.d.ts +52 -0
  102. package/dist/src/Random.d.ts.map +1 -0
  103. package/dist/src/Random.js +29 -0
  104. package/dist/src/Ref.d.ts +40 -0
  105. package/dist/src/Ref.d.ts.map +1 -0
  106. package/dist/src/Ref.js +13 -0
  107. package/dist/src/Result.d.ts +421 -0
  108. package/dist/src/Result.d.ts.map +1 -0
  109. package/dist/src/Result.js +357 -0
  110. package/dist/src/Skiplist.d.ts +23 -0
  111. package/dist/src/Skiplist.d.ts.map +1 -0
  112. package/dist/src/Skiplist.js +58 -0
  113. package/dist/src/Sqlite.d.ts +116 -52
  114. package/dist/src/Sqlite.d.ts.map +1 -1
  115. package/dist/src/Sqlite.js +183 -67
  116. package/dist/src/Store.d.ts +45 -8
  117. package/dist/src/Store.d.ts.map +1 -1
  118. package/dist/src/Store.js +33 -17
  119. package/dist/src/String.d.ts +2 -0
  120. package/dist/src/String.d.ts.map +1 -0
  121. package/dist/src/String.js +14 -0
  122. package/dist/src/Time.d.ts +20 -0
  123. package/dist/src/Time.d.ts.map +1 -0
  124. package/dist/src/Time.js +25 -0
  125. package/dist/src/Type.d.ts +1937 -0
  126. package/dist/src/Type.d.ts.map +1 -0
  127. package/dist/src/Type.js +2002 -0
  128. package/dist/src/Types.d.ts +188 -0
  129. package/dist/src/Types.d.ts.map +1 -0
  130. package/dist/src/Types.js +6 -0
  131. package/dist/src/WebSocket.d.ts +112 -0
  132. package/dist/src/WebSocket.d.ts.map +1 -0
  133. package/dist/src/WebSocket.js +139 -0
  134. package/dist/src/Worker.d.ts +44 -0
  135. package/dist/src/Worker.d.ts.map +1 -0
  136. package/dist/src/Worker.js +66 -0
  137. package/dist/src/index.d.ts +24 -11
  138. package/dist/src/index.d.ts.map +1 -1
  139. package/dist/src/index.js +24 -11
  140. package/package.json +29 -38
  141. package/src/Array.ts +39 -0
  142. package/src/Assert.ts +116 -0
  143. package/src/BigInt.ts +29 -0
  144. package/src/Buffer.ts +175 -0
  145. package/src/Callbacks.ts +43 -0
  146. package/src/Console.ts +159 -0
  147. package/src/Crypto.ts +169 -115
  148. package/src/Eq.ts +204 -0
  149. package/src/Error.ts +57 -20
  150. package/src/Evolu/Config.ts +83 -0
  151. package/src/Evolu/Db.ts +1275 -0
  152. package/src/Evolu/Diff.ts +142 -0
  153. package/src/Evolu/Evolu.ts +947 -0
  154. package/src/Evolu/Internal.ts +26 -0
  155. package/src/Evolu/Kysely.ts +38 -0
  156. package/src/Evolu/Owner.ts +296 -0
  157. package/src/Evolu/Platform.ts +27 -0
  158. package/src/Evolu/Protocol.ts +1857 -0
  159. package/src/Evolu/Public.ts +43 -0
  160. package/src/Evolu/PublicKysely.ts +240 -0
  161. package/src/Evolu/Query.ts +167 -0
  162. package/src/Evolu/Relay.ts +142 -0
  163. package/src/Evolu/Schema.ts +417 -0
  164. package/src/Evolu/Storage.ts +1281 -0
  165. package/src/Evolu/Sync.ts +105 -0
  166. package/src/Evolu/Timestamp.ts +311 -0
  167. package/src/Function.ts +58 -0
  168. package/src/ManyToManyMap.ts +140 -0
  169. package/src/NanoId.ts +39 -0
  170. package/src/Number.ts +90 -0
  171. package/src/Object.ts +64 -0
  172. package/src/Order.ts +113 -0
  173. package/src/Promise.ts +295 -0
  174. package/src/Random.ts +68 -0
  175. package/src/Ref.ts +63 -0
  176. package/src/Result.ts +453 -0
  177. package/src/Skiplist.ts +102 -0
  178. package/src/Sqlite.ts +366 -153
  179. package/src/Store.ts +79 -36
  180. package/src/String.ts +10 -0
  181. package/src/Time.ts +36 -0
  182. package/src/Type.ts +3978 -0
  183. package/src/Types.ts +209 -0
  184. package/src/WebSocket.ts +273 -0
  185. package/src/Worker.ts +129 -0
  186. package/src/index.ts +24 -11
  187. package/dist/src/Config.d.ts +0 -56
  188. package/dist/src/Config.d.ts.map +0 -1
  189. package/dist/src/Config.js +0 -39
  190. package/dist/src/Crdt.d.ts +0 -89
  191. package/dist/src/Crdt.d.ts.map +0 -1
  192. package/dist/src/Crdt.js +0 -181
  193. package/dist/src/Db.d.ts +0 -107
  194. package/dist/src/Db.d.ts.map +0 -1
  195. package/dist/src/Db.js +0 -443
  196. package/dist/src/Diff.d.ts +0 -27
  197. package/dist/src/Diff.d.ts.map +0 -1
  198. package/dist/src/Diff.js +0 -84
  199. package/dist/src/Evolu.d.ts +0 -426
  200. package/dist/src/Evolu.d.ts.map +0 -1
  201. package/dist/src/Evolu.js +0 -333
  202. package/dist/src/Model.d.ts +0 -141
  203. package/dist/src/Model.d.ts.map +0 -1
  204. package/dist/src/Model.js +0 -125
  205. package/dist/src/Murmurhash.d.ts +0 -2
  206. package/dist/src/Murmurhash.d.ts.map +0 -1
  207. package/dist/src/Murmurhash.js +0 -60
  208. package/dist/src/Owner.d.ts +0 -33
  209. package/dist/src/Owner.d.ts.map +0 -1
  210. package/dist/src/Owner.js +0 -26
  211. package/dist/src/Platform.d.ts +0 -37
  212. package/dist/src/Platform.d.ts.map +0 -1
  213. package/dist/src/Platform.js +0 -11
  214. package/dist/src/Protobuf.d.ts +0 -81
  215. package/dist/src/Protobuf.d.ts.map +0 -1
  216. package/dist/src/Protobuf.js +0 -92
  217. package/dist/src/Public.d.ts +0 -13
  218. package/dist/src/Public.d.ts.map +0 -1
  219. package/dist/src/Public.js +0 -6
  220. package/dist/src/Socket.d.ts +0 -8
  221. package/dist/src/Socket.d.ts.map +0 -1
  222. package/dist/src/Socket.js +0 -51
  223. package/dist/src/Sql.d.ts +0 -12
  224. package/dist/src/Sql.d.ts.map +0 -1
  225. package/dist/src/Sql.js +0 -30
  226. package/dist/src/Sync.d.ts +0 -70
  227. package/dist/src/Sync.d.ts.map +0 -1
  228. package/dist/src/Sync.js +0 -127
  229. package/src/Config.ts +0 -119
  230. package/src/Crdt.ts +0 -361
  231. package/src/Db.ts +0 -955
  232. package/src/Diff.ts +0 -114
  233. package/src/Evolu.ts +0 -1016
  234. package/src/Model.ts +0 -233
  235. package/src/Murmurhash.ts +0 -70
  236. package/src/Owner.ts +0 -69
  237. package/src/Platform.ts +0 -47
  238. package/src/Protobuf.ts +0 -155
  239. package/src/Public.ts +0 -12
  240. package/src/Socket.ts +0 -83
  241. package/src/Sql.ts +0 -41
  242. package/src/Sync.ts +0 -315
package/README.md CHANGED
@@ -1,33 +1,10 @@
1
1
  # Evolu
2
2
 
3
- [Local-first](https://www.inkandswitch.com/local-first) platform designed for privacy, ease of use, and no vendor lock-in
4
-
5
- - [SQLite](https://sqlite.org) in all browsers, Electron, and React Native
6
- - [CRDT](https://crdt.tech) for merging changes without conflicts
7
- - End-to-end encrypted sync and backup
8
- - Free Evolu sync and backup server, or you can run your own
9
- - Typed database schema (with branded types like `NonEmptyString1000`, `PositiveInt`, etc.)
10
- - Typed SQL via [Kysely](https://kysely.dev)
11
- - Reactive queries with full React Suspense support
12
- - Real-time experience via revalidation on focus and network recovery
13
- - No signup/login, only bitcoin-like mnemonic (12 words)
14
- - Ad-hoc migration
15
- - Sqlite JSON support with automatic stringifying and parsing
16
- - Support for [Kysely Relations](https://kysely.dev/docs/recipes/relations) (loading nested objects and arrays in a single SQL query)
17
- - Local-only tables (tables with \_ prefix are not synced)
18
- - Evolu Solid/Vue/Svelte soon
19
-
20
- ## Local-first apps
21
-
22
- Local-first apps allow users to own their data by storing them on their devices. Modern browsers provide API designed precisely for that. How is it different from keeping files on disk? Files are not the right abstraction for apps and cannot synchronize among devices. That's why traditional apps use the client-server architecture. But using client-server architecture also means that users' ability to use an app depends on some server that can be offline, temporarily or forever, if a company decides to ban a user or even goes bankrupt. That's unfortunate. Luckily, a way to restore data ownership exists. It's Evolu.
3
+ Evolu is TypeScript library and local-first framework.
23
4
 
24
5
  ## Documentation
25
6
 
26
- For detailed information and usage examples, please visit [evolu.dev](https://www.evolu.dev).
27
-
28
- ## API Reference
29
-
30
- [evoluhq.github.io/evolu](https://evoluhq.github.io/evolu)
7
+ Please visit [evolu.dev](https://www.evolu.dev).
31
8
 
32
9
  ## Community
33
10
 
@@ -35,40 +12,59 @@ The Evolu community is on [GitHub Discussions](https://github.com/evoluhq/evolu/
35
12
 
36
13
  To chat with other community members, you can join the [Evolu Discord](https://discord.gg/2J8yyyyxtZ).
37
14
 
38
- [![Twitter URL](https://img.shields.io/twitter/url/https/x.com/evoluhq.svg?style=social&label=Follow%20%40evoluhq)](https://x.com/evoluhq)
15
+ [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/evoluhq.svg?style=social&label=Follow%20%40evoluhq)](https://twitter.com/evoluhq)
16
+
17
+ ## Hosting Evolu Relay
18
+
19
+ [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https%3A%2F%2Fgithub.com%2Fevoluhq%2Fevolu)
20
+
21
+ We provide a free relay `free.evoluhq.com` for testing and personal usage.
22
+
23
+ The Evolu Relay source along with the Docker files can be in the [/apps/relay](/apps/relay) directory.
39
24
 
40
- ## Contributing
25
+ Alternatively, a pre-built image `evoluhq/relay:latest` is hosted on [Docker Hub](https://hub.docker.com/r/evoluhq/relay).
26
+
27
+ For more information, reference the [Evolu Relay](https://www.evolu.dev/docs/evolu-relay) documentation.
28
+
29
+ ## Developing
41
30
 
42
31
  Evolu monorepo uses [pnpm](https://pnpm.io).
43
32
 
44
- Install the dependencies with:
33
+ Install dependencies:
45
34
 
46
35
  ```
47
36
  pnpm install
48
37
  ```
49
38
 
50
- Build Evolu monorepo:
39
+ Build monorepo:
51
40
 
52
41
  ```
53
42
  pnpm build
43
+ pnpm build:web
54
44
  ```
55
45
 
56
- Start developing and watch for code changes:
46
+ Start dev:
57
47
 
58
48
  ```
49
+ # web
59
50
  pnpm dev
51
+
52
+ # expo (pnpm dev must be running too)
53
+ pnpm ios
54
+ pnpm android
60
55
  ```
61
56
 
62
- Start iOS developing (pnpm dev must be running too):
57
+ Linting:
63
58
 
64
59
  ```
65
- pnpm ios
60
+ pnpm lint
61
+ pnpm lint-monorepo
66
62
  ```
67
63
 
68
- Lint and tests:
64
+ Tests
69
65
 
70
66
  ```
71
- pnpm lint test
67
+ pnpm test
72
68
  ```
73
69
 
74
70
  Describe changes for release log:
@@ -0,0 +1,17 @@
1
+ /** An array with at least one element. */
2
+ export type NonEmptyArray<T> = [T, ...Array<T>];
3
+ /** Checks if an array is non-empty. */
4
+ export declare const isNonEmptyArray: <T>(array: Array<T>) => array is NonEmptyArray<T>;
5
+ /** A readonly array with at least one element. */
6
+ export type NonEmptyReadonlyArray<T> = readonly [T, ...ReadonlyArray<T>];
7
+ /** Checks if an array is non-empty. */
8
+ export declare const isNonEmptyReadonlyArray: <T>(array: ReadonlyArray<T>) => array is NonEmptyReadonlyArray<T>;
9
+ /** Appends an item to an array returning a non-empty array. */
10
+ export declare const appendToArray: <T>(item: T, array: ReadonlyArray<T>) => NonEmptyReadonlyArray<T>;
11
+ /** Prepends an item to an array returning a non-empty array. */
12
+ export declare const prependToArray: <T>(item: T, array: ReadonlyArray<T>) => NonEmptyReadonlyArray<T>;
13
+ /** Maps a non-empty array using a mapper function. */
14
+ export declare const mapNonEmptyArray: <T, U>(array: NonEmptyReadonlyArray<T>, mapper: (item: T, index: number) => U) => NonEmptyReadonlyArray<U>;
15
+ /** Shifts an item from a non-empty array, guaranteed to return T. */
16
+ export declare const shiftArray: <T>(array: NonEmptyArray<T>) => T;
17
+ //# sourceMappingURL=Array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Array.d.ts","sourceRoot":"","sources":["../../src/Array.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhD,uCAAuC;AACvC,eAAO,MAAM,eAAe,GAAI,CAAC,EAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,KACd,KAAK,IAAI,aAAa,CAAC,CAAC,CAAqB,CAAC;AAEjD,kDAAkD;AAClD,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzE,uCAAuC;AACvC,eAAO,MAAM,uBAAuB,GAAI,CAAC,EACvC,OAAO,aAAa,CAAC,CAAC,CAAC,KACtB,KAAK,IAAI,qBAAqB,CAAC,CAAC,CAAqB,CAAC;AAEzD,+DAA+D;AAC/D,eAAO,MAAM,aAAa,GAAI,CAAC,EAC7B,MAAM,CAAC,EACP,OAAO,aAAa,CAAC,CAAC,CAAC,KACtB,qBAAqB,CAAC,CAAC,CAC+B,CAAC;AAE1D,gEAAgE;AAChE,eAAO,MAAM,cAAc,GAAI,CAAC,EAC9B,MAAM,CAAC,EACP,OAAO,aAAa,CAAC,CAAC,CAAC,KACtB,qBAAqB,CAAC,CAAC,CAC+B,CAAC;AAE1D,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,CAAC,EACnC,OAAO,qBAAqB,CAAC,CAAC,CAAC,EAC/B,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,KACpC,qBAAqB,CAAC,CAAC,CACgC,CAAC;AAE3D,qEAAqE;AACrE,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,OAAO,aAAa,CAAC,CAAC,CAAC,KAAG,CAAuB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Checks if an array is non-empty. */
2
+ export const isNonEmptyArray = (array) => array.length > 0;
3
+ /** Checks if an array is non-empty. */
4
+ export const isNonEmptyReadonlyArray = (array) => array.length > 0;
5
+ /** Appends an item to an array returning a non-empty array. */
6
+ export const appendToArray = (item, array) => [...array, item];
7
+ /** Prepends an item to an array returning a non-empty array. */
8
+ export const prependToArray = (item, array) => [item, ...array];
9
+ /** Maps a non-empty array using a mapper function. */
10
+ export const mapNonEmptyArray = (array, mapper) => array.map(mapper);
11
+ /** Shifts an item from a non-empty array, guaranteed to return T. */
12
+ export const shiftArray = (array) => array.shift();
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Ensures a condition is true, throwing an error with the provided message if
3
+ * not.
4
+ *
5
+ * Prevents invalid states from propagating through the system by halting
6
+ * execution when a condition fails, improving reliability and debuggability.
7
+ *
8
+ * **Warning**: Do not use this instead of {@link Type}. Assertions are intended
9
+ * for conditions that are logically guaranteed but not statically known by
10
+ * TypeScript, or for catching and signaling developer mistakes eagerly (e.g.,
11
+ * invalid configuration).
12
+ *
13
+ * ### Example
14
+ *
15
+ * ```ts
16
+ * assert(true, "true is not true"); // no-op
17
+ * assert(false, "true is not true"); // throws Error
18
+ *
19
+ * const size = fooSize - buffer.getLength();
20
+ * // Ensure required type
21
+ * assert(PositiveInt.is(size), "size is not positive int");
22
+ * ```
23
+ */
24
+ export declare const assert: (condition: unknown, message: string) => asserts condition;
25
+ /**
26
+ * Asserts that an array is non-empty.
27
+ *
28
+ * Ensures the provided array has at least one element, helping TypeScript infer
29
+ * the array as non-empty when this is logically guaranteed but not statically
30
+ * known.
31
+ *
32
+ * ### Example
33
+ *
34
+ * ```ts
35
+ * assertNonEmptyArray([1, 2, 3]); // no-op
36
+ * assertNonEmptyArray([]); // throws Error
37
+ * ```
38
+ */
39
+ export declare const assertNonEmptyArray: <T>(arr: Array<T>, message?: string) => asserts arr is [T, ...Array<T>];
40
+ /**
41
+ * Asserts that a readonly array is non-empty.
42
+ *
43
+ * Ensures the provided readonly array has at least one element, helping
44
+ * TypeScript infer non-emptiness when this is logically guaranteed but not
45
+ * statically known.
46
+ *
47
+ * ### Example
48
+ *
49
+ * ```ts
50
+ * assertNonEmptyReadonlyArray([1, 2, 3]); // no-op
51
+ * assertNonEmptyReadonlyArray([]); // throws Error
52
+ * ```
53
+ */
54
+ export declare const assertNonEmptyReadonlyArray: <T>(arr: ReadonlyArray<T>, message?: string) => asserts arr is readonly [T, ...Array<T>];
55
+ /**
56
+ * Asserts no error reaches a `.catch` block, throwing a developer error if it
57
+ * does. Used in Promise chains where errors indicate bugs to be fixed.
58
+ *
59
+ * ### Example
60
+ *
61
+ * ```ts
62
+ * Promise.reject("test").catch((e) =>
63
+ * assertNoErrorInCatch("WebSocket retry", e),
64
+ * );
65
+ * ```
66
+ */
67
+ export declare function assertNoErrorInCatch(context: string, error: unknown): never;
68
+ //# sourceMappingURL=Assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assert.d.ts","sourceRoot":"","sources":["../../src/Assert.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM,EAAE,CACnB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,SAIZ,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,EAClC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,EACb,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAKlC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,EAC1C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAK3C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,CAO3E"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Ensures a condition is true, throwing an error with the provided message if
3
+ * not.
4
+ *
5
+ * Prevents invalid states from propagating through the system by halting
6
+ * execution when a condition fails, improving reliability and debuggability.
7
+ *
8
+ * **Warning**: Do not use this instead of {@link Type}. Assertions are intended
9
+ * for conditions that are logically guaranteed but not statically known by
10
+ * TypeScript, or for catching and signaling developer mistakes eagerly (e.g.,
11
+ * invalid configuration).
12
+ *
13
+ * ### Example
14
+ *
15
+ * ```ts
16
+ * assert(true, "true is not true"); // no-op
17
+ * assert(false, "true is not true"); // throws Error
18
+ *
19
+ * const size = fooSize - buffer.getLength();
20
+ * // Ensure required type
21
+ * assert(PositiveInt.is(size), "size is not positive int");
22
+ * ```
23
+ */
24
+ export const assert = (condition, message) => {
25
+ if (!condition) {
26
+ throw new Error(message);
27
+ }
28
+ };
29
+ /**
30
+ * Asserts that an array is non-empty.
31
+ *
32
+ * Ensures the provided array has at least one element, helping TypeScript infer
33
+ * the array as non-empty when this is logically guaranteed but not statically
34
+ * known.
35
+ *
36
+ * ### Example
37
+ *
38
+ * ```ts
39
+ * assertNonEmptyArray([1, 2, 3]); // no-op
40
+ * assertNonEmptyArray([]); // throws Error
41
+ * ```
42
+ */
43
+ export const assertNonEmptyArray = (arr, message = "Expected a non-empty array.") => {
44
+ assert(arr.length > 0, message);
45
+ };
46
+ /**
47
+ * Asserts that a readonly array is non-empty.
48
+ *
49
+ * Ensures the provided readonly array has at least one element, helping
50
+ * TypeScript infer non-emptiness when this is logically guaranteed but not
51
+ * statically known.
52
+ *
53
+ * ### Example
54
+ *
55
+ * ```ts
56
+ * assertNonEmptyReadonlyArray([1, 2, 3]); // no-op
57
+ * assertNonEmptyReadonlyArray([]); // throws Error
58
+ * ```
59
+ */
60
+ export const assertNonEmptyReadonlyArray = (arr, message = "Expected a non-empty readonly array.") => {
61
+ assert(arr.length > 0, message);
62
+ };
63
+ /**
64
+ * Asserts no error reaches a `.catch` block, throwing a developer error if it
65
+ * does. Used in Promise chains where errors indicate bugs to be fixed.
66
+ *
67
+ * ### Example
68
+ *
69
+ * ```ts
70
+ * Promise.reject("test").catch((e) =>
71
+ * assertNoErrorInCatch("WebSocket retry", e),
72
+ * );
73
+ * ```
74
+ */
75
+ export function assertNoErrorInCatch(context, error) {
76
+ throw Object.assign(new Error(`Error in ${context}: an unexpected error reached a catch block and requires a fix`), { cause: error });
77
+ }
@@ -0,0 +1,20 @@
1
+ import { Predicate } from "./Types.js";
2
+ /** Increments a bigint by 1. */
3
+ export declare const incrementBigInt: (n: bigint) => bigint;
4
+ /** Decrements a bigint by 1. */
5
+ export declare const decrementBigInt: (n: bigint) => bigint;
6
+ /** Clamps a bigint within a given range. */
7
+ export declare const clampBigInt: (min: bigint, max: bigint) => (n: bigint) => bigint;
8
+ /**
9
+ * Creates a predicate that checks if a BigInt is within a range, inclusive.
10
+ *
11
+ * ### Example
12
+ *
13
+ * ```ts
14
+ * const isBetween10And20 = isBetweenBigInt(10n, 20n);
15
+ * console.log(isBetween10And20(15n)); // true
16
+ * console.log(isBetween10And20(25n)); // false
17
+ * ```
18
+ */
19
+ export declare const isBetweenBigInt: (min: bigint, max: bigint) => Predicate<bigint>;
20
+ //# sourceMappingURL=BigInt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BigInt.d.ts","sourceRoot":"","sources":["../../src/BigInt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,gCAAgC;AAChC,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM,KAAG,MAAgB,CAAC;AAE7D,gCAAgC;AAChC,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM,KAAG,MAAgB,CAAC;AAE7D,4CAA4C;AAC5C,eAAO,MAAM,WAAW,GACrB,KAAK,MAAM,EAAE,KAAK,MAAM,MACxB,GAAG,MAAM,KAAG,MACsB,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GACzB,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,SAAS,CAAC,MAAM,CAEd,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** Increments a bigint by 1. */
2
+ export const incrementBigInt = (n) => n + 1n;
3
+ /** Decrements a bigint by 1. */
4
+ export const decrementBigInt = (n) => n - 1n;
5
+ /** Clamps a bigint within a given range. */
6
+ export const clampBigInt = (min, max) => (n) => n < min ? min : n > max ? max : n;
7
+ /**
8
+ * Creates a predicate that checks if a BigInt is within a range, inclusive.
9
+ *
10
+ * ### Example
11
+ *
12
+ * ```ts
13
+ * const isBetween10And20 = isBetweenBigInt(10n, 20n);
14
+ * console.log(isBetween10And20(15n)); // true
15
+ * console.log(isBetween10And20(25n)); // false
16
+ * ```
17
+ */
18
+ export const isBetweenBigInt = (min, max) => (value) => value >= min && value <= max;
@@ -0,0 +1,92 @@
1
+ import { NonNegativeInt } from "./Type.js";
2
+ export { bytesToHex, bytesToUtf8, concatBytes, hexToBytes, utf8ToBytes, } from "@noble/ciphers/utils";
3
+ /**
4
+ * Custom error for {@link Buffer}-related failures like premature end of data.
5
+ * Provides better stack traces for debugging binary protocol issues.
6
+ */
7
+ export declare class BufferError extends Error {
8
+ constructor(message: string);
9
+ }
10
+ /**
11
+ * A Buffer is a dynamic, resizable container for binary data, optimized for
12
+ * scenarios where the final size is unknown. It grows exponentially (doubling
13
+ * its capacity) to minimize memory reallocations and uses `subarray` for
14
+ * efficient, copy-free data access in methods like `unwrap` and `shift`.
15
+ *
16
+ * ### Recommended Usage
17
+ *
18
+ * Create as few Buffers as possible—typically one main Buffer for the final
19
+ * output. Temporary Buffers are allowed when necessary (e.g., for
20
+ * variable-length headers), but avoid excessive allocations. Buffers can be
21
+ * reused within functions by leveraging `reset` to clear contents while
22
+ * preserving capacity, or `truncate` to adjust the length to a specific size,
23
+ * reducing the need for new allocations. Pass Buffers to `encode*` functions to
24
+ * append serialized data and use `decode*` functions to extract data. Both
25
+ * `shift` and `shiftN` throw an {@link BufferError} with message "Buffer parse
26
+ * ended prematurely" on failure, as do higher-level `decode*` functions,
27
+ * providing stack traces for debugging instead of using {@link Result}. This
28
+ * avoids allocation overhead in success cases and leverages exceptions'
29
+ * diagnostic benefits.
30
+ *
31
+ * ### Example
32
+ *
33
+ * ```ts
34
+ * const buffer = createBuffer();
35
+ * encodeNonNegativeInt(buffer, someInt);
36
+ * encodeId(buffer, someId);
37
+ * const result = buffer.unwrap(); // Final serialized data
38
+ *
39
+ * // Decoding example (throws on error)
40
+ * try {
41
+ * const num = decodeNonNegativeInt(buffer);
42
+ * const id = decodeId(buffer);
43
+ * } catch (e) {
44
+ * console.error(e.stack); // Stack trace for debugging
45
+ * }
46
+ * ```
47
+ *
48
+ * For more on exponential growth, see:
49
+ * https://blog.mozilla.org/nnethercote/2014/11/04/please-grow-your-buffers-exponentially
50
+ */
51
+ export interface Buffer {
52
+ /** Returns the total allocated size of the buffer. */
53
+ getCapacity: () => NonNegativeInt;
54
+ /** Returns the current number of bytes stored in the buffer. */
55
+ getLength: () => NonNegativeInt;
56
+ /**
57
+ * Appends binary data to the buffer, resizing if necessary. Throws if
58
+ * `arg.length` is not a non-negative integer.
59
+ */
60
+ extend: (arg: Uint8Array | ArrayLike<number>) => void;
61
+ /**
62
+ * Removes and returns the first byte. Throws an `Error` with message "Buffer
63
+ * parse ended prematurely" if the buffer is empty.
64
+ */
65
+ shift: () => NonNegativeInt;
66
+ /**
67
+ * Removes and returns the first `n` bytes. Throws an `Error` with message
68
+ * "Buffer parse ended prematurely" if fewer than `n` bytes remain.
69
+ */
70
+ shiftN: (n: NonNegativeInt) => Uint8Array;
71
+ /**
72
+ * Truncates the buffer to the specified length, discarding data from the end.
73
+ * Throws if the new length is greater than the current length.
74
+ */
75
+ truncate: (length: NonNegativeInt) => void;
76
+ /**
77
+ * Resets the buffer to its initial empty state, preserving its capacity.
78
+ *
79
+ * This allows efficient buffer reuse without reallocating memory. Use this
80
+ * when you want to clear the buffer and write new data, avoiding unnecessary
81
+ * allocations.
82
+ */
83
+ reset: () => void;
84
+ /**
85
+ * Returns a view of the buffer’s current data. Do not modify this array, as
86
+ * it directly alters the buffer’s internal state, potentially breaking
87
+ * subsequent operations.
88
+ */
89
+ unwrap: () => Uint8Array;
90
+ }
91
+ export declare const createBuffer: (arrayLike?: Uint8Array | ArrayLike<number>) => Buffer;
92
+ //# sourceMappingURL=Buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Buffer.d.ts","sourceRoot":"","sources":["../../src/Buffer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,qBAAa,WAAY,SAAQ,KAAK;gBACxB,OAAO,EAAE,MAAM;CAM5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,MAAM;IACrB,sDAAsD;IACtD,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,eAAO,MAAM,YAAY,GACvB,YAAY,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,KACzC,MA4DF,CAAC"}
@@ -0,0 +1,62 @@
1
+ export { bytesToHex, bytesToUtf8, concatBytes, hexToBytes, utf8ToBytes, } from "@noble/ciphers/utils";
2
+ /**
3
+ * Custom error for {@link Buffer}-related failures like premature end of data.
4
+ * Provides better stack traces for debugging binary protocol issues.
5
+ */
6
+ export class BufferError extends Error {
7
+ constructor(message) {
8
+ super(message);
9
+ this.name = this.constructor.name;
10
+ Error.captureStackTrace(this, this.constructor);
11
+ }
12
+ }
13
+ export const createBuffer = (arrayLike) => {
14
+ let value = arrayLike
15
+ ? new globalThis.Uint8Array(arrayLike)
16
+ : new globalThis.Uint8Array(512);
17
+ let length = (arrayLike ? arrayLike.length : 0);
18
+ const buffer = {
19
+ getCapacity: () => value.length,
20
+ getLength: () => length,
21
+ extend: (arg) => {
22
+ const targetSize = length + arg.length;
23
+ if (value.length < targetSize) {
24
+ const oldValue = value;
25
+ const newCapacity = Math.max(value.length * 2, targetSize);
26
+ value = new globalThis.Uint8Array(newCapacity);
27
+ value.set(oldValue);
28
+ }
29
+ value.set(arg, length);
30
+ length = (length + arg.length);
31
+ },
32
+ shift: () => {
33
+ if (length === 0) {
34
+ throw new BufferError("Buffer parse ended prematurely");
35
+ }
36
+ const first = value[0];
37
+ value = value.subarray(1);
38
+ length--;
39
+ return first;
40
+ },
41
+ shiftN: (n) => {
42
+ if (length < n) {
43
+ throw new BufferError("Buffer parse ended prematurely");
44
+ }
45
+ const subarray = value.subarray(0, n);
46
+ value = value.subarray(n);
47
+ length = (length - n);
48
+ return subarray;
49
+ },
50
+ truncate: (newLength) => {
51
+ if (newLength > length) {
52
+ throw new BufferError("Cannot truncate to a length greater than current");
53
+ }
54
+ length = newLength;
55
+ },
56
+ reset: () => {
57
+ length = 0;
58
+ },
59
+ unwrap: () => value.subarray(0, length),
60
+ };
61
+ return buffer;
62
+ };
@@ -0,0 +1,20 @@
1
+ import { NanoIdLibDep } from "./NanoId.js";
2
+ import { Brand } from "./Types.js";
3
+ /**
4
+ * Manages one-time callback functions.
5
+ *
6
+ * Allows registering callbacks with a unique ID and executing them once with an
7
+ * optional argument. Executed callbacks are automatically removed.
8
+ *
9
+ * This is useful for managing event-driven or asynchronous workflows where
10
+ * callbacks need to be invoked only once.
11
+ */
12
+ export interface Callbacks {
13
+ /** Registers a callback function and returns a unique ID. */
14
+ readonly register: (callback: (arg?: unknown) => void) => CallbackId;
15
+ /** Executes and removes a callback associated with the given ID. */
16
+ readonly execute: (id: CallbackId, arg?: unknown) => void;
17
+ }
18
+ export type CallbackId = string & Brand<"CallbackId">;
19
+ export declare const createCallbacks: (deps: NanoIdLibDep) => Callbacks;
20
+ //# sourceMappingURL=Callbacks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Callbacks.d.ts","sourceRoot":"","sources":["../../src/Callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,UAAU,CAAC;IAErE,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAEtD,eAAO,MAAM,eAAe,GAAI,MAAM,YAAY,KAAG,SAoBpD,CAAC"}
@@ -0,0 +1,18 @@
1
+ export const createCallbacks = (deps) => {
2
+ const callbackMap = new Map();
3
+ const callbacks = {
4
+ register: (callback) => {
5
+ const id = deps.nanoIdLib.nanoid();
6
+ callbackMap.set(id, callback);
7
+ return id;
8
+ },
9
+ execute: (id, arg) => {
10
+ const callback = callbackMap.get(id);
11
+ if (callback) {
12
+ callbackMap.delete(id);
13
+ callback(arg);
14
+ }
15
+ },
16
+ };
17
+ return callbacks;
18
+ };
@@ -0,0 +1,78 @@
1
+ /**
2
+ * 📝 Cross-platform console
3
+ *
4
+ * Console abstraction for Chrome 123+, Firefox 125+, Safari 18.1+, Node.js
5
+ * 22.x+, and React Native 0.75+. Includes methods guaranteed to be available in
6
+ * these environments and expected to remain compatible in future versions.
7
+ * Output formatting may vary (e.g., interactive UI in browsers vs. text in
8
+ * Node.js/React Native), but functionality is consistent across platforms.
9
+ *
10
+ * **Convention**: Use a tag (e.g., `[db]`) as the first argument for log
11
+ * filtering.
12
+ *
13
+ * ### Example
14
+ *
15
+ * ```ts
16
+ * deps.console.log("[db]", "send data message", protocolMessage);
17
+ * ```
18
+ *
19
+ * **Tip**: In browser dev tools, you can filter logs by tag (e.g., `[db]`) to
20
+ * quickly find relevant messages.
21
+ *
22
+ * **Warning**: If you encounter platform-specific issues or missing methods,
23
+ * please contribute a PR with details about the environment and behavior.
24
+ *
25
+ * @module
26
+ */
27
+ /**
28
+ * Cross-platform Console interface for Chrome 123+, Firefox 125+, Safari 18.1+,
29
+ * Node.js 22.x+, and React Native 0.75+
30
+ */
31
+ export interface Console {
32
+ /** Controls whether console methods produce output (default: true) */
33
+ enabled?: boolean;
34
+ /** Outputs a message to the console */
35
+ log: (...args: Array<any>) => void;
36
+ /** Outputs an informational message (often same as log) */
37
+ info: (...args: Array<any>) => void;
38
+ /** Outputs a warning message */
39
+ warn: (...args: Array<any>) => void;
40
+ /** Outputs an error message */
41
+ error: (...args: Array<any>) => void;
42
+ /** Outputs a debug message */
43
+ debug: (...args: Array<any>) => void;
44
+ /** Starts a timer with an optional label */
45
+ time: (label?: string) => void;
46
+ /** Ends a timer and logs the elapsed time */
47
+ timeEnd: (label?: string) => void;
48
+ /** Displays an object's properties in a detailed format */
49
+ dir: (object: any, options?: any) => void;
50
+ /** Displays tabular data as a table */
51
+ table: (tabularData: any, properties?: Array<string>) => void;
52
+ /** Logs the number of times this has been called with the given label */
53
+ count: (label?: string) => void;
54
+ /** Resets the counter for the given label */
55
+ countReset: (label?: string) => void;
56
+ /** Writes a message if the value is falsy, otherwise does nothing */
57
+ assert: (value: any, message?: string, ...optionalParams: Array<any>) => void;
58
+ /** Logs the elapsed time for a timer without ending it */
59
+ timeLog: (label?: string, ...data: Array<any>) => void;
60
+ /** Prints a stack trace with an optional message */
61
+ trace: (message?: any, ...optionalParams: Array<any>) => void;
62
+ }
63
+ /** Dependency interface for injecting a Console instance. */
64
+ export interface ConsoleDep {
65
+ readonly console: Console;
66
+ }
67
+ export interface ConsoleConfig {
68
+ /**
69
+ * Enable or disable console logging (default: false). When true, logs are
70
+ * output to the {@link Console}; when false, logging is disabled for all
71
+ * methods except `error`, which always outputs to ensure critical issues are
72
+ * not missed.
73
+ */
74
+ readonly enableLogging?: boolean;
75
+ }
76
+ /** Creates a console instance using the global console. */
77
+ export declare const createConsole: (config?: ConsoleConfig) => Console;
78
+ //# sourceMappingURL=Console.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Console.d.ts","sourceRoot":"","sources":["../../src/Console.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,uCAAuC;IACvC,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAEnC,2DAA2D;IAC3D,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAEpC,gCAAgC;IAChC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAEpC,+BAA+B;IAC/B,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAErC,8BAA8B;IAC9B,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAErC,4CAA4C;IAC5C,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/B,6CAA6C;IAC7C,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,2DAA2D;IAC3D,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAE1C,uCAAuC;IACvC,KAAK,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAE9D,yEAAyE;IACzE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC,6CAA6C;IAC7C,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,qEAAqE;IACrE,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAE9E,0DAA0D;IAC1D,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IAEvD,oDAAoD;IACpD,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CAC/D;AAED,6DAA6D;AAC7D,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,2DAA2D;AAC3D,eAAO,MAAM,aAAa,GAAI,SAAQ,aAAkB,KAAG,OAgE1D,CAAC"}