@livestore/utils 0.4.0 → 0.5.0-dev.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 (247) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/NoopTracer.d.ts +7 -8
  3. package/dist/NoopTracer.d.ts.map +1 -1
  4. package/dist/NoopTracer.js +3 -18
  5. package/dist/NoopTracer.js.map +1 -1
  6. package/dist/NoopTracer.test.d.ts +2 -0
  7. package/dist/NoopTracer.test.d.ts.map +1 -0
  8. package/dist/NoopTracer.test.js +17 -0
  9. package/dist/NoopTracer.test.js.map +1 -0
  10. package/dist/browser/Opfs/Opfs.d.ts +179 -29
  11. package/dist/browser/Opfs/Opfs.d.ts.map +1 -1
  12. package/dist/browser/Opfs/Opfs.js +132 -307
  13. package/dist/browser/Opfs/Opfs.js.map +1 -1
  14. package/dist/browser/Opfs/debug-utils.d.ts.map +1 -1
  15. package/dist/browser/Opfs/debug-utils.js +5 -4
  16. package/dist/browser/Opfs/debug-utils.js.map +1 -1
  17. package/dist/browser/Opfs/utils.d.ts +8 -8
  18. package/dist/browser/Opfs/utils.d.ts.map +1 -1
  19. package/dist/browser/Opfs/utils.js +35 -26
  20. package/dist/browser/Opfs/utils.js.map +1 -1
  21. package/dist/browser/QuotaExceededError.d.ts +10 -9
  22. package/dist/browser/QuotaExceededError.d.ts.map +1 -1
  23. package/dist/browser/WebChannelBrowser.d.ts.map +1 -1
  24. package/dist/browser/WebChannelBrowser.js +21 -10
  25. package/dist/browser/WebChannelBrowser.js.map +1 -1
  26. package/dist/browser/WebError.d.ts +54 -86
  27. package/dist/browser/WebError.d.ts.map +1 -1
  28. package/dist/browser/WebError.js +91 -84
  29. package/dist/browser/WebError.js.map +1 -1
  30. package/dist/browser/WebError.test.js +6 -6
  31. package/dist/browser/WebError.test.js.map +1 -1
  32. package/dist/browser/WebLock.d.ts.map +1 -1
  33. package/dist/browser/WebLock.js +13 -13
  34. package/dist/browser/WebLock.js.map +1 -1
  35. package/dist/effect/Debug.d.ts +4 -7
  36. package/dist/effect/Debug.d.ts.map +1 -1
  37. package/dist/effect/Debug.js +32 -36
  38. package/dist/effect/Debug.js.map +1 -1
  39. package/dist/effect/Effect.d.ts +31 -22
  40. package/dist/effect/Effect.d.ts.map +1 -1
  41. package/dist/effect/Effect.js +51 -47
  42. package/dist/effect/Effect.js.map +1 -1
  43. package/dist/effect/Effect.test.d.ts +2 -0
  44. package/dist/effect/Effect.test.d.ts.map +1 -0
  45. package/dist/effect/Effect.test.js +72 -0
  46. package/dist/effect/Effect.test.js.map +1 -0
  47. package/dist/effect/Error.d.ts +4 -6
  48. package/dist/effect/Error.d.ts.map +1 -1
  49. package/dist/effect/Logger.d.ts +0 -6
  50. package/dist/effect/Logger.d.ts.map +1 -1
  51. package/dist/effect/Logger.js +0 -32
  52. package/dist/effect/Logger.js.map +1 -1
  53. package/dist/effect/OtelTracer.d.ts +1 -1
  54. package/dist/effect/OtelTracer.d.ts.map +1 -1
  55. package/dist/effect/OtelTracer.js +2 -3
  56. package/dist/effect/OtelTracer.js.map +1 -1
  57. package/dist/effect/RpcClient.d.ts +7 -7
  58. package/dist/effect/RpcClient.d.ts.map +1 -1
  59. package/dist/effect/RpcClient.js +72 -52
  60. package/dist/effect/RpcClient.js.map +1 -1
  61. package/dist/effect/Schedule.d.ts +1 -1
  62. package/dist/effect/Schedule.d.ts.map +1 -1
  63. package/dist/effect/Schedule.js +2 -2
  64. package/dist/effect/Schedule.js.map +1 -1
  65. package/dist/effect/Schema/debug-diff.d.ts +1 -1
  66. package/dist/effect/Schema/debug-diff.d.ts.map +1 -1
  67. package/dist/effect/Schema/debug-diff.js +5 -7
  68. package/dist/effect/Schema/debug-diff.js.map +1 -1
  69. package/dist/effect/Schema/debug-diff.test.js +7 -4
  70. package/dist/effect/Schema/debug-diff.test.js.map +1 -1
  71. package/dist/effect/Schema/index.d.ts +28 -20
  72. package/dist/effect/Schema/index.d.ts.map +1 -1
  73. package/dist/effect/Schema/index.js +55 -28
  74. package/dist/effect/Schema/index.js.map +1 -1
  75. package/dist/effect/Stream.d.ts +13 -5
  76. package/dist/effect/Stream.d.ts.map +1 -1
  77. package/dist/effect/Stream.js +19 -12
  78. package/dist/effect/Stream.js.map +1 -1
  79. package/dist/effect/Stream.test.js +9 -9
  80. package/dist/effect/Stream.test.js.map +1 -1
  81. package/dist/effect/Subscribable.d.ts +9 -3
  82. package/dist/effect/Subscribable.d.ts.map +1 -1
  83. package/dist/effect/Subscribable.js +20 -35
  84. package/dist/effect/Subscribable.js.map +1 -1
  85. package/dist/effect/SubscriptionRef.d.ts +5 -6
  86. package/dist/effect/SubscriptionRef.d.ts.map +1 -1
  87. package/dist/effect/SubscriptionRef.js +2 -3
  88. package/dist/effect/SubscriptionRef.js.map +1 -1
  89. package/dist/effect/TaskTracing.d.ts +1 -1
  90. package/dist/effect/TaskTracing.d.ts.map +1 -1
  91. package/dist/effect/TaskTracing.js +12 -16
  92. package/dist/effect/TaskTracing.js.map +1 -1
  93. package/dist/effect/WebChannel/WebChannel.d.ts +7 -7
  94. package/dist/effect/WebChannel/WebChannel.d.ts.map +1 -1
  95. package/dist/effect/WebChannel/WebChannel.js +64 -43
  96. package/dist/effect/WebChannel/WebChannel.js.map +1 -1
  97. package/dist/effect/WebChannel/WebChannel.test.js +15 -15
  98. package/dist/effect/WebChannel/WebChannel.test.js.map +1 -1
  99. package/dist/effect/WebChannel/broadcastChannelWithAck.d.ts.map +1 -1
  100. package/dist/effect/WebChannel/broadcastChannelWithAck.js +16 -9
  101. package/dist/effect/WebChannel/broadcastChannelWithAck.js.map +1 -1
  102. package/dist/effect/WebChannel/common.d.ts +16 -17
  103. package/dist/effect/WebChannel/common.d.ts.map +1 -1
  104. package/dist/effect/WebChannel/common.js +6 -6
  105. package/dist/effect/WebChannel/common.js.map +1 -1
  106. package/dist/effect/WebSocket.d.ts +4 -6
  107. package/dist/effect/WebSocket.d.ts.map +1 -1
  108. package/dist/effect/WebSocket.js +4 -4
  109. package/dist/effect/WebSocket.js.map +1 -1
  110. package/dist/effect/WebSocket.test.js +2 -2
  111. package/dist/effect/WebSocket.test.js.map +1 -1
  112. package/dist/effect/mod.browser-build.test.d.ts +2 -0
  113. package/dist/effect/mod.browser-build.test.d.ts.map +1 -0
  114. package/dist/effect/mod.browser-build.test.js +18 -0
  115. package/dist/effect/mod.browser-build.test.js.map +1 -0
  116. package/dist/effect/mod.d.ts +13 -15
  117. package/dist/effect/mod.d.ts.map +1 -1
  118. package/dist/effect/mod.js +13 -18
  119. package/dist/effect/mod.js.map +1 -1
  120. package/dist/effect/spanEvent.d.ts.map +1 -1
  121. package/dist/effect/spanEvent.js +2 -2
  122. package/dist/effect/spanEvent.js.map +1 -1
  123. package/dist/effect/spanEvent.test.js +10 -13
  124. package/dist/effect/spanEvent.test.js.map +1 -1
  125. package/dist/fast-deep-equal.d.ts.map +1 -1
  126. package/dist/fast-deep-equal.js +1 -2
  127. package/dist/fast-deep-equal.js.map +1 -1
  128. package/dist/misc.js +2 -2
  129. package/dist/misc.js.map +1 -1
  130. package/dist/mod.d.ts +0 -35
  131. package/dist/mod.d.ts.map +1 -1
  132. package/dist/mod.js +0 -8
  133. package/dist/mod.js.map +1 -1
  134. package/dist/node/mod.d.ts +17 -11
  135. package/dist/node/mod.d.ts.map +1 -1
  136. package/dist/node/mod.js +23 -16
  137. package/dist/node/mod.js.map +1 -1
  138. package/dist/object/index.d.ts +0 -9
  139. package/dist/object/index.d.ts.map +1 -1
  140. package/dist/object/index.js +0 -9
  141. package/dist/object/index.js.map +1 -1
  142. package/dist/string.d.ts +0 -2
  143. package/dist/string.d.ts.map +1 -1
  144. package/dist/string.js +0 -2
  145. package/dist/string.js.map +1 -1
  146. package/package.json +18 -36
  147. package/src/NoopTracer.test.ts +20 -0
  148. package/src/NoopTracer.ts +18 -41
  149. package/src/browser/Opfs/Opfs.ts +304 -277
  150. package/src/browser/Opfs/debug-utils.ts +7 -6
  151. package/src/browser/Opfs/utils.ts +36 -26
  152. package/src/browser/QuotaExceededError.ts +13 -10
  153. package/src/browser/WebChannelBrowser.ts +25 -11
  154. package/src/browser/WebError.test.ts +6 -6
  155. package/src/browser/WebError.ts +107 -133
  156. package/src/browser/WebLock.ts +13 -14
  157. package/src/effect/Debug.ts +66 -59
  158. package/src/effect/Effect.test.ts +117 -0
  159. package/src/effect/Effect.ts +84 -71
  160. package/src/effect/Logger.ts +0 -48
  161. package/src/effect/OtelTracer.ts +2 -3
  162. package/src/effect/RpcClient.ts +80 -61
  163. package/src/effect/Schedule.ts +4 -5
  164. package/src/effect/Schema/debug-diff.test.ts +6 -6
  165. package/src/effect/Schema/debug-diff.ts +6 -8
  166. package/src/effect/Schema/index.ts +122 -61
  167. package/src/effect/Stream.test.ts +9 -9
  168. package/src/effect/Stream.ts +23 -16
  169. package/src/effect/Subscribable.ts +31 -42
  170. package/src/effect/SubscriptionRef.ts +8 -12
  171. package/src/effect/TaskTracing.ts +13 -16
  172. package/src/effect/WebChannel/WebChannel.test.ts +23 -23
  173. package/src/effect/WebChannel/WebChannel.ts +87 -55
  174. package/src/effect/WebChannel/broadcastChannelWithAck.ts +21 -11
  175. package/src/effect/WebChannel/common.ts +14 -15
  176. package/src/effect/WebSocket.test.ts +2 -2
  177. package/src/effect/WebSocket.ts +9 -6
  178. package/src/effect/mod.browser-build.test.ts +19 -0
  179. package/src/effect/mod.ts +35 -69
  180. package/src/effect/spanEvent.test.ts +10 -13
  181. package/src/effect/spanEvent.ts +5 -3
  182. package/src/fast-deep-equal.ts +1 -2
  183. package/src/misc.ts +2 -2
  184. package/src/mod.ts +0 -36
  185. package/src/node/mod.ts +26 -20
  186. package/src/object/index.ts +0 -24
  187. package/src/string.ts +0 -3
  188. package/dist/effect/BucketQueue.d.ts +0 -20
  189. package/dist/effect/BucketQueue.d.ts.map +0 -1
  190. package/dist/effect/BucketQueue.js +0 -34
  191. package/dist/effect/BucketQueue.js.map +0 -1
  192. package/dist/effect/Scheduler.d.ts +0 -4
  193. package/dist/effect/Scheduler.d.ts.map +0 -1
  194. package/dist/effect/Scheduler.js +0 -9
  195. package/dist/effect/Scheduler.js.map +0 -1
  196. package/dist/effect/ServiceContext.d.ts +0 -37
  197. package/dist/effect/ServiceContext.d.ts.map +0 -1
  198. package/dist/effect/ServiceContext.js +0 -55
  199. package/dist/effect/ServiceContext.js.map +0 -1
  200. package/dist/guards.d.ts +0 -20
  201. package/dist/guards.d.ts.map +0 -1
  202. package/dist/guards.js +0 -20
  203. package/dist/guards.js.map +0 -1
  204. package/dist/node/ChildProcessRunner/ChildProcessRunner.d.ts +0 -4
  205. package/dist/node/ChildProcessRunner/ChildProcessRunner.d.ts.map +0 -1
  206. package/dist/node/ChildProcessRunner/ChildProcessRunner.js +0 -128
  207. package/dist/node/ChildProcessRunner/ChildProcessRunner.js.map +0 -1
  208. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.d.ts +0 -10
  209. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.d.ts.map +0 -1
  210. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.js +0 -217
  211. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.js.map +0 -1
  212. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/schema.d.ts +0 -84
  213. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/schema.d.ts.map +0 -1
  214. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/schema.js +0 -68
  215. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/schema.js.map +0 -1
  216. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.d.ts +0 -2
  217. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.d.ts.map +0 -1
  218. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.js +0 -52
  219. package/dist/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.js.map +0 -1
  220. package/dist/node/ChildProcessRunner/ChildProcessWorker.d.ts +0 -23
  221. package/dist/node/ChildProcessRunner/ChildProcessWorker.d.ts.map +0 -1
  222. package/dist/node/ChildProcessRunner/ChildProcessWorker.js +0 -138
  223. package/dist/node/ChildProcessRunner/ChildProcessWorker.js.map +0 -1
  224. package/dist/object/omit.d.ts +0 -3
  225. package/dist/object/omit.d.ts.map +0 -1
  226. package/dist/object/omit.js +0 -14
  227. package/dist/object/omit.js.map +0 -1
  228. package/dist/object/pick.d.ts +0 -14
  229. package/dist/object/pick.d.ts.map +0 -1
  230. package/dist/object/pick.js +0 -17
  231. package/dist/object/pick.js.map +0 -1
  232. package/dist/time.d.ts +0 -12
  233. package/dist/time.d.ts.map +0 -1
  234. package/dist/time.js +0 -22
  235. package/dist/time.js.map +0 -1
  236. package/src/effect/BucketQueue.ts +0 -49
  237. package/src/effect/Scheduler.ts +0 -13
  238. package/src/effect/ServiceContext.ts +0 -108
  239. package/src/guards.ts +0 -23
  240. package/src/node/ChildProcessRunner/ChildProcessRunner.ts +0 -148
  241. package/src/node/ChildProcessRunner/ChildProcessRunnerTest/ChildProcessRunner.test.ts +0 -311
  242. package/src/node/ChildProcessRunner/ChildProcessRunnerTest/schema.ts +0 -78
  243. package/src/node/ChildProcessRunner/ChildProcessRunnerTest/serializedWorker.ts +0 -65
  244. package/src/node/ChildProcessRunner/ChildProcessWorker.ts +0 -169
  245. package/src/object/omit.ts +0 -17
  246. package/src/object/pick.ts +0 -27
  247. package/src/time.ts +0 -25
package/src/effect/mod.ts CHANGED
@@ -1,34 +1,11 @@
1
1
  import '../global.ts'
2
2
 
3
+ export { Otlp } from 'effect/unstable/observability'
4
+ export { Msgpack } from 'effect/unstable/encoding'
3
5
  export {
4
- AiError,
5
- LanguageModel,
6
- LanguageModel as AiLanguageModel,
7
- McpSchema,
8
- McpServer,
9
- Model,
10
- Model as AiModel,
11
- Prompt,
12
- Tool,
13
- Tool as AiTool,
14
- Toolkit,
15
- Toolkit as AiToolkit,
16
- } from '@effect/ai'
17
- // export { DevTools as EffectDevtools } from '@effect/experimental'
18
- export { Sse } from '@effect/experimental'
19
- export * as Otlp from '@effect/opentelemetry/Otlp'
20
- export {
21
- Command,
22
- CommandExecutor,
23
- Error as PlatformError,
24
6
  FetchHttpClient,
25
- FileSystem,
26
7
  Headers,
27
- HttpApi,
28
- HttpApiClient,
29
- HttpApiEndpoint,
30
- HttpApiGroup,
31
- HttpApp,
8
+ HttpEffect,
32
9
  HttpClient,
33
10
  HttpClientError,
34
11
  HttpClientRequest,
@@ -38,19 +15,15 @@ export {
38
15
  HttpServer,
39
16
  HttpServerRequest,
40
17
  HttpServerResponse,
41
- KeyValueStore,
42
- MsgPack,
43
- Socket,
44
- Terminal,
45
- Transferable,
46
18
  UrlParams,
47
- Worker,
48
- WorkerError,
49
- WorkerRunner,
50
- } from '@effect/platform'
19
+ } from 'effect/unstable/http'
20
+ export { HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup } from 'effect/unstable/httpapi'
21
+ export { KeyValueStore } from 'effect/unstable/persistence'
22
+ export { ChildProcess, ChildProcessSpawner } from 'effect/unstable/process'
23
+ export { Socket } from 'effect/unstable/socket'
24
+ export { Transferable, Worker, WorkerError, WorkerRunner } from 'effect/unstable/workers'
51
25
  export {
52
26
  Rpc,
53
- // RpcClient, // TODO bring back "original" RpcClient from effect/rpc
54
27
  RpcClientError,
55
28
  RpcGroup,
56
29
  RpcMessage,
@@ -60,7 +33,7 @@ export {
60
33
  RpcServer,
61
34
  RpcTest,
62
35
  RpcWorker,
63
- } from '@effect/rpc'
36
+ } from 'effect/unstable/rpc'
64
37
  export * as StandardSchema from '@standard-schema/spec'
65
38
  export {
66
39
  Array as ReadonlyArray,
@@ -70,81 +43,76 @@ export {
70
43
  Channel,
71
44
  Chunk,
72
45
  Config,
73
- ConfigError,
74
46
  ConfigProvider,
75
47
  Console,
76
48
  Context,
77
49
  Data,
78
50
  Deferred,
79
51
  Duration,
80
- Either,
52
+ Result,
81
53
  Equal,
82
- ExecutionStrategy,
83
54
  Exit,
84
- FastCheck,
85
55
  Fiber,
56
+ Filter,
57
+ FileSystem,
58
+ Terminal,
86
59
  FiberHandle,
87
- FiberId,
88
60
  FiberMap,
89
- FiberRef,
90
- FiberRefs,
91
- FiberRefsPatch,
92
61
  FiberSet,
93
- GlobalValue,
62
+ Formatter,
63
+ Function,
94
64
  Hash,
95
65
  HashMap,
96
66
  HashSet,
97
67
  Inspectable,
98
68
  identity,
69
+ Latch,
99
70
  Layer,
100
- List,
101
71
  LogLevel,
102
- LogSpan,
103
- Mailbox,
104
72
  ManagedRuntime,
105
73
  Match,
106
74
  Metric,
107
- MetricState,
108
75
  MutableHashMap,
109
76
  MutableHashSet,
77
+ MutableList,
110
78
  Option,
111
79
  Order,
112
- ParseResult,
113
80
  Predicate,
114
- Pretty,
115
81
  PrimaryKey,
82
+ PlatformError,
116
83
  PubSub,
117
- // Subscribable,
118
84
  pipe,
119
85
  Queue,
120
86
  RcMap,
121
87
  RcRef,
122
88
  Record as ReadonlyRecord,
89
+ References,
123
90
  Redacted,
124
91
  Ref,
125
92
  Request,
126
93
  Runtime,
127
- RuntimeFlags,
128
94
  Scope,
129
95
  ScopedRef,
96
+ Scheduler,
97
+ SchemaIssue,
98
+ SchemaAST,
99
+ SchemaGetter,
100
+ SchemaParser,
101
+ SchemaRepresentation,
102
+ SchemaTransformation,
103
+ Semaphore,
130
104
  Sink,
131
- SortedMap,
132
- STM,
105
+ Struct,
106
+ Graph,
133
107
  SynchronizedRef,
134
- TestClock,
135
- TestServices,
136
- TQueue,
137
- TRef,
138
108
  Tracer,
109
+ TxQueue,
110
+ TxRef,
139
111
  Types,
140
112
  } from 'effect'
141
- export type { NonEmptyArray } from 'effect/Array'
142
- export { constVoid, dual } from 'effect/Function'
143
- export * as Graph from 'effect/Graph'
144
- export { TreeFormatter } from 'effect/ParseResult'
145
- export type { Serializable, SerializableWithResult } from 'effect/Schema'
146
- export * as SchemaAST from 'effect/SchemaAST'
147
- export * as BucketQueue from './BucketQueue.ts'
113
+ export * as FastCheck from 'effect/testing/FastCheck'
114
+ export * as TestClock from 'effect/testing/TestClock'
115
+ export * as TestConsole from 'effect/testing/TestConsole'
148
116
  export * as Debug from './Debug.ts'
149
117
  export * as Effect from './Effect.ts'
150
118
  export * from './Error.ts'
@@ -152,9 +120,7 @@ export * as Logger from './Logger.ts'
152
120
  export * as OtelTracer from './OtelTracer.ts'
153
121
  export * as RpcClient from './RpcClient.ts'
154
122
  export * as Schedule from './Schedule.ts'
155
- export * as Scheduler from './Scheduler.ts'
156
123
  export * as Schema from './Schema/index.ts'
157
- export * as ServiceContext from './ServiceContext.ts'
158
124
  export * as Stream from './Stream.ts'
159
125
  export * as Subscribable from './Subscribable.ts'
160
126
  export * as SubscriptionRef from './SubscriptionRef.ts'
@@ -1,4 +1,4 @@
1
- import { it, describe, expect } from '@effect/vitest'
1
+ import { describe, expect, it } from '@effect/vitest'
2
2
  import { Effect, Tracer } from 'effect'
3
3
 
4
4
  import { spanEvent } from './spanEvent.ts'
@@ -14,22 +14,22 @@ const makeTestTracer = () => {
14
14
  const spanEvents = new Map<string, Array<RecordedEvent>>()
15
15
 
16
16
  const tracer = Tracer.make({
17
- span(name, parent, context, links, startTime, kind) {
17
+ span(options) {
18
18
  const events: Array<RecordedEvent> = []
19
- spanEvents.set(name, events)
19
+ spanEvents.set(options.name, events)
20
20
  const attributes = new Map<string, unknown>()
21
21
  return {
22
22
  _tag: 'Span' as const,
23
- name,
24
- spanId: `test-${name}`,
23
+ name: options.name,
24
+ spanId: `test-${options.name}`,
25
25
  traceId: 'test-trace',
26
- parent,
27
- context,
28
- status: { _tag: 'Started' as const, startTime },
26
+ parent: options.parent,
27
+ annotations: options.annotations,
28
+ status: { _tag: 'Started' as const, startTime: options.startTime },
29
29
  attributes,
30
- links: [...links],
30
+ links: options.links,
31
31
  sampled: true,
32
- kind,
32
+ kind: options.kind,
33
33
  end() {},
34
34
  attribute(key: string, value: unknown) {
35
35
  attributes.set(key, value)
@@ -40,9 +40,6 @@ const makeTestTracer = () => {
40
40
  addLinks() {},
41
41
  }
42
42
  },
43
- context(f) {
44
- return f()
45
- },
46
43
  })
47
44
 
48
45
  return {
@@ -1,4 +1,4 @@
1
- import { Effect, FiberRef, HashSet, Logger } from 'effect'
1
+ import { Effect, Logger } from 'effect'
2
2
 
3
3
  /**
4
4
  * Emits a span event on the current Effect span via the tracer logger.
@@ -10,6 +10,8 @@ import { Effect, FiberRef, HashSet, Logger } from 'effect'
10
10
  * is in context, the call is a no-op.
11
11
  */
12
12
  export const spanEvent = (message: any, attributes?: Record<string, unknown>) =>
13
- Effect.locallyWith(Effect.log(message).pipe(Effect.annotateLogs(attributes ?? {})), FiberRef.currentLoggers, () =>
14
- HashSet.make(Logger.tracerLogger),
13
+ Effect.provideService(
14
+ Effect.log(message).pipe(Effect.annotateLogs(attributes ?? {})),
15
+ Logger.CurrentLoggers,
16
+ new Set([Logger.tracerLogger]),
15
17
  )
@@ -53,7 +53,7 @@ export const deepEqual = <T>(a: T, b: T): boolean => {
53
53
  length = keys.length
54
54
  if (length !== Object.keys(b).length) return false
55
55
 
56
- for (i = length; i-- !== 0; ) if (Object.prototype.hasOwnProperty.call(b, keys[i]) === false) return false
56
+ for (i = length; i-- !== 0; ) if (Object.hasOwn(b, keys[i]) === false) return false
57
57
 
58
58
  for (i = length; i-- !== 0; ) {
59
59
  const key = keys[i]
@@ -66,6 +66,5 @@ export const deepEqual = <T>(a: T, b: T): boolean => {
66
66
  }
67
67
 
68
68
  // true if both NaN, false otherwise
69
- // biome-ignore lint/suspicious/noSelfCompare: comparing to itself is fine here
70
69
  return a !== a && b !== b
71
70
  }
package/src/misc.ts CHANGED
@@ -9,8 +9,8 @@ export const isDevEnv = () => {
9
9
  return import.meta.env.DEV
10
10
  }
11
11
 
12
- // @ts-expect-error Only exists in Expo / RN
13
- if (globalThis?.__DEV__ === true) {
12
+ const globals = globalThis as typeof globalThis & { readonly __DEV__?: boolean | undefined }
13
+ if (globals.__DEV__ === true) {
14
14
  return true
15
15
  }
16
16
 
package/src/mod.ts CHANGED
@@ -4,7 +4,6 @@ export * from './binary.ts'
4
4
  export * from './Deferred.ts'
5
5
  export * from './env.ts'
6
6
  export * from './fast-deep-equal.ts'
7
- export * from './guards.ts'
8
7
  export * from './misc.ts'
9
8
  export * from './NoopTracer.ts'
10
9
  export * from './object/index.ts'
@@ -12,32 +11,12 @@ export * from './promise.ts'
12
11
  export * as QR from './qr.ts'
13
12
  export * from './set.ts'
14
13
  export * from './string.ts'
15
- export * from './time.ts'
16
14
 
17
15
  import type * as otel from '@opentelemetry/api'
18
16
  import type { Types } from 'effect'
19
17
 
20
18
  import { objectToString } from './misc.ts'
21
19
 
22
- /**
23
- * Recursively expands type aliases for better IDE hover display.
24
- *
25
- * Transforms `{ a: string } & { b: number }` into `{ a: string; b: number }`.
26
- */
27
- export type Prettify<T> = T extends infer U ? { [K in keyof U]: Prettify<U[K]> } : never
28
-
29
- /**
30
- * Type-level equality check. Returns `true` if `A` and `B` are exactly the same type.
31
- *
32
- * @example
33
- * ```ts
34
- * type Test1 = TypeEq<string, string> // true
35
- * type Test2 = TypeEq<string, number> // false
36
- * type Test3 = TypeEq<{ a: 1 }, { a: 1 }> // true
37
- * ```
38
- */
39
- export type TypeEq<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false
40
-
41
20
  /**
42
21
  * Type-level subtype check. Returns `true` if `A` extends `B`.
43
22
  *
@@ -52,12 +31,6 @@ export type IsSubtype<A, B> = A extends B ? true : false
52
31
  /** Compile-time assertion that `T` is `true`. Useful for type tests. */
53
32
  export type AssertTrue<T extends true> = T
54
33
 
55
- /** Removes `readonly` modifier from all properties of `T`. */
56
- export type Writeable<T> = { -readonly [P in keyof T]: T[P] }
57
-
58
- /** Recursively removes `readonly` modifier from all properties. */
59
- export type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> }
60
-
61
34
  /** Makes all properties of `T` nullable (allows `null`). */
62
35
  export type Nullable<T> = { [K in keyof T]: T[K] | null }
63
36
 
@@ -165,9 +138,6 @@ export const prop =
165
138
  /** Capitalizes the first letter of a string. */
166
139
  export const capitalizeFirstLetter = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1)
167
140
 
168
- /** Type guard that checks if a value is a readonly array. */
169
- export const isReadonlyArray = <I, T>(value: ReadonlyArray<I> | T): value is ReadonlyArray<I> => Array.isArray(value)
170
-
171
141
  /**
172
142
  * Use this to make assertion at end of if-else chain that all members of a
173
143
  * union have been accounted for.
@@ -415,12 +385,6 @@ export const isNonEmptyString = (str: string | undefined | null): str is string
415
385
  return typeof str === 'string' && str.length > 0
416
386
  }
417
387
 
418
- /** Type guard that checks if a value is a Promise (has a `then` method). */
419
- export const isPromise = (value: any): value is Promise<unknown> => typeof value?.then === 'function'
420
-
421
- /** Type guard that checks if a value is iterable (has a `Symbol.iterator` method). */
422
- export const isIterable = <T>(value: any): value is Iterable<T> => typeof value?.[Symbol.iterator] === 'function'
423
-
424
388
  /**
425
389
  * Type-level utility that removes `undefined` from all property types.
426
390
  * Used for compatibility with libraries that don't type optionals as `| undefined`.
package/src/node/mod.ts CHANGED
@@ -1,24 +1,21 @@
1
1
  import * as http from 'node:http'
2
2
 
3
- import { layer as ParcelWatcherLayer } from '@effect/platform-node/NodeFileSystem/ParcelWatcher'
4
- import { Effect, Layer } from 'effect'
3
+ import { NodeFileSystem } from '@effect/platform-node'
4
+ import { Effect, FileSystem, Layer, Option } from 'effect'
5
5
 
6
- import { OtelTracer, UnknownError } from '../effect/mod.ts'
6
+ import { OtelTracer, Tracer, UnknownError } from '../effect/mod.ts'
7
7
  import { makeNoopTracer } from '../NoopTracer.ts'
8
8
 
9
- export * as Cli from '@effect/cli'
10
- export * as SocketServer from '@effect/platform/SocketServer'
9
+ export * as Cli from 'effect/unstable/cli'
10
+ export * as SocketServer from 'effect/unstable/socket/SocketServer'
11
11
  export * as PlatformNode from '@effect/platform-node'
12
12
 
13
- export * as ChildProcessRunner from './ChildProcessRunner/ChildProcessRunner.ts'
14
- export * as ChildProcessWorker from './ChildProcessRunner/ChildProcessWorker.ts'
15
-
16
13
  // Enable debug logging for OpenTelemetry
17
14
  // otel.diag.setLogger(new otel.DiagConsoleLogger(), otel.DiagLogLevel.ERROR)
18
15
 
19
16
  // export const OtelLiveHttp = (args: any): Layer.Layer<never> => Layer.empty
20
17
 
21
- export const getFreePort: Effect.Effect<number, UnknownError> = Effect.async<number, UnknownError>((cb, signal) => {
18
+ export const getFreePort: Effect.Effect<number, UnknownError> = Effect.callback<number, UnknownError>((cb, signal) => {
22
19
  const server = http.createServer()
23
20
 
24
21
  signal.addEventListener('abort', () => {
@@ -46,15 +43,21 @@ export const getFreePort: Effect.Effect<number, UnknownError> = Effect.async<num
46
43
  export const OtelLiveDummy: Layer.Layer<OtelTracer.OtelTracer> = Layer.suspend(() => {
47
44
  const OtelTracerLive = Layer.succeed(OtelTracer.OtelTracer, makeNoopTracer())
48
45
 
49
- const TracingLive = Layer.unwrapEffect(Effect.map(OtelTracer.make, Layer.setTracer)).pipe(
50
- Layer.provideMerge(OtelTracerLive),
51
- )
46
+ const TracingLive = OtelTracer.layerWithoutOtelTracer.pipe(Layer.provideMerge(OtelTracerLive))
52
47
 
53
48
  return TracingLive
54
49
  })
55
50
 
56
51
  /**
57
- * Layer that provides WatchBackend for recursive file watching via @parcel/watcher.
52
+ * Compatibility layer for the old Effect v3 @parcel/watcher backend.
53
+ *
54
+ * Effect v4 removed `@effect/platform-node/NodeFileSystem/ParcelWatcher`; its
55
+ * NodeFileSystem layer now performs recursive watching through Node's native
56
+ * `fs.watch(path, { recursive: true })` fallback. This layer deliberately
57
+ * registers no custom backend so existing `NodeRecursiveWatchLayer` consumers
58
+ * continue to compile while the v4 NodeFileSystem implementation handles watch
59
+ * events.
60
+ *
58
61
  * This layer alone does NOT provide FileSystem - it only provides the watch backend.
59
62
  *
60
63
  * IMPORTANT: Layer ordering matters! When composing with NodeFileSystem.layer, use
@@ -75,18 +78,21 @@ export const OtelLiveDummy: Layer.Layer<OtelTracer.OtelTracer> = Layer.suspend((
75
78
  *
76
79
  * @see https://github.com/Effect-TS/effect/issues/5913
77
80
  */
78
- export const NodeRecursiveWatchLayer = ParcelWatcherLayer
81
+ export const NodeRecursiveWatchLayer: Layer.Layer<FileSystem.WatchBackend> = Layer.succeed(
82
+ FileSystem.WatchBackend,
83
+ FileSystem.WatchBackend.of({
84
+ register: () => Option.none(),
85
+ }),
86
+ )
79
87
 
80
88
  /**
81
- * Pre-composed layer providing FileSystem with recursive file watching via @parcel/watcher.
89
+ * Pre-composed layer providing FileSystem with recursive file watching.
82
90
  * This is the recommended way to get a FileSystem that supports recursive watching.
83
91
  *
84
92
  * Use this layer when you need to watch files recursively (e.g., watching nested directories).
85
- * Without recursive watching, Node.js's built-in fs.watch only detects changes in the
86
- * immediate directory, not in subdirectories.
93
+ * Effect v4's NodeFileSystem uses Node.js's native recursive `fs.watch` support
94
+ * instead of the removed ParcelWatcher backend from Effect v3.
87
95
  */
88
96
  export { NodeFileSystem } from '@effect/platform-node'
89
97
 
90
- import { NodeFileSystem } from '@effect/platform-node'
91
-
92
- export const NodeFileSystemWithWatch = NodeFileSystem.layer.pipe(Layer.provideMerge(ParcelWatcherLayer))
98
+ export const NodeFileSystemWithWatch = NodeFileSystem.layer.pipe(Layer.provideMerge(NodeRecursiveWatchLayer))
@@ -1,25 +1 @@
1
- import { pipe } from 'effect'
2
-
3
- export * from './omit.ts'
4
- export * from './pick.ts'
5
1
  export * from './stringify-object.ts'
6
-
7
- type ValueOfRecord<R extends Record<any, any>> = R extends Record<any, infer V> ? V : never
8
-
9
- export const mapObjectValues = <O_In extends Record<string, any>, V_Out>(
10
- obj: O_In,
11
- mapValue: (key: keyof O_In, val: ValueOfRecord<O_In>) => V_Out,
12
- ): { [K in keyof O_In]: V_Out } => {
13
- const mappedEntries = Object.entries(obj).map(([key, val]) => [key, mapValue(key as keyof O_In, val)] as const)
14
- return Object.fromEntries(mappedEntries) as any
15
- }
16
-
17
- export type Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][]
18
-
19
- export const objectEntries = <T extends Record<string, any>>(obj: T): Entries<T> => Object.entries(obj) as Entries<T>
20
-
21
- export const keyObjectFromObject = <TObj extends Record<string, any>>(obj: TObj): { [K in keyof TObj]: K } =>
22
- pipe(
23
- objectEntries(obj).map(([k]) => [k, k]),
24
- Object.fromEntries,
25
- )
package/src/string.ts CHANGED
@@ -1,6 +1,3 @@
1
- export const lowercaseFirstChar = (str: string) => str.charAt(0).toLowerCase() + str.slice(1)
2
- export const uppercaseFirstChar = (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
3
-
4
1
  /** Indents a string each line by `n` characters (default: spaces) */
5
2
  export const indent = (str: string, n: number, char = ' '): string =>
6
3
  str
@@ -1,20 +0,0 @@
1
- import { Effect, STM, TRef } from 'effect';
2
- export type BucketQueue<A> = TRef.TRef<A[]>;
3
- export declare const make: <A>() => STM.STM<BucketQueue<A>>;
4
- export declare const offerAll: <A>(self: BucketQueue<A>, elements: ReadonlyArray<A>) => STM.STM<void, never, never>;
5
- export declare const replace: <A>(self: BucketQueue<A>, elements: ReadonlyArray<A>) => STM.STM<void, never, never>;
6
- export declare const clear: <A>(self: BucketQueue<A>) => STM.STM<void, never, never>;
7
- export declare const takeBetween: <A>(bucket: BucketQueue<A>, min: number, max: number) => STM.STM<ReadonlyArray<A>>;
8
- export declare const peekAll: <A>(bucket: BucketQueue<A>) => STM.STM<A[], never, never>;
9
- /** Returns the elements up to the first element that matches the predicate, the rest is left in the queue
10
- *
11
- * @example
12
- * ```ts
13
- * const [elements, rest] = yield* BucketQueue.takeSplitWhere(bucket, (a) => a > 3)
14
- * assert.deepStrictEqual(elements, [1, 2, 3])
15
- * assert.deepStrictEqual(rest, [4, 5, 6])
16
- * ```
17
- */
18
- export declare const takeSplitWhere: <A>(bucket: BucketQueue<A>, predicate: (a: A) => boolean) => STM.STM<A[], never, never>;
19
- export declare const size: <A>(bucket: BucketQueue<A>) => Effect.Effect<number, never, never>;
20
- //# sourceMappingURL=BucketQueue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BucketQueue.d.ts","sourceRoot":"","sources":["../../src/effect/BucketQueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAEjD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;AAE3C,eAAO,MAAM,IAAI,GAAI,CAAC,OAAK,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAuB,CAAA;AAExE,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,aAAa,CAAC,CAAC,CAAC,gCACV,CAAA;AAElE,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,aAAa,CAAC,CAAC,CAAC,gCAAoC,CAAA;AAE/G,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,gCAAuB,CAAA;AAEpE,eAAO,MAAM,WAAW,GAAI,CAAC,EAC3B,QAAQ,WAAW,CAAC,CAAC,CAAC,EACtB,KAAK,MAAM,EACX,KAAK,MAAM,KACV,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAUvB,CAAA;AAEJ,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,QAAQ,WAAW,CAAC,CAAC,CAAC,+BAAqB,CAAA;AAEtE;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,QAAQ,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,+BAMlF,CAAA;AAEJ,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,QAAQ,WAAW,CAAC,CAAC,CAAC,wCAAuD,CAAA"}
@@ -1,34 +0,0 @@
1
- import { Array, Effect, STM, TRef } from 'effect';
2
- export const make = () => TRef.make([]);
3
- export const offerAll = (self, elements) => TRef.update(self, (bucket) => Array.appendAll(bucket, elements));
4
- export const replace = (self, elements) => TRef.set(self, elements);
5
- export const clear = (self) => TRef.set(self, []);
6
- export const takeBetween = (bucket, min, max) => STM.gen(function* () {
7
- const bucketValue = yield* TRef.get(bucket);
8
- if (bucketValue.length < min) {
9
- return yield* STM.retry;
10
- }
11
- else {
12
- const elements = bucketValue.splice(0, Math.min(max, bucketValue.length));
13
- yield* TRef.set(bucket, bucketValue);
14
- return elements;
15
- }
16
- });
17
- export const peekAll = (bucket) => TRef.get(bucket);
18
- /** Returns the elements up to the first element that matches the predicate, the rest is left in the queue
19
- *
20
- * @example
21
- * ```ts
22
- * const [elements, rest] = yield* BucketQueue.takeSplitWhere(bucket, (a) => a > 3)
23
- * assert.deepStrictEqual(elements, [1, 2, 3])
24
- * assert.deepStrictEqual(rest, [4, 5, 6])
25
- * ```
26
- */
27
- export const takeSplitWhere = (bucket, predicate) => STM.gen(function* () {
28
- const bucketValue = yield* TRef.get(bucket);
29
- const [elements, rest] = Array.splitWhere(bucketValue, predicate);
30
- yield* TRef.set(bucket, rest);
31
- return elements;
32
- });
33
- export const size = (bucket) => TRef.get(bucket).pipe(Effect.map((_) => _.length));
34
- //# sourceMappingURL=BucketQueue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BucketQueue.js","sourceRoot":"","sources":["../../src/effect/BucketQueue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAIjD,MAAM,CAAC,MAAM,IAAI,GAAG,GAA+B,EAAE,CAAC,IAAI,CAAC,IAAI,CAAM,EAAE,CAAC,CAAA;AA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,MAAM,cAAc,GAAG,CAAI,MAAsB,EAAE,SAA4B,EAAE,EAAE,CACxF,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;IACf,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACjE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC7B,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,IAAI,GAAG,CAAI,MAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from 'effect/Scheduler';
2
- import { Scheduler } from 'effect';
3
- export declare const messageChannel: (shouldYield?: Scheduler.Scheduler["shouldYield"]) => Scheduler.Scheduler;
4
- //# sourceMappingURL=Scheduler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Scheduler.d.ts","sourceRoot":"","sources":["../../src/effect/Scheduler.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGlC,eAAO,MAAM,cAAc,GAAI,cAAa,SAAS,CAAC,SAAS,CAAC,aAAa,CAAgC,wBAO5F,CAAA"}
@@ -1,9 +0,0 @@
1
- export * from 'effect/Scheduler';
2
- import { Scheduler } from 'effect';
3
- // Based on https://github.com/astoilkov/main-thread-scheduling/blob/4b99c26ab96781bc35a331f5c225ad9c8a62cb95/src/utils/waitNextTask.ts#L25
4
- export const messageChannel = (shouldYield = Scheduler.defaultShouldYield) => Scheduler.makeBatched((task) => {
5
- const messageChannel = new MessageChannel();
6
- messageChannel.port1.postMessage(undefined);
7
- messageChannel.port2.onmessage = task;
8
- }, shouldYield);
9
- //# sourceMappingURL=Scheduler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Scheduler.js","sourceRoot":"","sources":["../../src/effect/Scheduler.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,2IAA2I;AAC3I,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,cAAkD,SAAS,CAAC,kBAAkB,EAAE,EAAE,CAC/G,SAAS,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;IAC7B,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAA;IAE3C,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IAE3C,cAAc,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;AACvC,CAAC,EAAE,WAAW,CAAC,CAAA"}
@@ -1,37 +0,0 @@
1
- import type { Runtime } from 'effect';
2
- import { Effect, Exit, Layer } from 'effect';
3
- export interface MainLayer<Ctx> {
4
- layer: Layer.Layer<Ctx>;
5
- close: Effect.Effect<void>;
6
- }
7
- export declare const unsafeMainLayer: <Ctx>(original: Layer.Layer<Ctx>) => MainLayer<Ctx>;
8
- export declare const make: <TStaticData, Ctx>(staticData: TStaticData, runtime: Runtime.Runtime<Ctx>, close?: Effect.Effect<void>) => ServiceContext<Ctx, TStaticData>;
9
- export interface ServiceContext<Ctx, TStaticData> {
10
- readonly provide: <E, A>(self: Effect.Effect<A, E, Ctx>) => Effect.Effect<A, E>;
11
- /**
12
- * Fire and Forget. Errors are logged however.
13
- */
14
- readonly runWithErrorLog: <E, A>(self: Effect.Effect<A, E, Ctx>) => AbortCallback;
15
- readonly runSync: <E, A>(self: Effect.Effect<A, E, Ctx>) => A;
16
- /**
17
- * Fire and Forget. A promise that never fails nor returns any value.
18
- * Errors are logged however.
19
- */
20
- readonly runPromiseWithErrorLog: <E, A>(self: Effect.Effect<A, E, Ctx>) => Promise<A | undefined>;
21
- /**
22
- * A Promise that never fails, the Resolved value is an Exit result that can be either Success or Failed
23
- */
24
- readonly runPromiseExit: <E, A>(self: Effect.Effect<A, E, Ctx>) => Promise<Exit.Exit<A, E>>;
25
- readonly runPromise: <E, A>(self: Effect.Effect<A, E, Ctx>) => Promise<A>;
26
- readonly withRuntime: (fn: (runtime: Runtime.Runtime<Ctx>) => void) => void;
27
- /** Closes the ServiceContext and closing all its layers */
28
- readonly close: Effect.Effect<void>;
29
- readonly closePromise: () => Promise<void>;
30
- readonly staticData: TStaticData;
31
- }
32
- export type AbortCallback = () => void;
33
- export declare const runWithErrorLog: <E, A>(self: Effect.Effect<A, E>) => () => void;
34
- export declare const runPromiseWithErrorLog: <E, A>(self: Effect.Effect<A, E>) => Promise<A | undefined>;
35
- export declare const MissingContext: Effect.Effect<never, never, never>;
36
- export declare const empty: <Ctx, TStaticData>() => ServiceContext<Ctx, TStaticData>;
37
- //# sourceMappingURL=ServiceContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServiceContext.d.ts","sourceRoot":"","sources":["../../src/effect/ServiceContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAS,MAAM,EAAE,IAAI,EAAS,KAAK,EAAe,MAAM,QAAQ,CAAA;AAEvE,MAAM,WAAW,SAAS,CAAC,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAC3B;AAED,eAAO,MAAM,eAAe,GAAI,GAAG,EAAE,UAAU,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAG,SAAS,CAAC,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