@fncts/io 0.0.2 → 0.0.5

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 (320) hide show
  1. package/Channel/UpstreamPullRequest/api.d.ts +1 -1
  2. package/Channel/api.d.ts +2 -2
  3. package/Clock/api.d.ts +3 -1
  4. package/Clock/definition.d.ts +3 -1
  5. package/Clock/live.d.ts +2 -0
  6. package/Fiber/api/interruptFork.d.ts +1 -1
  7. package/FiberRef/constructors.d.ts +0 -53
  8. package/FiberRef/unsafe.d.ts +53 -0
  9. package/FiberRef.d.ts +1 -0
  10. package/Future/constructors.d.ts +3 -3
  11. package/IO/api/asyncIO.d.ts +6 -0
  12. package/IO/api/ensuringChildren.d.ts +7 -0
  13. package/IO/api/sequenceT.d.ts +2 -3
  14. package/IO/api/sleep.d.ts +3 -1
  15. package/IO/api/timeout.d.ts +14 -0
  16. package/IO/api.d.ts +2 -2
  17. package/IO/definition.d.ts +8 -4
  18. package/IO.d.ts +3 -0
  19. package/IOSpec.d.ts +10 -1
  20. package/InterruptStatus/constructors.d.ts +3 -3
  21. package/Latch.d.ts +3 -0
  22. package/Schedule/Decision.d.ts +1 -1
  23. package/Schedule/api.d.ts +1 -1
  24. package/Schedule.d.ts +0 -1
  25. package/Scope/Finalizer/definition.d.ts +1 -1
  26. package/Scope/ReleaseMap/definition.d.ts +1 -1
  27. package/Stream/api.d.ts +5 -22
  28. package/Stream/internal/DebounceState.d.ts +3 -3
  29. package/Stream/internal/Handoff.d.ts +9 -9
  30. package/Stream/internal/SinkEndReason.d.ts +6 -18
  31. package/TFuture/definition.d.ts +1 -1
  32. package/TSemaphore/definition.d.ts +1 -1
  33. package/_cjs/Cached.cjs +3 -3
  34. package/_cjs/Channel/ChildExecutorDecision.cjs +2 -2
  35. package/_cjs/Channel/UpstreamPullRequest/api.cjs +3 -3
  36. package/_cjs/Channel/UpstreamPullRequest/api.cjs.map +1 -1
  37. package/_cjs/Channel/UpstreamPullRequest.cjs +2 -2
  38. package/_cjs/Channel/UpstreamPullStrategy.cjs +1 -1
  39. package/_cjs/Channel/api/interruptWhen.cjs +1 -1
  40. package/_cjs/Channel/api/interruptWhen.cjs.map +1 -1
  41. package/_cjs/Channel/api/mapOutIOC.cjs +1 -1
  42. package/_cjs/Channel/api/mapOutIOC.cjs.map +1 -1
  43. package/_cjs/Channel/api/mergeAllWith.cjs +1 -1
  44. package/_cjs/Channel/api/mergeAllWith.cjs.map +1 -1
  45. package/_cjs/Channel/api/mergeWith.cjs +6 -6
  46. package/_cjs/Channel/api/mergeWith.cjs.map +1 -1
  47. package/_cjs/Channel/api.cjs +14 -14
  48. package/_cjs/Channel/api.cjs.map +1 -1
  49. package/_cjs/Channel/core-api.cjs +1 -1
  50. package/_cjs/Channel/internal/ChannelExecutor.cjs +2 -2
  51. package/_cjs/Channel/internal/ChannelExecutor.cjs.map +1 -1
  52. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs +8 -7
  53. package/_cjs/Channel/internal/SingleProducerAsyncInput.cjs.map +1 -1
  54. package/_cjs/Channel.cjs +3 -3
  55. package/_cjs/Clock/api.cjs.map +1 -1
  56. package/_cjs/Clock/live.cjs +1 -1
  57. package/_cjs/Clock/live.cjs.map +1 -1
  58. package/_cjs/Clock.cjs +3 -3
  59. package/_cjs/Console.cjs +3 -3
  60. package/_cjs/Fiber/FiberContext.cjs +58 -57
  61. package/_cjs/Fiber/FiberContext.cjs.map +1 -1
  62. package/_cjs/Fiber/api/interruptFork.cjs +1 -1
  63. package/_cjs/Fiber/api/interruptFork.cjs.map +1 -1
  64. package/_cjs/Fiber/constructors.cjs +2 -2
  65. package/_cjs/Fiber/constructors.cjs.map +1 -1
  66. package/_cjs/Fiber.cjs +23 -23
  67. package/_cjs/FiberRef/constructors.cjs +3 -84
  68. package/_cjs/FiberRef/constructors.cjs.map +1 -1
  69. package/_cjs/FiberRef/unsafe.cjs +94 -0
  70. package/_cjs/FiberRef/unsafe.cjs.map +1 -0
  71. package/_cjs/FiberRef.cjs +18 -5
  72. package/_cjs/FiberRef.cjs.map +1 -1
  73. package/_cjs/FiberRefs/join.cjs +2 -2
  74. package/_cjs/FiberRefs/join.cjs.map +1 -1
  75. package/_cjs/FiberRefs.cjs +3 -3
  76. package/_cjs/FiberScope.cjs +2 -2
  77. package/_cjs/FiberState/constructors.cjs +1 -1
  78. package/_cjs/FiberState.cjs +3 -3
  79. package/_cjs/FiberStatus/constructors.cjs +1 -1
  80. package/_cjs/FiberStatus.cjs +2 -2
  81. package/_cjs/Future/constructors.cjs +2 -4
  82. package/_cjs/Future/constructors.cjs.map +1 -1
  83. package/_cjs/Future.cjs +3 -3
  84. package/_cjs/Hub.cjs +2 -2
  85. package/_cjs/IO/api/asyncIO.cjs +37 -0
  86. package/_cjs/IO/api/asyncIO.cjs.map +1 -0
  87. package/_cjs/IO/api/concurrency.cjs +1 -1
  88. package/_cjs/IO/api/core-scope.cjs +1 -1
  89. package/_cjs/IO/api/ensuringChildren.cjs +24 -0
  90. package/_cjs/IO/api/ensuringChildren.cjs.map +1 -0
  91. package/_cjs/IO/api/environment.cjs +1 -1
  92. package/_cjs/IO/api/interrupt.cjs +5 -5
  93. package/_cjs/IO/api/interrupt.cjs.map +1 -1
  94. package/_cjs/IO/api/sleep.cjs.map +1 -1
  95. package/_cjs/IO/api/timeout.cjs +42 -0
  96. package/_cjs/IO/api/timeout.cjs.map +1 -0
  97. package/_cjs/IO/api.cjs +41 -40
  98. package/_cjs/IO/api.cjs.map +1 -1
  99. package/_cjs/IO/definition.cjs +9 -6
  100. package/_cjs/IO/definition.cjs.map +1 -1
  101. package/_cjs/IO/runtime.cjs +2 -2
  102. package/_cjs/IO/runtime.cjs.map +1 -1
  103. package/_cjs/IO.cjs +86 -47
  104. package/_cjs/IO.cjs.map +1 -1
  105. package/_cjs/IOEnv/services.cjs +1 -1
  106. package/_cjs/IOEnv.cjs +3 -3
  107. package/_cjs/InterruptStatus/constructors.cjs +3 -7
  108. package/_cjs/InterruptStatus/constructors.cjs.map +1 -1
  109. package/_cjs/InterruptStatus.cjs +2 -2
  110. package/_cjs/Layer/api.cjs +5 -3
  111. package/_cjs/Layer/api.cjs.map +1 -1
  112. package/_cjs/Layer.cjs +3 -3
  113. package/_cjs/Logger.cjs +3 -3
  114. package/_cjs/Queue/api.cjs +7 -7
  115. package/_cjs/Queue.cjs +5 -5
  116. package/_cjs/Random.cjs +3 -3
  117. package/_cjs/Ref/Atomic/Atomic.cjs +3 -3
  118. package/_cjs/Ref/Atomic/api.cjs +10 -6
  119. package/_cjs/Ref/Atomic/api.cjs.map +1 -1
  120. package/_cjs/Ref/Atomic.cjs +2 -2
  121. package/_cjs/Ref/Derived.cjs +2 -2
  122. package/_cjs/Ref/DerivedAll.cjs +1 -1
  123. package/_cjs/Ref/Synchronized/api.cjs +1 -1
  124. package/_cjs/Ref/Synchronized/constructors.cjs +1 -1
  125. package/_cjs/Ref/Synchronized/definition.cjs +1 -1
  126. package/_cjs/Ref/api/get.cjs +1 -1
  127. package/_cjs/Ref/api/match.cjs +1 -1
  128. package/_cjs/Ref/api/matchAll.cjs +1 -1
  129. package/_cjs/Ref/api/modify.cjs +1 -1
  130. package/_cjs/Ref/api/set.cjs +1 -1
  131. package/_cjs/Ref/api.cjs +8 -8
  132. package/_cjs/Ref/constructors.cjs +1 -1
  133. package/_cjs/Ref.cjs +9 -9
  134. package/_cjs/STM/api/core-api.cjs +1 -1
  135. package/_cjs/STM/api/core-constructors.cjs +1 -1
  136. package/_cjs/STM/api.cjs +2 -2
  137. package/_cjs/STM/driver.cjs +1 -1
  138. package/_cjs/STM/internal/Entry.cjs +1 -1
  139. package/_cjs/STM/internal/Journal.cjs +2 -2
  140. package/_cjs/STM.cjs +5 -5
  141. package/_cjs/Schedule/Decision.cjs.map +1 -1
  142. package/_cjs/Schedule/api/driver.cjs +11 -9
  143. package/_cjs/Schedule/api/driver.cjs.map +1 -1
  144. package/_cjs/Schedule/api.cjs +49 -49
  145. package/_cjs/Schedule/api.cjs.map +1 -1
  146. package/_cjs/Schedule.cjs +4 -17
  147. package/_cjs/Schedule.cjs.map +1 -1
  148. package/_cjs/Scope/Finalizer/definition.cjs +6 -4
  149. package/_cjs/Scope/Finalizer/definition.cjs.map +1 -1
  150. package/_cjs/Scope/Finalizer.cjs +1 -1
  151. package/_cjs/Scope/ReleaseMap/api/releaseAll.cjs +1 -1
  152. package/_cjs/Scope/ReleaseMap/api.cjs +1 -1
  153. package/_cjs/Scope/ReleaseMap/constructors.cjs +1 -1
  154. package/_cjs/Scope/ReleaseMap/definition.cjs +4 -2
  155. package/_cjs/Scope/ReleaseMap/definition.cjs.map +1 -1
  156. package/_cjs/Scope/ReleaseMap.cjs +3 -3
  157. package/_cjs/Scope/api.cjs +1 -1
  158. package/_cjs/Scope.cjs +2 -2
  159. package/_cjs/ScopedRef.cjs +2 -2
  160. package/_cjs/Sink/api.cjs +1 -1
  161. package/_cjs/Sink/api.cjs.map +1 -1
  162. package/_cjs/Sink.cjs +2 -2
  163. package/_cjs/State/api.cjs +2 -2
  164. package/_cjs/State/definition.cjs +1 -1
  165. package/_cjs/State.cjs +2 -2
  166. package/_cjs/Stream/api/zipAllWith.cjs +1 -1
  167. package/_cjs/Stream/api/zipWith.cjs +1 -1
  168. package/_cjs/Stream/api.cjs +308 -308
  169. package/_cjs/Stream/api.cjs.map +1 -1
  170. package/_cjs/Stream/internal/DebounceState.cjs.map +1 -1
  171. package/_cjs/Stream/internal/Handoff.cjs.map +1 -1
  172. package/_cjs/Stream/internal/SinkEndReason.cjs +2 -37
  173. package/_cjs/Stream/internal/SinkEndReason.cjs.map +1 -1
  174. package/_cjs/Stream.cjs +2 -2
  175. package/_cjs/Supervisor/constructors.cjs +1 -1
  176. package/_cjs/Supervisor.cjs +3 -3
  177. package/_cjs/TExit/constructors.cjs +1 -1
  178. package/_cjs/TExit.cjs +2 -2
  179. package/_cjs/TFuture/definition.cjs +4 -2
  180. package/_cjs/TFuture/definition.cjs.map +1 -1
  181. package/_cjs/TFuture.cjs +3 -3
  182. package/_cjs/TRef/api.cjs +2 -2
  183. package/_cjs/TRef/constructors.cjs +3 -3
  184. package/_cjs/TRef.cjs +3 -3
  185. package/_cjs/TSemaphore/api.cjs +1 -1
  186. package/_cjs/TSemaphore/definition.cjs +4 -2
  187. package/_cjs/TSemaphore/definition.cjs.map +1 -1
  188. package/_cjs/TSemaphore.cjs +3 -3
  189. package/_cjs/collection/immutable/Conc.cjs +3 -3
  190. package/_mjs/Channel/UpstreamPullRequest/api.mjs +1 -2
  191. package/_mjs/Channel/UpstreamPullRequest/api.mjs.map +1 -1
  192. package/_mjs/Channel/api/interruptWhen.mjs +1 -1
  193. package/_mjs/Channel/api/interruptWhen.mjs.map +1 -1
  194. package/_mjs/Channel/api/mapOutIOC.mjs +1 -1
  195. package/_mjs/Channel/api/mapOutIOC.mjs.map +1 -1
  196. package/_mjs/Channel/api/mergeAllWith.mjs +1 -1
  197. package/_mjs/Channel/api/mergeAllWith.mjs.map +1 -1
  198. package/_mjs/Channel/api/mergeWith.mjs +6 -6
  199. package/_mjs/Channel/api/mergeWith.mjs.map +1 -1
  200. package/_mjs/Channel/api.mjs +14 -14
  201. package/_mjs/Channel/api.mjs.map +1 -1
  202. package/_mjs/Channel/internal/ChannelExecutor.mjs +2 -2
  203. package/_mjs/Channel/internal/ChannelExecutor.mjs.map +1 -1
  204. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs +8 -7
  205. package/_mjs/Channel/internal/SingleProducerAsyncInput.mjs.map +1 -1
  206. package/_mjs/Clock/api.mjs.map +1 -1
  207. package/_mjs/Clock/live.mjs +1 -1
  208. package/_mjs/Clock/live.mjs.map +1 -1
  209. package/_mjs/Fiber/FiberContext.mjs +58 -57
  210. package/_mjs/Fiber/FiberContext.mjs.map +1 -1
  211. package/_mjs/Fiber/api/interruptFork.mjs +1 -1
  212. package/_mjs/Fiber/api/interruptFork.mjs.map +1 -1
  213. package/_mjs/Fiber/constructors.mjs +1 -1
  214. package/_mjs/Fiber/constructors.mjs.map +1 -1
  215. package/_mjs/FiberRef/constructors.mjs +3 -66
  216. package/_mjs/FiberRef/constructors.mjs.map +1 -1
  217. package/_mjs/FiberRef/unsafe.mjs +66 -0
  218. package/_mjs/FiberRef/unsafe.mjs.map +1 -0
  219. package/_mjs/FiberRef.mjs +2 -1
  220. package/_mjs/FiberRef.mjs.map +1 -1
  221. package/_mjs/FiberRefs/join.mjs +2 -2
  222. package/_mjs/FiberRefs/join.mjs.map +1 -1
  223. package/_mjs/Future/constructors.mjs +3 -4
  224. package/_mjs/Future/constructors.mjs.map +1 -1
  225. package/_mjs/IO/api/asyncIO.mjs +20 -0
  226. package/_mjs/IO/api/asyncIO.mjs.map +1 -0
  227. package/_mjs/IO/api/concurrency.mjs +1 -1
  228. package/_mjs/IO/api/ensuringChildren.mjs +11 -0
  229. package/_mjs/IO/api/ensuringChildren.mjs.map +1 -0
  230. package/_mjs/IO/api/environment.mjs +1 -1
  231. package/_mjs/IO/api/interrupt.mjs +4 -4
  232. package/_mjs/IO/api/interrupt.mjs.map +1 -1
  233. package/_mjs/IO/api/sleep.mjs.map +1 -1
  234. package/_mjs/IO/api/timeout.mjs +23 -0
  235. package/_mjs/IO/api/timeout.mjs.map +1 -0
  236. package/_mjs/IO/api.mjs +41 -40
  237. package/_mjs/IO/api.mjs.map +1 -1
  238. package/_mjs/IO/definition.mjs +6 -4
  239. package/_mjs/IO/definition.mjs.map +1 -1
  240. package/_mjs/IO/runtime.mjs +2 -2
  241. package/_mjs/IO/runtime.mjs.map +1 -1
  242. package/_mjs/IO.mjs +3 -0
  243. package/_mjs/IO.mjs.map +1 -1
  244. package/_mjs/IOEnv/services.mjs +1 -1
  245. package/_mjs/InterruptStatus/constructors.mjs +3 -3
  246. package/_mjs/InterruptStatus/constructors.mjs.map +1 -1
  247. package/_mjs/Layer/api.mjs +4 -3
  248. package/_mjs/Layer/api.mjs.map +1 -1
  249. package/_mjs/Ref/Atomic/api.mjs +10 -6
  250. package/_mjs/Ref/Atomic/api.mjs.map +1 -1
  251. package/_mjs/Schedule/Decision.mjs.map +1 -1
  252. package/_mjs/Schedule/api/driver.mjs +10 -9
  253. package/_mjs/Schedule/api/driver.mjs.map +1 -1
  254. package/_mjs/Schedule/api.mjs +49 -49
  255. package/_mjs/Schedule/api.mjs.map +1 -1
  256. package/_mjs/Schedule.mjs +0 -1
  257. package/_mjs/Schedule.mjs.map +1 -1
  258. package/_mjs/Scope/Finalizer/definition.mjs +5 -4
  259. package/_mjs/Scope/Finalizer/definition.mjs.map +1 -1
  260. package/_mjs/Scope/ReleaseMap/definition.mjs +3 -2
  261. package/_mjs/Scope/ReleaseMap/definition.mjs.map +1 -1
  262. package/_mjs/Sink/api.mjs +1 -1
  263. package/_mjs/Sink/api.mjs.map +1 -1
  264. package/_mjs/Stream/api.mjs +308 -302
  265. package/_mjs/Stream/api.mjs.map +1 -1
  266. package/_mjs/Stream/internal/DebounceState.mjs.map +1 -1
  267. package/_mjs/Stream/internal/Handoff.mjs.map +1 -1
  268. package/_mjs/Stream/internal/SinkEndReason.mjs +1 -30
  269. package/_mjs/Stream/internal/SinkEndReason.mjs.map +1 -1
  270. package/_mjs/TFuture/definition.mjs +3 -2
  271. package/_mjs/TFuture/definition.mjs.map +1 -1
  272. package/_mjs/TSemaphore/definition.mjs +3 -2
  273. package/_mjs/TSemaphore/definition.mjs.map +1 -1
  274. package/_src/Channel/UpstreamPullRequest/api.ts +2 -3
  275. package/_src/Channel/api.ts +3 -3
  276. package/_src/Channel/internal/ChannelExecutor.ts +2 -2
  277. package/_src/Channel/internal/SingleProducerAsyncInput.ts +1 -0
  278. package/_src/Clock/api.ts +1 -1
  279. package/_src/Clock/definition.ts +1 -1
  280. package/_src/Clock/live.ts +2 -2
  281. package/_src/Fiber/FiberContext.ts +3 -2
  282. package/_src/Fiber/api/interruptFork.ts +1 -1
  283. package/_src/Fiber/constructors.ts +1 -1
  284. package/_src/FiberRef/constructors.ts +1 -78
  285. package/_src/FiberRef/unsafe.ts +79 -0
  286. package/_src/FiberRef.ts +1 -0
  287. package/_src/FiberRefs/join.ts +2 -2
  288. package/_src/Future/constructors.ts +1 -1
  289. package/_src/IO/api/asyncIO.ts +16 -0
  290. package/_src/IO/api/ensuringChildren.ts +11 -0
  291. package/_src/IO/api/interrupt.ts +2 -1
  292. package/_src/IO/api/sequenceT.ts +1 -1
  293. package/_src/IO/api/sleep.ts +1 -1
  294. package/_src/IO/api/timeout.ts +19 -0
  295. package/_src/IO/api.ts +6 -4
  296. package/_src/IO/definition.ts +8 -4
  297. package/_src/IO.ts +3 -0
  298. package/_src/InterruptStatus/constructors.ts +2 -0
  299. package/_src/Layer/api.ts +1 -1
  300. package/_src/Ref/Atomic/api.ts +4 -0
  301. package/_src/Schedule/Decision.ts +0 -2
  302. package/_src/Schedule/api/driver.ts +1 -1
  303. package/_src/Schedule/api.ts +0 -3
  304. package/_src/Schedule.ts +0 -1
  305. package/_src/Scope/Finalizer/definition.ts +1 -1
  306. package/_src/Scope/ReleaseMap/definition.ts +1 -1
  307. package/_src/Stream/api.ts +199 -134
  308. package/_src/Stream/internal/DebounceState.ts +2 -2
  309. package/_src/Stream/internal/Handoff.ts +9 -9
  310. package/_src/Stream/internal/SinkEndReason.ts +7 -25
  311. package/_src/TFuture/definition.ts +2 -2
  312. package/_src/TSemaphore/definition.ts +1 -1
  313. package/package.json +3 -3
  314. package/runTests.d.ts +1 -0
  315. package/Schedule/Interval.d.ts +0 -71
  316. package/_cjs/Schedule/Interval.cjs +0 -154
  317. package/_cjs/Schedule/Interval.cjs.map +0 -1
  318. package/_mjs/Schedule/Interval.mjs +0 -114
  319. package/_mjs/Schedule/Interval.mjs.map +0 -1
  320. package/_src/Schedule/Interval.ts +0 -103
@@ -1,71 +0,0 @@
1
- import { Maybe } from "@fncts/base/data/Maybe";
2
- /**
3
- * @tsplus type fncts.io.Schedule.Interval
4
- * @tsplus companion fncts.io.Schedule.IntervalOps
5
- */
6
- export declare class Interval {
7
- readonly startMilliseconds: number;
8
- readonly endMilliseconds: number;
9
- constructor(startMilliseconds: number, endMilliseconds: number);
10
- }
11
- /**
12
- * @tsplus static fncts.io.Schedule.IntervalOps after
13
- * @tsplus location "@fncts/io/Schedule/Interval"
14
- */
15
- export declare function after(start: number): Interval;
16
- /**
17
- * @tsplus static fncts.io.Schedule.IntervalOps before
18
- * @tsplus location "@fncts/io/Schedule/Interval"
19
- */
20
- export declare function before(end: number): Interval;
21
- /**
22
- * @tsplus static fncts.io.Schedule.IntervalOps empty
23
- * @tsplus location "@fncts/io/Schedule/Interval"
24
- */
25
- export declare const empty: Interval;
26
- /**
27
- * @tsplus getter fncts.io.Schedule.Interval isEmpty
28
- * @tsplus location "@fncts/io/Schedule/Interval"
29
- */
30
- export declare function isEmpty(self: Interval): boolean;
31
- /**
32
- * @tsplus fluent fncts.io.Schedule.Interval intersect
33
- * @tsplus location "@fncts/io/Schedule/Interval"
34
- */
35
- export declare function intersect_(self: Interval, that: Interval): Interval;
36
- /**
37
- * @tsplus fluent fncts.io.Schedule.Interval lt
38
- * @tsplus operator fncts.io.Schedule.Interval <
39
- * @tsplus location "@fncts/io/Schedule/Interval"
40
- */
41
- export declare function lt_(self: Interval, that: Interval): boolean;
42
- /**
43
- * @tsplus static fncts.io.Schedule.IntervalOps __call
44
- * @tsplus location "@fncts/io/Schedule/Interval"
45
- */
46
- export declare function makeInterval(start: number, end: number): Interval;
47
- /**
48
- * @tsplus fluent fncts.io.Schedule.Interval max
49
- * @tsplus location "@fncts/io/Schedule/Interval"
50
- */
51
- export declare function max_(self: Interval, that: Interval): Interval;
52
- /**
53
- * @tsplus fluent fncts.io.Schedule.Interval min
54
- * @tsplus location "@fncts/io/Schedule/Interval"
55
- */
56
- export declare function min_(self: Interval, that: Interval): Interval;
57
- /**
58
- * @tsplus getter fncts.io.Schedule.Interval isNonEmpty
59
- * @tsplus location "@fncts/io/Schedule/Interval"
60
- */
61
- export declare function isNonEmpty(self: Interval): boolean;
62
- /**
63
- * @tsplus getter fncts.io.Schedule.Interval size
64
- * @tsplus location "@fncts/io/Schedule/Interval"
65
- */
66
- export declare function size(self: Interval): number;
67
- /**
68
- * @tsplus fluent fncts.io.Schedule.Interval union
69
- * @tsplus location "@fncts/io/Schedule/Interval"
70
- */
71
- export declare function union_(self: Interval, that: Interval): Maybe<Interval>;
@@ -1,154 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Interval = void 0;
7
- exports.after = after;
8
- exports.before = before;
9
- exports.empty = void 0;
10
- exports.intersect_ = intersect_;
11
- exports.isEmpty = void 0;
12
- exports.isNonEmpty = isNonEmpty;
13
- exports.lt_ = lt_;
14
- exports.makeInterval = void 0;
15
- exports.max_ = max_;
16
- exports.min_ = void 0;
17
- exports.size = size;
18
- exports.union_ = union_;
19
-
20
- var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@fncts/base/data/Maybe/constructors"));
21
-
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- const isEmpty = isEmpty_1;
27
- exports.isEmpty = isEmpty;
28
- const makeInterval = makeInterval_1;
29
- exports.makeInterval = makeInterval;
30
- const min_ = min_1;
31
- /**
32
- * @tsplus type fncts.io.Schedule.Interval
33
- * @tsplus companion fncts.io.Schedule.IntervalOps
34
- */
35
-
36
- exports.min_ = min_;
37
-
38
- class Interval {
39
- constructor(startMilliseconds, endMilliseconds) {
40
- this.startMilliseconds = startMilliseconds;
41
- this.endMilliseconds = endMilliseconds;
42
- }
43
-
44
- }
45
- /**
46
- * @tsplus static fncts.io.Schedule.IntervalOps after
47
- */
48
-
49
-
50
- exports.Interval = Interval;
51
-
52
- function after(start) {
53
- return makeInterval_1(start, Number.MAX_SAFE_INTEGER);
54
- }
55
- /**
56
- * @tsplus static fncts.io.Schedule.IntervalOps before
57
- */
58
-
59
-
60
- function before(end) {
61
- return makeInterval_1(Number.MIN_SAFE_INTEGER, end);
62
- }
63
- /**
64
- * @tsplus static fncts.io.Schedule.IntervalOps empty
65
- */
66
-
67
-
68
- const empty_1 = /*#__PURE__*/new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
69
- const empty = empty_1;
70
- /**
71
- * @tsplus getter fncts.io.Schedule.Interval isEmpty
72
- */
73
-
74
- exports.empty = empty;
75
-
76
- function isEmpty_1(self) {
77
- return self.startMilliseconds >= self.endMilliseconds;
78
- }
79
- /**
80
- * @tsplus fluent fncts.io.Schedule.Interval intersect
81
- */
82
-
83
-
84
- function intersect_(self, that) {
85
- const start = Math.max(self.startMilliseconds, that.startMilliseconds);
86
- const end = Math.min(self.endMilliseconds, that.endMilliseconds);
87
- return makeInterval_1(start, end);
88
- }
89
- /**
90
- * @tsplus fluent fncts.io.Schedule.Interval lt
91
- * @tsplus operator fncts.io.Schedule.Interval <
92
- */
93
-
94
-
95
- function lt_(self, that) {
96
- return min_1(self, that) === self;
97
- }
98
- /**
99
- * @tsplus static fncts.io.Schedule.IntervalOps __call
100
- */
101
-
102
-
103
- function makeInterval_1(start, end) {
104
- if (start <= end) return makeInterval_1(start, end);else return empty_1;
105
- }
106
- /**
107
- * @tsplus fluent fncts.io.Schedule.Interval max
108
- */
109
-
110
-
111
- function max_(self, that) {
112
- const m = min_1(self, that);
113
- if (m === self) return that;else return self;
114
- }
115
- /**
116
- * @tsplus fluent fncts.io.Schedule.Interval min
117
- */
118
-
119
-
120
- function min_1(self, that) {
121
- if (self.endMilliseconds <= that.startMilliseconds) return self;
122
- if (that.endMilliseconds <= self.startMilliseconds) return that;
123
- if (self.startMilliseconds < that.startMilliseconds) return self;
124
- if (that.startMilliseconds < self.startMilliseconds) return that;
125
- if (self.endMilliseconds <= that.endMilliseconds) return self;
126
- return that;
127
- }
128
- /**
129
- * @tsplus getter fncts.io.Schedule.Interval isNonEmpty
130
- */
131
-
132
-
133
- function isNonEmpty(self) {
134
- return !isEmpty_1(self);
135
- }
136
- /**
137
- * @tsplus getter fncts.io.Schedule.Interval size
138
- */
139
-
140
-
141
- function size(self) {
142
- return self.endMilliseconds - self.startMilliseconds;
143
- }
144
- /**
145
- * @tsplus fluent fncts.io.Schedule.Interval union
146
- */
147
-
148
-
149
- function union_(self, that) {
150
- const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
151
- const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
152
- if (istart <= iend) return tsplus_module_1.nothing();else return tsplus_module_1.just(makeInterval_1(istart, iend));
153
- }
154
- //# sourceMappingURL=Interval.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Interval.cjs","mappings":"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","names":["isEmpty","makeInterval","min_","Interval","constructor","startMilliseconds","endMilliseconds","after","start","makeInterval_1","Number","MAX_SAFE_INTEGER","before","end","MIN_SAFE_INTEGER","empty_1","empty","self","intersect_","that","Math","max","min","lt_","min_1","max_","m","isNonEmpty","size","union_","istart","iend","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/Schedule/Interval.ts"],"sourcesContent":[null]}
@@ -1,114 +0,0 @@
1
- import * as tsplus_module_1 from "@fncts/base/data/Maybe/constructors";
2
- export const isEmpty = isEmpty_1;
3
- export const makeInterval = makeInterval_1;
4
- export const min_ = min_1;
5
- /**
6
- * @tsplus type fncts.io.Schedule.Interval
7
- * @tsplus companion fncts.io.Schedule.IntervalOps
8
- */
9
-
10
- export class Interval {
11
- constructor(startMilliseconds, endMilliseconds) {
12
- this.startMilliseconds = startMilliseconds;
13
- this.endMilliseconds = endMilliseconds;
14
- }
15
-
16
- }
17
- /**
18
- * @tsplus static fncts.io.Schedule.IntervalOps after
19
- */
20
-
21
- export function after(start) {
22
- return makeInterval_1(start, Number.MAX_SAFE_INTEGER);
23
- }
24
- /**
25
- * @tsplus static fncts.io.Schedule.IntervalOps before
26
- */
27
-
28
- export function before(end) {
29
- return makeInterval_1(Number.MIN_SAFE_INTEGER, end);
30
- }
31
- /**
32
- * @tsplus static fncts.io.Schedule.IntervalOps empty
33
- */
34
-
35
- const empty_1 = /*#__PURE__*/new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
36
- export const empty = empty_1;
37
- /**
38
- * @tsplus getter fncts.io.Schedule.Interval isEmpty
39
- */
40
-
41
- function isEmpty_1(self) {
42
- return self.startMilliseconds >= self.endMilliseconds;
43
- }
44
- /**
45
- * @tsplus fluent fncts.io.Schedule.Interval intersect
46
- */
47
-
48
-
49
- export function intersect_(self, that) {
50
- const start = Math.max(self.startMilliseconds, that.startMilliseconds);
51
- const end = Math.min(self.endMilliseconds, that.endMilliseconds);
52
- return makeInterval_1(start, end);
53
- }
54
- /**
55
- * @tsplus fluent fncts.io.Schedule.Interval lt
56
- * @tsplus operator fncts.io.Schedule.Interval <
57
- */
58
-
59
- export function lt_(self, that) {
60
- return min_1(self, that) === self;
61
- }
62
- /**
63
- * @tsplus static fncts.io.Schedule.IntervalOps __call
64
- */
65
-
66
- function makeInterval_1(start, end) {
67
- if (start <= end) return makeInterval_1(start, end);else return empty_1;
68
- }
69
- /**
70
- * @tsplus fluent fncts.io.Schedule.Interval max
71
- */
72
-
73
-
74
- export function max_(self, that) {
75
- const m = min_1(self, that);
76
- if (m === self) return that;else return self;
77
- }
78
- /**
79
- * @tsplus fluent fncts.io.Schedule.Interval min
80
- */
81
-
82
- function min_1(self, that) {
83
- if (self.endMilliseconds <= that.startMilliseconds) return self;
84
- if (that.endMilliseconds <= self.startMilliseconds) return that;
85
- if (self.startMilliseconds < that.startMilliseconds) return self;
86
- if (that.startMilliseconds < self.startMilliseconds) return that;
87
- if (self.endMilliseconds <= that.endMilliseconds) return self;
88
- return that;
89
- }
90
- /**
91
- * @tsplus getter fncts.io.Schedule.Interval isNonEmpty
92
- */
93
-
94
-
95
- export function isNonEmpty(self) {
96
- return !isEmpty_1(self);
97
- }
98
- /**
99
- * @tsplus getter fncts.io.Schedule.Interval size
100
- */
101
-
102
- export function size(self) {
103
- return self.endMilliseconds - self.startMilliseconds;
104
- }
105
- /**
106
- * @tsplus fluent fncts.io.Schedule.Interval union
107
- */
108
-
109
- export function union_(self, that) {
110
- const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
111
- const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
112
- if (istart <= iend) return tsplus_module_1.nothing();else return tsplus_module_1.just(makeInterval_1(istart, iend));
113
- }
114
- //# sourceMappingURL=Interval.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Interval.mjs","mappings":"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","names":["isEmpty","makeInterval","min_","Interval","constructor","startMilliseconds","endMilliseconds","after","start","makeInterval_1","Number","MAX_SAFE_INTEGER","before","end","MIN_SAFE_INTEGER","empty_1","empty","self","intersect_","that","Math","max","min","lt_","min_1","max_","m","isNonEmpty","size","union_","istart","iend","tsplus_module_1"],"sourceRoot":"","sources":["../../_src/Schedule/Interval.ts"],"sourcesContent":[null]}
@@ -1,103 +0,0 @@
1
- /**
2
- * @tsplus type fncts.io.Schedule.Interval
3
- * @tsplus companion fncts.io.Schedule.IntervalOps
4
- */
5
- export class Interval {
6
- constructor(readonly startMilliseconds: number, readonly endMilliseconds: number) {}
7
- }
8
-
9
- /**
10
- * @tsplus static fncts.io.Schedule.IntervalOps after
11
- */
12
- export function after(start: number): Interval {
13
- return Interval(start, Number.MAX_SAFE_INTEGER);
14
- }
15
-
16
- /**
17
- * @tsplus static fncts.io.Schedule.IntervalOps before
18
- */
19
- export function before(end: number): Interval {
20
- return Interval(Number.MIN_SAFE_INTEGER, end);
21
- }
22
-
23
- /**
24
- * @tsplus static fncts.io.Schedule.IntervalOps empty
25
- */
26
- export const empty: Interval = new Interval(Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
27
-
28
- /**
29
- * @tsplus getter fncts.io.Schedule.Interval isEmpty
30
- */
31
- export function isEmpty(self: Interval): boolean {
32
- return self.startMilliseconds >= self.endMilliseconds;
33
- }
34
-
35
- /**
36
- * @tsplus fluent fncts.io.Schedule.Interval intersect
37
- */
38
- export function intersect_(self: Interval, that: Interval): Interval {
39
- const start = Math.max(self.startMilliseconds, that.startMilliseconds);
40
- const end = Math.min(self.endMilliseconds, that.endMilliseconds);
41
- return Interval(start, end);
42
- }
43
-
44
- /**
45
- * @tsplus fluent fncts.io.Schedule.Interval lt
46
- * @tsplus operator fncts.io.Schedule.Interval <
47
- */
48
- export function lt_(self: Interval, that: Interval): boolean {
49
- return self.min(that) === self;
50
- }
51
-
52
- /**
53
- * @tsplus static fncts.io.Schedule.IntervalOps __call
54
- */
55
- export function makeInterval(start: number, end: number): Interval {
56
- if (start <= end) return Interval(start, end);
57
- else return Interval.empty;
58
- }
59
-
60
- /**
61
- * @tsplus fluent fncts.io.Schedule.Interval max
62
- */
63
- export function max_(self: Interval, that: Interval): Interval {
64
- const m = self.min(that);
65
- if (m === self) return that;
66
- else return self;
67
- }
68
-
69
- /**
70
- * @tsplus fluent fncts.io.Schedule.Interval min
71
- */
72
- export function min_(self: Interval, that: Interval): Interval {
73
- if (self.endMilliseconds <= that.startMilliseconds) return self;
74
- if (that.endMilliseconds <= self.startMilliseconds) return that;
75
- if (self.startMilliseconds < that.startMilliseconds) return self;
76
- if (that.startMilliseconds < self.startMilliseconds) return that;
77
- if (self.endMilliseconds <= that.endMilliseconds) return self;
78
- return that;
79
- }
80
-
81
- /**
82
- * @tsplus getter fncts.io.Schedule.Interval isNonEmpty
83
- */
84
- export function isNonEmpty(self: Interval): boolean {
85
- return !self.isEmpty;
86
- }
87
-
88
- /**
89
- * @tsplus getter fncts.io.Schedule.Interval size
90
- */
91
- export function size(self: Interval): number {
92
- return self.endMilliseconds - self.startMilliseconds;
93
- }
94
-
95
- /**
96
- * @tsplus fluent fncts.io.Schedule.Interval union
97
- */
98
- export function union_(self: Interval, that: Interval): Maybe<Interval> {
99
- const istart = Math.max(self.startMilliseconds, that.startMilliseconds);
100
- const iend = Math.min(self.endMilliseconds, that.endMilliseconds);
101
- if (istart <= iend) return Nothing();
102
- else return Just(Interval(istart, iend));
103
- }