reactor-core-ts 2.1.6 → 3.2.1

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 (269) hide show
  1. package/README.md +927 -658
  2. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js +12 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPrimitive.js +14 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPropertyKey.js +9 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/typeof.js +11 -0
  6. package/dist/context/context-view.d.ts +31 -0
  7. package/dist/context/context-view.d.ts.map +1 -0
  8. package/dist/context/context-view.js +58 -0
  9. package/dist/context/context-view.js.map +1 -0
  10. package/dist/context/context.d.ts +46 -0
  11. package/dist/context/context.d.ts.map +1 -0
  12. package/dist/context/context.js +125 -0
  13. package/dist/context/context.js.map +1 -0
  14. package/dist/context/types.d.ts +7 -0
  15. package/dist/context/types.d.ts.map +1 -0
  16. package/dist/core/boolean-disposable.d.ts +19 -0
  17. package/dist/core/boolean-disposable.d.ts.map +1 -0
  18. package/dist/core/boolean-disposable.js +37 -0
  19. package/dist/core/boolean-disposable.js.map +1 -0
  20. package/dist/core/composite-disposable.d.ts +21 -0
  21. package/dist/core/composite-disposable.d.ts.map +1 -0
  22. package/dist/core/composite-disposable.js +64 -0
  23. package/dist/core/composite-disposable.js.map +1 -0
  24. package/dist/core/demand.d.ts +9 -0
  25. package/dist/core/demand.d.ts.map +1 -0
  26. package/dist/core/demand.js +21 -0
  27. package/dist/core/demand.js.map +1 -0
  28. package/dist/core/disposables.d.ts +12 -0
  29. package/dist/core/disposables.d.ts.map +1 -0
  30. package/dist/core/disposables.js +37 -0
  31. package/dist/core/disposables.js.map +1 -0
  32. package/dist/core/teardown.d.ts +4 -0
  33. package/dist/core/teardown.d.ts.map +1 -0
  34. package/dist/core/types.d.ts +14 -0
  35. package/dist/core/types.d.ts.map +1 -0
  36. package/dist/errors/classes.d.ts +37 -0
  37. package/dist/errors/classes.d.ts.map +1 -0
  38. package/dist/errors/classes.js +53 -0
  39. package/dist/errors/classes.js.map +1 -0
  40. package/dist/errors/exceptions.d.ts +15 -0
  41. package/dist/errors/exceptions.d.ts.map +1 -0
  42. package/dist/errors/helpers.d.ts +9 -0
  43. package/dist/errors/helpers.d.ts.map +1 -0
  44. package/dist/errors/helpers.js +18 -0
  45. package/dist/errors/helpers.js.map +1 -0
  46. package/dist/index.d.ts +17 -2556
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +8 -2
  49. package/dist/internal/abort.d.ts +5 -0
  50. package/dist/internal/abort.d.ts.map +1 -0
  51. package/dist/internal/abort.js +36 -0
  52. package/dist/internal/abort.js.map +1 -0
  53. package/dist/internal/async-queue.d.ts +48 -0
  54. package/dist/internal/async-queue.d.ts.map +1 -0
  55. package/dist/internal/async-queue.js +187 -0
  56. package/dist/internal/async-queue.js.map +1 -0
  57. package/dist/internal/iterable-terminal.d.ts +12 -0
  58. package/dist/internal/iterable-terminal.d.ts.map +1 -0
  59. package/dist/internal/iterable-terminal.js +49 -0
  60. package/dist/internal/iterable-terminal.js.map +1 -0
  61. package/dist/internal/iterable-transform.d.ts +24 -0
  62. package/dist/internal/iterable-transform.d.ts.map +1 -0
  63. package/dist/internal/iterable-transform.js +159 -0
  64. package/dist/internal/iterable-transform.js.map +1 -0
  65. package/dist/internal/iterable.d.ts +23 -0
  66. package/dist/internal/iterable.d.ts.map +1 -0
  67. package/dist/internal/iterable.js +81 -0
  68. package/dist/internal/iterable.js.map +1 -0
  69. package/dist/internal/microtask.d.ts +7 -0
  70. package/dist/internal/microtask.d.ts.map +1 -0
  71. package/dist/internal/microtask.js +19 -0
  72. package/dist/internal/microtask.js.map +1 -0
  73. package/dist/publisher/browser-sources.d.ts +15 -0
  74. package/dist/publisher/browser-sources.d.ts.map +1 -0
  75. package/dist/publisher/browser-sources.js +92 -0
  76. package/dist/publisher/browser-sources.js.map +1 -0
  77. package/dist/publisher/flux-entrypoint.d.ts +7 -0
  78. package/dist/publisher/flux-entrypoint.d.ts.map +1 -0
  79. package/dist/publisher/flux-entrypoint.js +11 -0
  80. package/dist/publisher/flux-entrypoint.js.map +1 -0
  81. package/dist/publisher/flux.d.ts +121 -0
  82. package/dist/publisher/flux.d.ts.map +1 -0
  83. package/dist/publisher/flux.js +697 -0
  84. package/dist/publisher/flux.js.map +1 -0
  85. package/dist/publisher/helpers.d.ts +19 -0
  86. package/dist/publisher/helpers.d.ts.map +1 -0
  87. package/dist/publisher/helpers.js +84 -0
  88. package/dist/publisher/helpers.js.map +1 -0
  89. package/dist/publisher/mono-entrypoint.d.ts +7 -0
  90. package/dist/publisher/mono-entrypoint.d.ts.map +1 -0
  91. package/dist/publisher/mono-entrypoint.js +11 -0
  92. package/dist/publisher/mono-entrypoint.js.map +1 -0
  93. package/dist/publisher/mono.d.ts +72 -0
  94. package/dist/publisher/mono.d.ts.map +1 -0
  95. package/dist/publisher/mono.js +373 -0
  96. package/dist/publisher/mono.js.map +1 -0
  97. package/dist/publisher/operators/aggregate.d.ts +35 -0
  98. package/dist/publisher/operators/aggregate.d.ts.map +1 -0
  99. package/dist/publisher/operators/aggregate.js +217 -0
  100. package/dist/publisher/operators/aggregate.js.map +1 -0
  101. package/dist/publisher/operators/compat/flux.d.ts +56 -0
  102. package/dist/publisher/operators/compat/flux.d.ts.map +1 -0
  103. package/dist/publisher/operators/compat/flux.js +156 -0
  104. package/dist/publisher/operators/compat/flux.js.map +1 -0
  105. package/dist/publisher/operators/compat/mono.d.ts +82 -0
  106. package/dist/publisher/operators/compat/mono.d.ts.map +1 -0
  107. package/dist/publisher/operators/compat/mono.js +125 -0
  108. package/dist/publisher/operators/compat/mono.js.map +1 -0
  109. package/dist/publisher/operators/coordination.d.ts +82 -0
  110. package/dist/publisher/operators/coordination.d.ts.map +1 -0
  111. package/dist/publisher/operators/coordination.js +345 -0
  112. package/dist/publisher/operators/coordination.js.map +1 -0
  113. package/dist/publisher/operators/error.d.ts +17 -0
  114. package/dist/publisher/operators/error.d.ts.map +1 -0
  115. package/dist/publisher/operators/error.js +48 -0
  116. package/dist/publisher/operators/error.js.map +1 -0
  117. package/dist/publisher/operators/flatten.d.ts +19 -0
  118. package/dist/publisher/operators/flatten.d.ts.map +1 -0
  119. package/dist/publisher/operators/flatten.js +127 -0
  120. package/dist/publisher/operators/flatten.js.map +1 -0
  121. package/dist/publisher/operators/lifecycle.d.ts +103 -0
  122. package/dist/publisher/operators/lifecycle.d.ts.map +1 -0
  123. package/dist/publisher/operators/lifecycle.js +237 -0
  124. package/dist/publisher/operators/lifecycle.js.map +1 -0
  125. package/dist/publisher/operators/mono-parity.d.ts +109 -0
  126. package/dist/publisher/operators/mono-parity.d.ts.map +1 -0
  127. package/dist/publisher/operators/mono-parity.js +144 -0
  128. package/dist/publisher/operators/mono-parity.js.map +1 -0
  129. package/dist/publisher/operators/mono.d.ts +30 -0
  130. package/dist/publisher/operators/mono.d.ts.map +1 -0
  131. package/dist/publisher/operators/mono.js +37 -0
  132. package/dist/publisher/operators/mono.js.map +1 -0
  133. package/dist/publisher/operators/register.d.ts +20 -0
  134. package/dist/publisher/operators/register.d.ts.map +1 -0
  135. package/dist/publisher/operators/register.js +23 -0
  136. package/dist/publisher/operators/register.js.map +1 -0
  137. package/dist/publisher/operators/selection.d.ts +25 -0
  138. package/dist/publisher/operators/selection.d.ts.map +1 -0
  139. package/dist/publisher/operators/selection.js +108 -0
  140. package/dist/publisher/operators/selection.js.map +1 -0
  141. package/dist/publisher/operators/side-effect.d.ts +15 -0
  142. package/dist/publisher/operators/side-effect.d.ts.map +1 -0
  143. package/dist/publisher/operators/side-effect.js +56 -0
  144. package/dist/publisher/operators/side-effect.js.map +1 -0
  145. package/dist/publisher/operators/terminal.d.ts +16 -0
  146. package/dist/publisher/operators/terminal.d.ts.map +1 -0
  147. package/dist/publisher/operators/terminal.js +47 -0
  148. package/dist/publisher/operators/terminal.js.map +1 -0
  149. package/dist/publisher/operators/time.d.ts +20 -0
  150. package/dist/publisher/operators/time.d.ts.map +1 -0
  151. package/dist/publisher/operators/time.js +92 -0
  152. package/dist/publisher/operators/time.js.map +1 -0
  153. package/dist/publisher/operators/transform.d.ts +31 -0
  154. package/dist/publisher/operators/transform.d.ts.map +1 -0
  155. package/dist/publisher/operators/transform.js +74 -0
  156. package/dist/publisher/operators/transform.js.map +1 -0
  157. package/dist/publisher/operators/windowing.d.ts +28 -0
  158. package/dist/publisher/operators/windowing.d.ts.map +1 -0
  159. package/dist/publisher/operators/windowing.js +148 -0
  160. package/dist/publisher/operators/windowing.js.map +1 -0
  161. package/dist/publisher/publisher.d.ts +11 -0
  162. package/dist/publisher/publisher.d.ts.map +1 -0
  163. package/dist/publisher/types.d.ts +51 -0
  164. package/dist/publisher/types.d.ts.map +1 -0
  165. package/dist/schedulers/animation-frame-scheduler.d.ts +11 -0
  166. package/dist/schedulers/animation-frame-scheduler.d.ts.map +1 -0
  167. package/dist/schedulers/animation-frame-scheduler.js +30 -0
  168. package/dist/schedulers/animation-frame-scheduler.js.map +1 -0
  169. package/dist/schedulers/base-scheduler.d.ts +28 -0
  170. package/dist/schedulers/base-scheduler.d.ts.map +1 -0
  171. package/dist/schedulers/base-scheduler.js +77 -0
  172. package/dist/schedulers/base-scheduler.js.map +1 -0
  173. package/dist/schedulers/basic-worker.d.ts +22 -0
  174. package/dist/schedulers/basic-worker.d.ts.map +1 -0
  175. package/dist/schedulers/basic-worker.js +71 -0
  176. package/dist/schedulers/basic-worker.js.map +1 -0
  177. package/dist/schedulers/delay-scheduler.d.ts +12 -0
  178. package/dist/schedulers/delay-scheduler.d.ts.map +1 -0
  179. package/dist/schedulers/delay-scheduler.js +17 -0
  180. package/dist/schedulers/delay-scheduler.js.map +1 -0
  181. package/dist/schedulers/disposed.d.ts +4 -0
  182. package/dist/schedulers/disposed.d.ts.map +1 -0
  183. package/dist/schedulers/disposed.js +14 -0
  184. package/dist/schedulers/disposed.js.map +1 -0
  185. package/dist/schedulers/duration.d.ts +8 -0
  186. package/dist/schedulers/duration.d.ts.map +1 -0
  187. package/dist/schedulers/duration.js +11 -0
  188. package/dist/schedulers/duration.js.map +1 -0
  189. package/dist/schedulers/executor-scheduler.d.ts +13 -0
  190. package/dist/schedulers/executor-scheduler.d.ts.map +1 -0
  191. package/dist/schedulers/executor-scheduler.js +43 -0
  192. package/dist/schedulers/executor-scheduler.js.map +1 -0
  193. package/dist/schedulers/immediate-scheduler.d.ts +15 -0
  194. package/dist/schedulers/immediate-scheduler.d.ts.map +1 -0
  195. package/dist/schedulers/immediate-scheduler.js +24 -0
  196. package/dist/schedulers/immediate-scheduler.js.map +1 -0
  197. package/dist/schedulers/index.d.ts +7 -0
  198. package/dist/schedulers/index.d.ts.map +1 -0
  199. package/dist/schedulers/index.js +2 -0
  200. package/dist/schedulers/interval-scheduler.d.ts +12 -0
  201. package/dist/schedulers/interval-scheduler.d.ts.map +1 -0
  202. package/dist/schedulers/interval-scheduler.js +17 -0
  203. package/dist/schedulers/interval-scheduler.js.map +1 -0
  204. package/dist/schedulers/macro-scheduler.d.ts +19 -0
  205. package/dist/schedulers/macro-scheduler.d.ts.map +1 -0
  206. package/dist/schedulers/macro-scheduler.js +30 -0
  207. package/dist/schedulers/macro-scheduler.js.map +1 -0
  208. package/dist/schedulers/microtask-scheduler.d.ts +11 -0
  209. package/dist/schedulers/microtask-scheduler.d.ts.map +1 -0
  210. package/dist/schedulers/microtask-scheduler.js +34 -0
  211. package/dist/schedulers/microtask-scheduler.js.map +1 -0
  212. package/dist/schedulers/schedulers.d.ts +39 -0
  213. package/dist/schedulers/schedulers.d.ts.map +1 -0
  214. package/dist/schedulers/schedulers.js +83 -0
  215. package/dist/schedulers/schedulers.js.map +1 -0
  216. package/dist/schedulers/timeout-scheduler.d.ts +11 -0
  217. package/dist/schedulers/timeout-scheduler.d.ts.map +1 -0
  218. package/dist/schedulers/types.d.ts +35 -0
  219. package/dist/schedulers/types.d.ts.map +1 -0
  220. package/dist/signal/signal-type.d.ts +26 -0
  221. package/dist/signal/signal-type.d.ts.map +1 -0
  222. package/dist/signal/signal-type.js +31 -0
  223. package/dist/signal/signal-type.js.map +1 -0
  224. package/dist/signal/signal.d.ts +33 -0
  225. package/dist/signal/signal.d.ts.map +1 -0
  226. package/dist/signal/signal.js +70 -0
  227. package/dist/signal/signal.js.map +1 -0
  228. package/dist/sinks/index.d.ts +7 -0
  229. package/dist/sinks/index.d.ts.map +1 -0
  230. package/dist/sinks/index.js +2 -0
  231. package/dist/sinks/many.d.ts +66 -0
  232. package/dist/sinks/many.d.ts.map +1 -0
  233. package/dist/sinks/many.js +193 -0
  234. package/dist/sinks/many.js.map +1 -0
  235. package/dist/sinks/one.d.ts +41 -0
  236. package/dist/sinks/one.d.ts.map +1 -0
  237. package/dist/sinks/one.js +144 -0
  238. package/dist/sinks/one.js.map +1 -0
  239. package/dist/sinks/specs.d.ts +25 -0
  240. package/dist/sinks/specs.d.ts.map +1 -0
  241. package/dist/sinks/specs.js +126 -0
  242. package/dist/sinks/specs.js.map +1 -0
  243. package/dist/sinks/subscribers.d.ts +16 -0
  244. package/dist/sinks/subscribers.d.ts.map +1 -0
  245. package/dist/sinks/subscribers.js +32 -0
  246. package/dist/sinks/subscribers.js.map +1 -0
  247. package/dist/sinks/types.d.ts +137 -0
  248. package/dist/sinks/types.d.ts.map +1 -0
  249. package/dist/sinks/types.js +58 -0
  250. package/dist/sinks/types.js.map +1 -0
  251. package/dist/subscription/core-subscriber.d.ts +12 -0
  252. package/dist/subscription/core-subscriber.d.ts.map +1 -0
  253. package/dist/subscription/iterable-subscription.d.ts +64 -0
  254. package/dist/subscription/iterable-subscription.d.ts.map +1 -0
  255. package/dist/subscription/iterable-subscription.js +281 -0
  256. package/dist/subscription/iterable-subscription.js.map +1 -0
  257. package/dist/subscription/reactive-streams.d.ts +8 -0
  258. package/dist/subscription/reactive-streams.d.ts.map +1 -0
  259. package/dist/subscription/reactive-streams.js +0 -0
  260. package/dist/subscription/subscriber.d.ts +17 -0
  261. package/dist/subscription/subscriber.d.ts.map +1 -0
  262. package/dist/subscription/subscription.d.ts +12 -0
  263. package/dist/subscription/subscription.d.ts.map +1 -0
  264. package/package.json +99 -33
  265. package/LICENSE.md +0 -56
  266. package/dist/index.d.mts +0 -2557
  267. package/dist/index.js.map +0 -1
  268. package/dist/index.mjs +0 -2
  269. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Browser scheduler implementations and contracts.
4
+ */
5
+ import { MacroScheduler } from "./macro-scheduler.js";
6
+ /** Compatibility scheduler name for timeout-backed macrotask scheduling. */
7
+ export declare class TimeoutScheduler extends MacroScheduler {
8
+ /** Creates a timeout-named macrotask scheduler. */
9
+ constructor(name?: string);
10
+ }
11
+ //# sourceMappingURL=timeout-scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeout-scheduler.d.ts","sourceRoot":"","sources":["../../src/schedulers/timeout-scheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAE/D,4EAA4E;AAC5E,qBAAa,gBAAiB,SAAQ,cAAc;IAChD,mDAAmD;IACnD,YAAmB,IAAI,SAAY,EAElC;CACJ"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Browser scheduler implementations and contracts.
4
+ */
5
+ import type { Disposable } from "../core/types.js";
6
+ /** Duration accepted by browser schedulers, expressed in milliseconds or fields. */
7
+ export type DurationInput = number | {
8
+ milliseconds?: number;
9
+ seconds?: number;
10
+ minutes?: number;
11
+ hours?: number;
12
+ };
13
+ /** Scheduler capable of executing immediate, delayed and periodic tasks. */
14
+ export interface Scheduler extends Disposable {
15
+ /** Human-readable scheduler name. */
16
+ readonly name: string;
17
+ /** Returns the current scheduler time in milliseconds. */
18
+ now(): number;
19
+ /** Schedules a single task, optionally after a delay. */
20
+ schedule(task: () => void, delay?: DurationInput): Disposable;
21
+ /** Schedules a repeated task. */
22
+ schedulePeriodically(task: () => void, initialDelay?: DurationInput, period?: DurationInput): Disposable;
23
+ /** Creates a worker that can dispose a group of tasks together. */
24
+ createWorker(): SchedulerWorker;
25
+ }
26
+ /** Worker groups scheduled tasks for coordinated disposal. */
27
+ export interface SchedulerWorker extends Disposable {
28
+ /** Schedules a single task on this worker. */
29
+ schedule(task: () => void, delay?: DurationInput): Disposable;
30
+ /** Schedules a repeated task on this worker. */
31
+ schedulePeriodically(task: () => void, initialDelay?: DurationInput, period?: DurationInput): Disposable;
32
+ }
33
+ /** Function that accepts a task for execution. */
34
+ export type Executor = (task: () => void) => void;
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schedulers/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAEhD,oFAAoF;AACpF,MAAM,MAAM,aAAa,GACnB,MAAM,GACN;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,WAAW,SAAU,SAAQ,UAAU;IACzC,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,0DAA0D;IAC1D,GAAG,IAAI,MAAM,CAAC;IAEd,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,UAAU,CAAC;IAE9D,iCAAiC;IACjC,oBAAoB,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,YAAY,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,UAAU,CAAC;IAEzG,mEAAmE;IACnE,YAAY,IAAI,eAAe,CAAC;CACnC;AAED,8DAA8D;AAC9D,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAC/C,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,aAAa,GAAG,UAAU,CAAC;IAE9D,gDAAgD;IAChD,oBAAoB,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,YAAY,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,UAAU,CAAC;CAC5G;AAED,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Materialized signal representation and signal kinds.
4
+ */
5
+ /** Reactive signal kinds used by materialize/dematerialize and sink handlers. */
6
+ export declare enum SignalType {
7
+ /** Subscription signal. */
8
+ SUBSCRIBE = "subscribe",
9
+ /** Request signal. */
10
+ REQUEST = "request",
11
+ /** Cancellation signal. */
12
+ CANCEL = "cancel",
13
+ /** Next value signal. */
14
+ NEXT = "next",
15
+ /** Error terminal signal. */
16
+ ERROR = "error",
17
+ /** Complete terminal signal. */
18
+ COMPLETE = "complete",
19
+ /** Post-termination callback signal. */
20
+ AFTER_TERMINATE = "afterTerminate",
21
+ /** Current context lookup signal. */
22
+ CURRENT_CONTEXT = "currentContext",
23
+ /** Context write signal. */
24
+ ON_CONTEXT = "onContext"
25
+ }
26
+ //# sourceMappingURL=signal-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-type.d.ts","sourceRoot":"","sources":["../../src/signal/signal-type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,iFAAiF;AACjF,oBAAY,UAAU;IAClB,2BAA2B;IAC3B,SAAS,cAAc;IACvB,sBAAsB;IACtB,OAAO,YAAY;IACnB,2BAA2B;IAC3B,MAAM,WAAW;IACjB,yBAAyB;IACzB,IAAI,SAAS;IACb,6BAA6B;IAC7B,KAAK,UAAU;IACf,gCAAgC;IAChC,QAAQ,aAAa;IACrB,wCAAwC;IACxC,eAAe,mBAAmB;IAClC,qCAAqC;IACrC,eAAe,mBAAmB;IAClC,4BAA4B;IAC5B,UAAU,cAAc;CAC3B"}
@@ -0,0 +1,31 @@
1
+ //#region src/signal/signal-type.ts
2
+ /**
3
+ * @packageDocumentation
4
+ * Materialized signal representation and signal kinds.
5
+ */
6
+ /** Reactive signal kinds used by materialize/dematerialize and sink handlers. */
7
+ var SignalType = /* @__PURE__ */ function(SignalType) {
8
+ /** Subscription signal. */
9
+ SignalType["SUBSCRIBE"] = "subscribe";
10
+ /** Request signal. */
11
+ SignalType["REQUEST"] = "request";
12
+ /** Cancellation signal. */
13
+ SignalType["CANCEL"] = "cancel";
14
+ /** Next value signal. */
15
+ SignalType["NEXT"] = "next";
16
+ /** Error terminal signal. */
17
+ SignalType["ERROR"] = "error";
18
+ /** Complete terminal signal. */
19
+ SignalType["COMPLETE"] = "complete";
20
+ /** Post-termination callback signal. */
21
+ SignalType["AFTER_TERMINATE"] = "afterTerminate";
22
+ /** Current context lookup signal. */
23
+ SignalType["CURRENT_CONTEXT"] = "currentContext";
24
+ /** Context write signal. */
25
+ SignalType["ON_CONTEXT"] = "onContext";
26
+ return SignalType;
27
+ }({});
28
+ //#endregion
29
+ export { SignalType };
30
+
31
+ //# sourceMappingURL=signal-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal-type.js","names":[],"sources":["../../src/signal/signal-type.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Materialized signal representation and signal kinds.\n */\n/** Reactive signal kinds used by materialize/dematerialize and sink handlers. */\nexport enum SignalType {\n /** Subscription signal. */\n SUBSCRIBE = \"subscribe\",\n /** Request signal. */\n REQUEST = \"request\",\n /** Cancellation signal. */\n CANCEL = \"cancel\",\n /** Next value signal. */\n NEXT = \"next\",\n /** Error terminal signal. */\n ERROR = \"error\",\n /** Complete terminal signal. */\n COMPLETE = \"complete\",\n /** Post-termination callback signal. */\n AFTER_TERMINATE = \"afterTerminate\",\n /** Current context lookup signal. */\n CURRENT_CONTEXT = \"currentContext\",\n /** Context write signal. */\n ON_CONTEXT = \"onContext\"\n}\n"],"mappings":";;;;;;AAKA,IAAY,aAAL,yBAAA,YAAA;;CAEH,WAAA,eAAA;;CAEA,WAAA,aAAA;;CAEA,WAAA,YAAA;;CAEA,WAAA,UAAA;;CAEA,WAAA,WAAA;;CAEA,WAAA,cAAA;;CAEA,WAAA,qBAAA;;CAEA,WAAA,qBAAA;;CAEA,WAAA,gBAAA;;AACJ,EAAA,CAAA,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Materialized signal representation and signal kinds.
4
+ */
5
+ import { SignalType } from "./signal-type.js";
6
+ /** Immutable representation of a Reactor signal. */
7
+ export declare class Signal<T> {
8
+ /** Signal kind represented by this instance. */
9
+ readonly type: SignalType;
10
+ /** Value carried by onNext signals. */
11
+ readonly value: T | undefined;
12
+ /** Error carried by onError signals. */
13
+ readonly error: unknown;
14
+ /** Creates an immutable signal value. */
15
+ private constructor();
16
+ /** Creates an onNext signal. */
17
+ static next<T>(value: T): Signal<T>;
18
+ /** Creates an onError signal. */
19
+ static error<T = never>(error: unknown): Signal<T>;
20
+ /** Creates an onComplete signal. */
21
+ static complete<T = never>(): Signal<T>;
22
+ /** Returns true for onNext signals. */
23
+ isOnNext(): boolean;
24
+ /** Returns true for onError signals. */
25
+ isOnError(): boolean;
26
+ /** Returns true for onComplete signals. */
27
+ isOnComplete(): boolean;
28
+ /** Returns the signal value when present. */
29
+ get(): T | undefined;
30
+ /** Returns the signal error when present. */
31
+ getThrowable(): unknown;
32
+ }
33
+ //# sourceMappingURL=signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/signal/signal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAEnD,oDAAoD;AACpD,qBAAa,MAAM,CAAC,CAAC;IACjB,gDAAgD;IAChD,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,uCAAuC;IACvC,SAAgB,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;IACrC,wCAAwC;IACxC,SAAgB,KAAK,EAAE,OAAO,CAAC;IAE/B,yCAAyC;IACzC,OAAO,eAIN;IAED,gCAAgC;IAChC,OAAc,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAEzC;IAED,iCAAiC;IACjC,OAAc,KAAK,CAAC,CAAC,GAAG,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAExD;IAED,oCAAoC;IACpC,OAAc,QAAQ,CAAC,CAAC,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAE7C;IAED,uCAAuC;IAChC,QAAQ,IAAI,OAAO,CAEzB;IAED,wCAAwC;IACjC,SAAS,IAAI,OAAO,CAE1B;IAED,2CAA2C;IACpC,YAAY,IAAI,OAAO,CAE7B;IAED,6CAA6C;IACtC,GAAG,IAAI,CAAC,GAAG,SAAS,CAE1B;IAED,6CAA6C;IACtC,YAAY,IAAI,OAAO,CAE7B;CACJ"}
@@ -0,0 +1,70 @@
1
+ import _defineProperty from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ import { SignalType } from "./signal-type.js";
3
+ //#region src/signal/signal.ts
4
+ /**
5
+ * @packageDocumentation
6
+ * Materialized signal representation and signal kinds.
7
+ */
8
+ /** Immutable representation of a Reactor signal. */
9
+ var Signal = class Signal {
10
+ /** Creates an immutable signal value. */
11
+ constructor(type, value, error) {
12
+ _defineProperty(
13
+ this,
14
+ /** Signal kind represented by this instance. */
15
+ "type",
16
+ void 0
17
+ );
18
+ _defineProperty(
19
+ this,
20
+ /** Value carried by onNext signals. */
21
+ "value",
22
+ void 0
23
+ );
24
+ _defineProperty(
25
+ this,
26
+ /** Error carried by onError signals. */
27
+ "error",
28
+ void 0
29
+ );
30
+ this.type = type;
31
+ this.value = value;
32
+ this.error = error;
33
+ }
34
+ /** Creates an onNext signal. */
35
+ static next(value) {
36
+ return new Signal(SignalType.NEXT, value);
37
+ }
38
+ /** Creates an onError signal. */
39
+ static error(error) {
40
+ return new Signal(SignalType.ERROR, void 0, error);
41
+ }
42
+ /** Creates an onComplete signal. */
43
+ static complete() {
44
+ return new Signal(SignalType.COMPLETE);
45
+ }
46
+ /** Returns true for onNext signals. */
47
+ isOnNext() {
48
+ return this.type === SignalType.NEXT;
49
+ }
50
+ /** Returns true for onError signals. */
51
+ isOnError() {
52
+ return this.type === SignalType.ERROR;
53
+ }
54
+ /** Returns true for onComplete signals. */
55
+ isOnComplete() {
56
+ return this.type === SignalType.COMPLETE;
57
+ }
58
+ /** Returns the signal value when present. */
59
+ get() {
60
+ return this.value;
61
+ }
62
+ /** Returns the signal error when present. */
63
+ getThrowable() {
64
+ return this.error;
65
+ }
66
+ };
67
+ //#endregion
68
+ export { Signal };
69
+
70
+ //# sourceMappingURL=signal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal.js","names":[],"sources":["../../src/signal/signal.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Materialized signal representation and signal kinds.\n */\nimport {SignalType} from \"@/signal/signal-type.js\";\n\n/** Immutable representation of a Reactor signal. */\nexport class Signal<T> {\n /** Signal kind represented by this instance. */\n public readonly type: SignalType;\n /** Value carried by onNext signals. */\n public readonly value: T | undefined;\n /** Error carried by onError signals. */\n public readonly error: unknown;\n\n /** Creates an immutable signal value. */\n private constructor(type: SignalType, value?: T, error?: unknown) {\n this.type = type;\n this.value = value;\n this.error = error;\n }\n\n /** Creates an onNext signal. */\n public static next<T>(value: T): Signal<T> {\n return new Signal(SignalType.NEXT, value);\n }\n\n /** Creates an onError signal. */\n public static error<T = never>(error: unknown): Signal<T> {\n return new Signal<T>(SignalType.ERROR, undefined, error);\n }\n\n /** Creates an onComplete signal. */\n public static complete<T = never>(): Signal<T> {\n return new Signal<T>(SignalType.COMPLETE);\n }\n\n /** Returns true for onNext signals. */\n public isOnNext(): boolean {\n return this.type === SignalType.NEXT;\n }\n\n /** Returns true for onError signals. */\n public isOnError(): boolean {\n return this.type === SignalType.ERROR;\n }\n\n /** Returns true for onComplete signals. */\n public isOnComplete(): boolean {\n return this.type === SignalType.COMPLETE;\n }\n\n /** Returns the signal value when present. */\n public get(): T | undefined {\n return this.value;\n }\n\n /** Returns the signal error when present. */\n public getThrowable(): unknown {\n return this.error;\n }\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,SAAb,MAAa,OAAU;;CASnB,YAAoB,MAAkB,OAAW,OAAiB;;;;GAPlE;;;;;;GAEA;;;;;;GAEA;;;EAII,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,QAAQ;CACjB;;CAGA,OAAc,KAAQ,OAAqB;EACvC,OAAO,IAAI,OAAO,WAAW,MAAM,KAAK;CAC5C;;CAGA,OAAc,MAAiB,OAA2B;EACtD,OAAO,IAAI,OAAU,WAAW,OAAO,QAAW,KAAK;CAC3D;;CAGA,OAAc,WAAiC;EAC3C,OAAO,IAAI,OAAU,WAAW,QAAQ;CAC5C;;CAGA,WAA2B;EACvB,OAAO,KAAK,SAAS,WAAW;CACpC;;CAGA,YAA4B;EACxB,OAAO,KAAK,SAAS,WAAW;CACpC;;CAGA,eAA+B;EAC3B,OAAO,KAAK,SAAS,WAAW;CACpC;;CAGA,MAA4B;EACxB,OAAO,KAAK;CAChB;;CAGA,eAA+B;EAC3B,OAAO,KAAK;CAChB;AACJ"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Sink specifications and default browser-oriented sink implementations.
4
+ */
5
+ /** Public Sinks entrypoint. */
6
+ export { Sinks } from "./specs.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sinks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,+BAA+B;AAC/B,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Sinks } from "./specs.js";
2
+ export { Sinks };
@@ -0,0 +1,66 @@
1
+ import { Flux } from "../publisher/flux.js";
2
+ import type { PublisherInput } from "../publisher/types.js";
3
+ import { SignalType } from "../signal/signal-type.js";
4
+ import { type EmitFailureHandler, EmitResult, type ManySink } from "./types.js";
5
+ /** Delivery mode supported by the default many-valued sink. */
6
+ type ManyMode = "unicast" | "unicast-error" | "multicast-buffer" | "multicast-direct" | "replay";
7
+ /** Configuration for a many-valued sink implementation. */
8
+ export interface ManyOptions<T> {
9
+ /** Delivery mode used by the sink. */
10
+ mode: ManyMode;
11
+ /** Maximum number of replayed values retained in history. */
12
+ replayLimit?: number;
13
+ /** Initial value replayed by latest-or-default sinks. */
14
+ latestDefault?: T;
15
+ }
16
+ /** Default implementation for unicast, multicast and replay many-valued sinks. */
17
+ export declare class DefaultManySink<T> implements ManySink<T> {
18
+ /** Active subscriber queues currently receiving live values. */
19
+ private subscribers;
20
+ /** Values buffered before a non-replay sink receives its first subscriber. */
21
+ private pending;
22
+ /** Values retained for replay subscribers. */
23
+ private history;
24
+ /** Ring-buffer index of the oldest replay value. */
25
+ private historyHead;
26
+ /** Terminal state when the sink has completed or failed. */
27
+ private terminated;
28
+ /** Error retained for late subscribers after failure. */
29
+ private errorValue;
30
+ /** Tracks whether a unicast sink already accepted its single subscriber. */
31
+ private unicastAttached;
32
+ /** Construction options controlling delivery and replay behavior. */
33
+ private readonly options;
34
+ /** Creates a many-valued sink with the provided delivery mode. */
35
+ constructor(options: ManyOptions<T>);
36
+ /** Returns the Flux view of this sink. */
37
+ asFlux(): Flux<T>;
38
+ /** Attempts to emit a value to current subscribers. */
39
+ tryEmitNext(value: T): EmitResult;
40
+ /** Attempts to complete this sink. */
41
+ tryEmitComplete(): EmitResult;
42
+ /** Attempts to fail this sink. */
43
+ tryEmitError(error: unknown): EmitResult;
44
+ /** Emits a value or delegates failure handling to the provided handler. */
45
+ emitNext(value: T, handler?: EmitFailureHandler): void;
46
+ /** Completes this sink or delegates failure handling to the provided handler. */
47
+ emitComplete(handler?: EmitFailureHandler): void;
48
+ /** Fails this sink or delegates failure handling to the provided handler. */
49
+ emitError(error: unknown, handler?: EmitFailureHandler): void;
50
+ /** Returns the current number of active subscribers. */
51
+ currentSubscriberCount(): number;
52
+ /** Subscribes this sink to an upstream publisher and relays its signals. */
53
+ subscribeTo(source: PublisherInput<T>): void;
54
+ /** Handles an emission failure and returns false to fail fast by default. */
55
+ onEmitFailure(_signalType: SignalType, _emitResult: EmitResult): boolean;
56
+ /** Adds a subscriber queue and removes it again when its subscription is cancelled. */
57
+ private addSubscriber;
58
+ /** Removes a subscriber queue and releases the set when it becomes empty. */
59
+ private removeSubscriber;
60
+ /** Clears and releases all active subscriber queues. */
61
+ private clearSubscribers;
62
+ /** Records one value into replay history, allocating history only for replay sinks. */
63
+ private rememberHistory;
64
+ }
65
+ export {};
66
+ //# sourceMappingURL=many.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"many.d.ts","sourceRoot":"","sources":["../../src/sinks/many.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AACzC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAQnD,OAAO,EAAC,KAAK,kBAAkB,EAAoC,UAAU,EAAE,KAAK,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAEtH,+DAA+D;AAC/D,KAAK,QAAQ,GAAG,SAAS,GAAG,eAAe,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,QA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,GAAE,kBAAkD,GAAG,IAAI,CAElG;IAED,wDAAwD;IACjD,sBAAsB,IAAI,MAAM,CAEtC;IAED,4EAA4E;IACrE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAMlD;IAED,6EAA6E;IACtE,aAAa,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,GAAG,OAAO,CAE9E;IAED,uFAAuF;IACvF,OAAO,CAAC,aAAa;IAKrB,6EAA6E;IAC7E,OAAO,CAAC,gBAAgB;IAIxB,wDAAwD;IACxD,OAAO,CAAC,gBAAgB;IAKxB,uFAAuF;IACvF,OAAO,CAAC,eAAe;CAkB1B"}
@@ -0,0 +1,193 @@
1
+ import _defineProperty from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ import { AsyncQueue } from "../internal/async-queue.js";
3
+ import { Flux } from "../publisher/flux.js";
4
+ import { SignalType } from "../signal/signal-type.js";
5
+ import { addSinkSubscriber, clearSinkSubscribers, removeSinkSubscriber, sinkSubscriberCount } from "./subscribers.js";
6
+ import { EmitFailureHandlers, EmitResult, emitOrThrow } from "./types.js";
7
+ //#region src/sinks/many.ts
8
+ /**
9
+ * @packageDocumentation
10
+ * Sink specifications and default browser-oriented sink implementations.
11
+ */
12
+ /** Default implementation for unicast, multicast and replay many-valued sinks. */
13
+ var DefaultManySink = class {
14
+ /** Creates a many-valued sink with the provided delivery mode. */
15
+ constructor(options) {
16
+ _defineProperty(
17
+ this,
18
+ /** Active subscriber queues currently receiving live values. */
19
+ "subscribers",
20
+ void 0
21
+ );
22
+ _defineProperty(
23
+ this,
24
+ /** Values buffered before a non-replay sink receives its first subscriber. */
25
+ "pending",
26
+ void 0
27
+ );
28
+ _defineProperty(
29
+ this,
30
+ /** Values retained for replay subscribers. */
31
+ "history",
32
+ void 0
33
+ );
34
+ _defineProperty(
35
+ this,
36
+ /** Ring-buffer index of the oldest replay value. */
37
+ "historyHead",
38
+ 0
39
+ );
40
+ _defineProperty(
41
+ this,
42
+ /** Terminal state when the sink has completed or failed. */
43
+ "terminated",
44
+ void 0
45
+ );
46
+ _defineProperty(
47
+ this,
48
+ /** Error retained for late subscribers after failure. */
49
+ "errorValue",
50
+ void 0
51
+ );
52
+ _defineProperty(
53
+ this,
54
+ /** Tracks whether a unicast sink already accepted its single subscriber. */
55
+ "unicastAttached",
56
+ false
57
+ );
58
+ _defineProperty(
59
+ this,
60
+ /** Construction options controlling delivery and replay behavior. */
61
+ "options",
62
+ void 0
63
+ );
64
+ this.options = options;
65
+ if (options.latestDefault !== void 0) this.rememberHistory(options.latestDefault);
66
+ }
67
+ /** Returns the Flux view of this sink. */
68
+ asFlux() {
69
+ return new Flux((signal) => {
70
+ const queue = new AsyncQueue(signal);
71
+ if (isUnicast(this.options.mode) && this.unicastAttached) {
72
+ queue.error(/* @__PURE__ */ new Error("Unicast sink allows only one subscriber"));
73
+ return queue;
74
+ }
75
+ if (isUnicast(this.options.mode)) this.unicastAttached = true;
76
+ const history = this.history;
77
+ if (history) for (let index = 0; index < history.length; index += 1) queue.push(historyValue(history, this.historyHead, index));
78
+ if (this.pending && this.pending.length > 0) {
79
+ const pending = this.pending;
80
+ this.pending = void 0;
81
+ for (const value of pending) queue.push(value);
82
+ }
83
+ if (this.terminated === "complete") queue.complete();
84
+ else if (this.terminated === "error") queue.error(this.errorValue);
85
+ else this.addSubscriber(queue, signal);
86
+ return queue;
87
+ });
88
+ }
89
+ /** Attempts to emit a value to current subscribers. */
90
+ tryEmitNext(value) {
91
+ if (this.terminated) return EmitResult.FAIL_TERMINATED;
92
+ if (this.options.mode === "replay") this.rememberHistory(value);
93
+ const subscribers = this.subscribers;
94
+ if (!subscribers) {
95
+ if (this.options.mode === "multicast-direct" || this.options.mode === "unicast-error") return EmitResult.FAIL_ZERO_SUBSCRIBER;
96
+ if (this.options.mode !== "replay") (this.pending ?? (this.pending = [])).push(value);
97
+ return EmitResult.OK;
98
+ }
99
+ if (subscribers instanceof Set) for (const subscriber of subscribers) subscriber.push(value);
100
+ else subscribers.push(value);
101
+ return EmitResult.OK;
102
+ }
103
+ /** Attempts to complete this sink. */
104
+ tryEmitComplete() {
105
+ if (this.terminated) return EmitResult.FAIL_TERMINATED;
106
+ const subscribers = this.subscribers;
107
+ if (this.options.mode === "unicast-error" && !subscribers) return EmitResult.FAIL_ZERO_SUBSCRIBER;
108
+ this.terminated = "complete";
109
+ if (subscribers instanceof Set) for (const subscriber of subscribers) subscriber.complete();
110
+ else if (subscribers) subscribers.complete();
111
+ this.clearSubscribers();
112
+ return EmitResult.OK;
113
+ }
114
+ /** Attempts to fail this sink. */
115
+ tryEmitError(error) {
116
+ if (this.terminated) return EmitResult.FAIL_TERMINATED;
117
+ const subscribers = this.subscribers;
118
+ if (this.options.mode === "unicast-error" && !subscribers) return EmitResult.FAIL_ZERO_SUBSCRIBER;
119
+ this.terminated = "error";
120
+ this.errorValue = error;
121
+ if (subscribers instanceof Set) for (const subscriber of subscribers) subscriber.error(error);
122
+ else if (subscribers) subscribers.error(error);
123
+ this.clearSubscribers();
124
+ return EmitResult.OK;
125
+ }
126
+ /** Emits a value or delegates failure handling to the provided handler. */
127
+ emitNext(value, handler = EmitFailureHandlers.FAIL_FAST) {
128
+ emitOrThrow(SignalType.NEXT, () => this.tryEmitNext(value), handler);
129
+ }
130
+ /** Completes this sink or delegates failure handling to the provided handler. */
131
+ emitComplete(handler = EmitFailureHandlers.FAIL_FAST) {
132
+ emitOrThrow(SignalType.COMPLETE, () => this.tryEmitComplete(), handler);
133
+ }
134
+ /** Fails this sink or delegates failure handling to the provided handler. */
135
+ emitError(error, handler = EmitFailureHandlers.FAIL_FAST) {
136
+ emitOrThrow(SignalType.ERROR, () => this.tryEmitError(error), handler, error);
137
+ }
138
+ /** Returns the current number of active subscribers. */
139
+ currentSubscriberCount() {
140
+ return sinkSubscriberCount(this.subscribers);
141
+ }
142
+ /** Subscribes this sink to an upstream publisher and relays its signals. */
143
+ subscribeTo(source) {
144
+ Flux.from(source).subscribe((value) => this.emitNext(value), (error) => this.emitError(error), () => this.emitComplete());
145
+ }
146
+ /** Handles an emission failure and returns false to fail fast by default. */
147
+ onEmitFailure(_signalType, _emitResult) {
148
+ return false;
149
+ }
150
+ /** Adds a subscriber queue and removes it again when its subscription is cancelled. */
151
+ addSubscriber(queue, signal) {
152
+ this.subscribers = addSinkSubscriber(this.subscribers, queue);
153
+ signal.addEventListener("abort", () => this.removeSubscriber(queue), { once: true });
154
+ }
155
+ /** Removes a subscriber queue and releases the set when it becomes empty. */
156
+ removeSubscriber(queue) {
157
+ this.subscribers = removeSinkSubscriber(this.subscribers, queue);
158
+ }
159
+ /** Clears and releases all active subscriber queues. */
160
+ clearSubscribers() {
161
+ clearSinkSubscribers(this.subscribers);
162
+ this.subscribers = void 0;
163
+ }
164
+ /** Records one value into replay history, allocating history only for replay sinks. */
165
+ rememberHistory(value) {
166
+ const limit = this.options.replayLimit ?? Number.POSITIVE_INFINITY;
167
+ if (limit <= 0) return;
168
+ const history = this.history;
169
+ if (!history) {
170
+ this.history = [value];
171
+ this.historyHead = 0;
172
+ return;
173
+ }
174
+ if (history.length < limit) {
175
+ history.push(value);
176
+ return;
177
+ }
178
+ history[this.historyHead] = value;
179
+ this.historyHead = (this.historyHead + 1) % history.length;
180
+ }
181
+ };
182
+ /** Returns true for sink modes that allow exactly one subscriber. */
183
+ function isUnicast(mode) {
184
+ return mode === "unicast" || mode === "unicast-error";
185
+ }
186
+ /** Returns a replay history value in oldest-to-newest order. */
187
+ function historyValue(history, head, index) {
188
+ return history[(head + index) % history.length];
189
+ }
190
+ //#endregion
191
+ export { DefaultManySink };
192
+
193
+ //# sourceMappingURL=many.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"many.js","names":[],"sources":["../../src/sinks/many.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Sink specifications and default browser-oriented sink implementations.\n */\nimport {AsyncQueue} from \"@/internal/async-queue.js\";\nimport {Flux} from \"@/publisher/flux.js\";\nimport type {PublisherInput} from \"@/publisher/types.js\";\nimport {SignalType} from \"@/signal/signal-type.js\";\nimport {\n addSinkSubscriber,\n clearSinkSubscribers,\n removeSinkSubscriber,\n sinkSubscriberCount,\n type SinkSubscribers\n} from \"@/sinks/subscribers.js\";\nimport {type EmitFailureHandler, EmitFailureHandlers, emitOrThrow, EmitResult, type ManySink} from \"@/sinks/types.js\";\n\n/** Delivery mode supported by the default many-valued sink. */\ntype ManyMode = \"unicast\" | \"unicast-error\" | \"multicast-buffer\" | \"multicast-direct\" | \"replay\";\n\n/** Configuration for a many-valued sink implementation. */\nexport interface ManyOptions<T> {\n /** Delivery mode used by the sink. */\n mode: ManyMode;\n /** Maximum number of replayed values retained in history. */\n replayLimit?: number;\n /** Initial value replayed by latest-or-default sinks. */\n latestDefault?: T;\n}\n\n/** Default implementation for unicast, multicast and replay many-valued sinks. */\nexport class DefaultManySink<T> implements ManySink<T> {\n /** Active subscriber queues currently receiving live values. */\n private subscribers: SinkSubscribers<T> | undefined;\n /** Values buffered before a non-replay sink receives its first subscriber. */\n private pending: T[] | undefined;\n /** Values retained for replay subscribers. */\n private history: T[] | undefined;\n /** Ring-buffer index of the oldest replay value. */\n private historyHead = 0;\n /** Terminal state when the sink has completed or failed. */\n private terminated: \"complete\" | \"error\" | undefined;\n /** Error retained for late subscribers after failure. */\n private errorValue: unknown;\n /** Tracks whether a unicast sink already accepted its single subscriber. */\n private unicastAttached = false;\n /** Construction options controlling delivery and replay behavior. */\n private readonly options: ManyOptions<T>;\n\n /** Creates a many-valued sink with the provided delivery mode. */\n public constructor(options: ManyOptions<T>) {\n this.options = options;\n if (options.latestDefault !== undefined) {\n this.rememberHistory(options.latestDefault);\n }\n }\n\n /** Returns the Flux view of this sink. */\n public asFlux(): Flux<T> {\n return new Flux(signal => {\n const queue = new AsyncQueue<T>(signal);\n if (isUnicast(this.options.mode) && this.unicastAttached) {\n queue.error(new Error(\"Unicast sink allows only one subscriber\"));\n return queue;\n }\n if (isUnicast(this.options.mode)) {\n this.unicastAttached = true;\n }\n const history = this.history;\n if (history) {\n for (let index = 0; index < history.length; index += 1) {\n queue.push(historyValue(history, this.historyHead, index));\n }\n }\n if (this.pending && this.pending.length > 0) {\n const pending = this.pending;\n this.pending = undefined;\n for (const value of pending) {\n queue.push(value);\n }\n }\n if (this.terminated === \"complete\") {\n queue.complete();\n } else if (this.terminated === \"error\") {\n queue.error(this.errorValue);\n } else {\n this.addSubscriber(queue, signal);\n }\n return queue;\n });\n }\n\n /** Attempts to emit a value to current subscribers. */\n public tryEmitNext(value: T): EmitResult {\n if (this.terminated) {\n return EmitResult.FAIL_TERMINATED;\n }\n if (this.options.mode === \"replay\") {\n this.rememberHistory(value);\n }\n const subscribers = this.subscribers;\n if (!subscribers) {\n if (this.options.mode === \"multicast-direct\" || this.options.mode === \"unicast-error\") {\n return EmitResult.FAIL_ZERO_SUBSCRIBER;\n }\n if (this.options.mode !== \"replay\") {\n (this.pending ??= []).push(value);\n }\n return EmitResult.OK;\n }\n if (subscribers instanceof Set) {\n for (const subscriber of subscribers) {\n subscriber.push(value);\n }\n } else {\n subscribers.push(value);\n }\n return EmitResult.OK;\n }\n\n /** Attempts to complete this sink. */\n public tryEmitComplete(): EmitResult {\n if (this.terminated) {\n return EmitResult.FAIL_TERMINATED;\n }\n const subscribers = this.subscribers;\n if (this.options.mode === \"unicast-error\" && !subscribers) {\n return EmitResult.FAIL_ZERO_SUBSCRIBER;\n }\n this.terminated = \"complete\";\n if (subscribers instanceof Set) {\n for (const subscriber of subscribers) {\n subscriber.complete();\n }\n } else if (subscribers) {\n subscribers.complete();\n }\n this.clearSubscribers();\n return EmitResult.OK;\n }\n\n /** Attempts to fail this sink. */\n public tryEmitError(error: unknown): EmitResult {\n if (this.terminated) {\n return EmitResult.FAIL_TERMINATED;\n }\n const subscribers = this.subscribers;\n if (this.options.mode === \"unicast-error\" && !subscribers) {\n return EmitResult.FAIL_ZERO_SUBSCRIBER;\n }\n this.terminated = \"error\";\n this.errorValue = error;\n if (subscribers instanceof Set) {\n for (const subscriber of subscribers) {\n subscriber.error(error);\n }\n } else if (subscribers) {\n subscribers.error(error);\n }\n this.clearSubscribers();\n return EmitResult.OK;\n }\n\n /** Emits a value or delegates failure handling to the provided handler. */\n public emitNext(value: T, handler: EmitFailureHandler = EmitFailureHandlers.FAIL_FAST): void {\n emitOrThrow(SignalType.NEXT, () => this.tryEmitNext(value), handler);\n }\n\n /** Completes this sink or delegates failure handling to the provided handler. */\n public emitComplete(handler: EmitFailureHandler = EmitFailureHandlers.FAIL_FAST): void {\n emitOrThrow(SignalType.COMPLETE, () => this.tryEmitComplete(), handler);\n }\n\n /** Fails this sink or delegates failure handling to the provided handler. */\n public emitError(error: unknown, handler: EmitFailureHandler = EmitFailureHandlers.FAIL_FAST): void {\n emitOrThrow(SignalType.ERROR, () => this.tryEmitError(error), handler, error);\n }\n\n /** Returns the current number of active subscribers. */\n public currentSubscriberCount(): number {\n return sinkSubscriberCount(this.subscribers);\n }\n\n /** Subscribes this sink to an upstream publisher and relays its signals. */\n public subscribeTo(source: PublisherInput<T>): void {\n Flux.from(source).subscribe(\n value => this.emitNext(value),\n error => this.emitError(error),\n () => this.emitComplete()\n );\n }\n\n /** Handles an emission failure and returns false to fail fast by default. */\n public onEmitFailure(_signalType: SignalType, _emitResult: EmitResult): boolean {\n return false;\n }\n\n /** Adds a subscriber queue and removes it again when its subscription is cancelled. */\n private addSubscriber(queue: AsyncQueue<T>, signal: AbortSignal): void {\n this.subscribers = addSinkSubscriber(this.subscribers, queue);\n signal.addEventListener(\"abort\", () => this.removeSubscriber(queue), {once: true});\n }\n\n /** Removes a subscriber queue and releases the set when it becomes empty. */\n private removeSubscriber(queue: AsyncQueue<T>): void {\n this.subscribers = removeSinkSubscriber(this.subscribers, queue);\n }\n\n /** Clears and releases all active subscriber queues. */\n private clearSubscribers(): void {\n clearSinkSubscribers(this.subscribers);\n this.subscribers = undefined;\n }\n\n /** Records one value into replay history, allocating history only for replay sinks. */\n private rememberHistory(value: T): void {\n const limit = this.options.replayLimit ?? Number.POSITIVE_INFINITY;\n if (limit <= 0) {\n return;\n }\n const history = this.history;\n if (!history) {\n this.history = [value];\n this.historyHead = 0;\n return;\n }\n if (history.length < limit) {\n history.push(value);\n return;\n }\n history[this.historyHead] = value;\n this.historyHead = (this.historyHead + 1) % history.length;\n }\n}\n\n/** Returns true for sink modes that allow exactly one subscriber. */\nfunction isUnicast(mode: ManyMode): boolean {\n return mode === \"unicast\" || mode === \"unicast-error\";\n}\n\n/** Returns a replay history value in oldest-to-newest order. */\nfunction historyValue<T>(history: T[], head: number, index: number): T {\n return history[(head + index) % history.length] as T;\n}\n"],"mappings":";;;;;;;;;;;;AA+BA,IAAa,kBAAb,MAAuD;;CAmBnD,YAAmB,SAAyB;;;;GAjB5C;;;;;;GAEA;;;;;;GAEA;;;;;;GAEA;GAAsB;;;;;GAEtB;;;;;;GAEA;;;;;;GAEA;GAA0B;;;;;GAE1B;;;EAII,KAAK,UAAU;EACf,IAAI,QAAQ,kBAAkB,QAC1B,KAAK,gBAAgB,QAAQ,aAAa;CAElD;;CAGA,SAAyB;EACrB,OAAO,IAAI,MAAK,WAAU;GACtB,MAAM,QAAQ,IAAI,WAAc,MAAM;GACtC,IAAI,UAAU,KAAK,QAAQ,IAAI,KAAK,KAAK,iBAAiB;IACtD,MAAM,sBAAM,IAAI,MAAM,yCAAyC,CAAC;IAChE,OAAO;GACX;GACA,IAAI,UAAU,KAAK,QAAQ,IAAI,GAC3B,KAAK,kBAAkB;GAE3B,MAAM,UAAU,KAAK;GACrB,IAAI,SACA,KAAK,IAAI,QAAQ,GAAG,QAAQ,QAAQ,QAAQ,SAAS,GACjD,MAAM,KAAK,aAAa,SAAS,KAAK,aAAa,KAAK,CAAC;GAGjE,IAAI,KAAK,WAAW,KAAK,QAAQ,SAAS,GAAG;IACzC,MAAM,UAAU,KAAK;IACrB,KAAK,UAAU;IACf,KAAK,MAAM,SAAS,SAChB,MAAM,KAAK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AAc,KAAK,QAAQ;CACxD;AACJ;;AAGA,SAAS,UAAU,MAAyB;CACxC,OAAO,SAAS,aAAa,SAAS;AAC1C;;AAGA,SAAS,aAAgB,SAAc,MAAc,OAAkB;CACnE,OAAO,SAAS,OAAO,SAAS,QAAQ;AAC5C"}
@@ -0,0 +1,41 @@
1
+ import { Mono } from "../publisher/mono.js";
2
+ import { SignalType } from "../signal/signal-type.js";
3
+ import { type EmitFailureHandler, EmitResult, type OneSink } from "./types.js";
4
+ /** Default replaying implementation for `Sinks.one()` and `Sinks.empty()`. */
5
+ export declare class DefaultOneSink<T> implements OneSink<T> {
6
+ /** Current terminal or pending state of the sink. */
7
+ private state;
8
+ /** Stored value replayed to late subscribers after successful termination. */
9
+ private value;
10
+ /** Stored error replayed to late subscribers after failed termination. */
11
+ private errorValue;
12
+ /** Active subscriber queues waiting for the terminal result, created only when needed. */
13
+ private subscribers;
14
+ /** Returns the Mono view of this sink. */
15
+ asMono(): Mono<T>;
16
+ /** Attempts to emit a value and complete this sink. */
17
+ tryEmitValue(value: T): EmitResult;
18
+ /** Attempts to complete this sink without a value. */
19
+ tryEmitEmpty(): EmitResult;
20
+ /** Attempts to fail this sink. */
21
+ tryEmitError(error: unknown): EmitResult;
22
+ /** Emits a value or delegates failure handling to the provided handler. */
23
+ emitValue(value: T, handler?: EmitFailureHandler): void;
24
+ /** Completes this sink or delegates failure handling to the provided handler. */
25
+ emitEmpty(handler?: EmitFailureHandler): void;
26
+ /** Fails this sink or delegates failure handling to the provided handler. */
27
+ emitError(error: unknown, handler?: EmitFailureHandler): void;
28
+ /** Returns the current number of active subscribers. */
29
+ currentSubscriberCount(): number;
30
+ /** Handles an emission failure and returns false to fail fast by default. */
31
+ onEmitFailure(_signalType: SignalType, _emitResult: EmitResult): boolean;
32
+ /** Adds a subscriber queue and removes it again when its subscription is cancelled. */
33
+ private addSubscriber;
34
+ /** Removes a subscriber queue and releases the set when it becomes empty. */
35
+ private removeSubscriber;
36
+ /** Clears and releases all active subscriber queues. */
37
+ private clearSubscribers;
38
+ /** Replays the current state into a newly subscribed queue. */
39
+ private replay;
40
+ }
41
+ //# sourceMappingURL=one.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../../src/sinks/one.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAQnD,OAAO,EAAC,KAAK,kBAAkB,EAAoC,UAAU,EAAE,KAAK,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAKrH,8EAA8E;AAC9E,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IAChD,qDAAqD;IACrD,OAAO,CAAC,KAAK,CAAuB;IACpC,8EAA8E;IAC9E,OAAO,CAAC,KAAK,CAAgB;IAC7B,0EAA0E;IAC1E,OAAO,CAAC,UAAU,CAAU;IAC5B,0FAA0F;IAC1F,OAAO,CAAC,WAAW,CAAiC;IAEpD,0CAA0C;IACnC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CASvB;IAED,uDAAuD;IAChD,YAAY,CAAC,KAAK,EAAE,CAAC,GAAG,UAAU,CAkBxC;IAED,sDAAsD;IAC/C,YAAY,IAAI,UAAU,CAehC;IAED,kCAAkC;IAC3B,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAgB9C;IAED,2EAA2E;IACpE,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,GAAE,kBAAkD,GAAG,IAAI,CAK5F;IAED,iFAAiF;IAC1E,SAAS,CAAC,OAAO,GAAE,kBAAkD,GAAG,IAAI,CAKlF;IAED,6EAA6E;IACtE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,kBAAkD,GAAG,IAAI,CAKlG;IAED,wDAAwD;IACjD,sBAAsB,IAAI,MAAM,CAEtC;IAED,6EAA6E;IACt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