reactor-core-ts 2.1.6 → 3.2.2

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 (272) 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 +767 -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 +263 -0
  124. package/dist/publisher/operators/lifecycle.js.map +1 -0
  125. package/dist/publisher/operators/lift.d.ts +42 -0
  126. package/dist/publisher/operators/lift.d.ts.map +1 -0
  127. package/dist/publisher/operators/lift.js +343 -0
  128. package/dist/publisher/operators/lift.js.map +1 -0
  129. package/dist/publisher/operators/mono-parity.d.ts +109 -0
  130. package/dist/publisher/operators/mono-parity.d.ts.map +1 -0
  131. package/dist/publisher/operators/mono-parity.js +144 -0
  132. package/dist/publisher/operators/mono-parity.js.map +1 -0
  133. package/dist/publisher/operators/mono.d.ts +30 -0
  134. package/dist/publisher/operators/mono.d.ts.map +1 -0
  135. package/dist/publisher/operators/mono.js +37 -0
  136. package/dist/publisher/operators/mono.js.map +1 -0
  137. package/dist/publisher/operators/register.d.ts +20 -0
  138. package/dist/publisher/operators/register.d.ts.map +1 -0
  139. package/dist/publisher/operators/register.js +23 -0
  140. package/dist/publisher/operators/register.js.map +1 -0
  141. package/dist/publisher/operators/selection.d.ts +25 -0
  142. package/dist/publisher/operators/selection.d.ts.map +1 -0
  143. package/dist/publisher/operators/selection.js +108 -0
  144. package/dist/publisher/operators/selection.js.map +1 -0
  145. package/dist/publisher/operators/side-effect.d.ts +15 -0
  146. package/dist/publisher/operators/side-effect.d.ts.map +1 -0
  147. package/dist/publisher/operators/side-effect.js +81 -0
  148. package/dist/publisher/operators/side-effect.js.map +1 -0
  149. package/dist/publisher/operators/terminal.d.ts +16 -0
  150. package/dist/publisher/operators/terminal.d.ts.map +1 -0
  151. package/dist/publisher/operators/terminal.js +47 -0
  152. package/dist/publisher/operators/terminal.js.map +1 -0
  153. package/dist/publisher/operators/time.d.ts +20 -0
  154. package/dist/publisher/operators/time.d.ts.map +1 -0
  155. package/dist/publisher/operators/time.js +92 -0
  156. package/dist/publisher/operators/time.js.map +1 -0
  157. package/dist/publisher/operators/transform.d.ts +31 -0
  158. package/dist/publisher/operators/transform.d.ts.map +1 -0
  159. package/dist/publisher/operators/transform.js +75 -0
  160. package/dist/publisher/operators/transform.js.map +1 -0
  161. package/dist/publisher/operators/windowing.d.ts +28 -0
  162. package/dist/publisher/operators/windowing.d.ts.map +1 -0
  163. package/dist/publisher/operators/windowing.js +148 -0
  164. package/dist/publisher/operators/windowing.js.map +1 -0
  165. package/dist/publisher/publisher.d.ts +11 -0
  166. package/dist/publisher/publisher.d.ts.map +1 -0
  167. package/dist/publisher/types.d.ts +51 -0
  168. package/dist/publisher/types.d.ts.map +1 -0
  169. package/dist/schedulers/animation-frame-scheduler.d.ts +11 -0
  170. package/dist/schedulers/animation-frame-scheduler.d.ts.map +1 -0
  171. package/dist/schedulers/animation-frame-scheduler.js +30 -0
  172. package/dist/schedulers/animation-frame-scheduler.js.map +1 -0
  173. package/dist/schedulers/base-scheduler.d.ts +28 -0
  174. package/dist/schedulers/base-scheduler.d.ts.map +1 -0
  175. package/dist/schedulers/base-scheduler.js +77 -0
  176. package/dist/schedulers/base-scheduler.js.map +1 -0
  177. package/dist/schedulers/basic-worker.d.ts +22 -0
  178. package/dist/schedulers/basic-worker.d.ts.map +1 -0
  179. package/dist/schedulers/basic-worker.js +71 -0
  180. package/dist/schedulers/basic-worker.js.map +1 -0
  181. package/dist/schedulers/delay-scheduler.d.ts +12 -0
  182. package/dist/schedulers/delay-scheduler.d.ts.map +1 -0
  183. package/dist/schedulers/delay-scheduler.js +17 -0
  184. package/dist/schedulers/delay-scheduler.js.map +1 -0
  185. package/dist/schedulers/disposed.d.ts +4 -0
  186. package/dist/schedulers/disposed.d.ts.map +1 -0
  187. package/dist/schedulers/disposed.js +14 -0
  188. package/dist/schedulers/disposed.js.map +1 -0
  189. package/dist/schedulers/duration.d.ts +8 -0
  190. package/dist/schedulers/duration.d.ts.map +1 -0
  191. package/dist/schedulers/duration.js +11 -0
  192. package/dist/schedulers/duration.js.map +1 -0
  193. package/dist/schedulers/executor-scheduler.d.ts +13 -0
  194. package/dist/schedulers/executor-scheduler.d.ts.map +1 -0
  195. package/dist/schedulers/executor-scheduler.js +43 -0
  196. package/dist/schedulers/executor-scheduler.js.map +1 -0
  197. package/dist/schedulers/immediate-scheduler.d.ts +15 -0
  198. package/dist/schedulers/immediate-scheduler.d.ts.map +1 -0
  199. package/dist/schedulers/immediate-scheduler.js +24 -0
  200. package/dist/schedulers/immediate-scheduler.js.map +1 -0
  201. package/dist/schedulers/index.d.ts +7 -0
  202. package/dist/schedulers/index.d.ts.map +1 -0
  203. package/dist/schedulers/index.js +2 -0
  204. package/dist/schedulers/interval-scheduler.d.ts +12 -0
  205. package/dist/schedulers/interval-scheduler.d.ts.map +1 -0
  206. package/dist/schedulers/interval-scheduler.js +17 -0
  207. package/dist/schedulers/interval-scheduler.js.map +1 -0
  208. package/dist/schedulers/macro-scheduler.d.ts +19 -0
  209. package/dist/schedulers/macro-scheduler.d.ts.map +1 -0
  210. package/dist/schedulers/macro-scheduler.js +30 -0
  211. package/dist/schedulers/macro-scheduler.js.map +1 -0
  212. package/dist/schedulers/microtask-scheduler.d.ts +11 -0
  213. package/dist/schedulers/microtask-scheduler.d.ts.map +1 -0
  214. package/dist/schedulers/microtask-scheduler.js +34 -0
  215. package/dist/schedulers/microtask-scheduler.js.map +1 -0
  216. package/dist/schedulers/schedulers.d.ts +39 -0
  217. package/dist/schedulers/schedulers.d.ts.map +1 -0
  218. package/dist/schedulers/schedulers.js +83 -0
  219. package/dist/schedulers/schedulers.js.map +1 -0
  220. package/dist/schedulers/timeout-scheduler.d.ts +11 -0
  221. package/dist/schedulers/timeout-scheduler.d.ts.map +1 -0
  222. package/dist/schedulers/types.d.ts +35 -0
  223. package/dist/schedulers/types.d.ts.map +1 -0
  224. package/dist/signal/signal-type.d.ts +26 -0
  225. package/dist/signal/signal-type.d.ts.map +1 -0
  226. package/dist/signal/signal-type.js +31 -0
  227. package/dist/signal/signal-type.js.map +1 -0
  228. package/dist/signal/signal.d.ts +33 -0
  229. package/dist/signal/signal.d.ts.map +1 -0
  230. package/dist/signal/signal.js +70 -0
  231. package/dist/signal/signal.js.map +1 -0
  232. package/dist/sinks/index.d.ts +7 -0
  233. package/dist/sinks/index.d.ts.map +1 -0
  234. package/dist/sinks/index.js +2 -0
  235. package/dist/sinks/many.d.ts +66 -0
  236. package/dist/sinks/many.d.ts.map +1 -0
  237. package/dist/sinks/many.js +193 -0
  238. package/dist/sinks/many.js.map +1 -0
  239. package/dist/sinks/one.d.ts +41 -0
  240. package/dist/sinks/one.d.ts.map +1 -0
  241. package/dist/sinks/one.js +144 -0
  242. package/dist/sinks/one.js.map +1 -0
  243. package/dist/sinks/specs.d.ts +25 -0
  244. package/dist/sinks/specs.d.ts.map +1 -0
  245. package/dist/sinks/specs.js +126 -0
  246. package/dist/sinks/specs.js.map +1 -0
  247. package/dist/sinks/subscribers.d.ts +16 -0
  248. package/dist/sinks/subscribers.d.ts.map +1 -0
  249. package/dist/sinks/subscribers.js +32 -0
  250. package/dist/sinks/subscribers.js.map +1 -0
  251. package/dist/sinks/types.d.ts +137 -0
  252. package/dist/sinks/types.d.ts.map +1 -0
  253. package/dist/sinks/types.js +58 -0
  254. package/dist/sinks/types.js.map +1 -0
  255. package/dist/subscription/core-subscriber.d.ts +12 -0
  256. package/dist/subscription/core-subscriber.d.ts.map +1 -0
  257. package/dist/subscription/iterable-subscription.d.ts +64 -0
  258. package/dist/subscription/iterable-subscription.d.ts.map +1 -0
  259. package/dist/subscription/iterable-subscription.js +281 -0
  260. package/dist/subscription/iterable-subscription.js.map +1 -0
  261. package/dist/subscription/reactive-streams.d.ts +8 -0
  262. package/dist/subscription/reactive-streams.d.ts.map +1 -0
  263. package/dist/subscription/reactive-streams.js +0 -0
  264. package/dist/subscription/subscriber.d.ts +17 -0
  265. package/dist/subscription/subscriber.d.ts.map +1 -0
  266. package/dist/subscription/subscription.d.ts +12 -0
  267. package/dist/subscription/subscription.d.ts.map +1 -0
  268. package/package.json +100 -33
  269. package/dist/index.d.mts +0 -2557
  270. package/dist/index.js.map +0 -1
  271. package/dist/index.mjs +0 -2
  272. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,343 @@
1
+ import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js";
2
+ import { Context } from "../../context/context.js";
3
+ import { addCap } from "../../core/demand.js";
4
+ import { Flux } from "../flux.js";
5
+ //#region src/publisher/operators/lift.ts
6
+ /**
7
+ * @packageDocumentation
8
+ * Internal subscriber-lifting primitives for demand-preserving Flux operators.
9
+ */
10
+ /**
11
+ * Lifts a Flux at the Reactive Streams subscriber boundary while keeping an
12
+ * iterable implementation for explicit async-iterator consumption.
13
+ */
14
+ function liftFlux(source, sourceFactory, lifter) {
15
+ return new LiftedFlux(source, sourceFactory, lifter);
16
+ }
17
+ /** Creates a one-to-one operator that forwards downstream demand unchanged. */
18
+ function liftOneToOne(source, sourceFactory, hooksFactory) {
19
+ return liftFlux(source, sourceFactory, (subscriber) => new OneToOneOperatorSubscriber(subscriber, hooksFactory(subscriber)));
20
+ }
21
+ /** Creates a filtering operator that replenishes only values dropped from finite demand. */
22
+ function liftFilter(source, sourceFactory, predicate) {
23
+ return liftFlux(source, sourceFactory, (subscriber) => new FilterOperatorSubscriber(subscriber, predicate));
24
+ }
25
+ /** Returns the context exposed by a subscriber, or the shared empty context. */
26
+ function subscriberContext(subscriber) {
27
+ return subscriber.currentContext?.() ?? Context.empty();
28
+ }
29
+ /** Flux whose normal subscribe path is assembled through a subscriber lifter. */
30
+ var LiftedFlux = class extends Flux {
31
+ /** Creates a lifted Flux around an upstream source. */
32
+ constructor(source, sourceFactory, lifter) {
33
+ super(sourceFactory);
34
+ _defineProperty(this, "source", void 0);
35
+ _defineProperty(this, "lifter", void 0);
36
+ this.source = source;
37
+ this.lifter = lifter;
38
+ }
39
+ /** Subscribes without crossing the async-iterator bridge. */
40
+ subscribeActual(subscriber) {
41
+ let upstreamSubscriber;
42
+ try {
43
+ upstreamSubscriber = this.lifter(subscriber);
44
+ } catch (error) {
45
+ signalAssemblyError(subscriber, error);
46
+ return;
47
+ }
48
+ this.source.subscribe(upstreamSubscriber);
49
+ }
50
+ };
51
+ /** Subscription/subscriber pair shared by synchronous one-to-one operators. */
52
+ var OneToOneOperatorSubscriber = class {
53
+ /** Creates a one-to-one operator subscriber. */
54
+ constructor(actual, hooks) {
55
+ _defineProperty(this, "actual", void 0);
56
+ _defineProperty(this, "hooks", void 0);
57
+ _defineProperty(
58
+ this,
59
+ /** Upstream subscription received during the Reactive Streams handshake. */
60
+ "upstream",
61
+ void 0
62
+ );
63
+ _defineProperty(
64
+ this,
65
+ /** Prevents duplicate subscriptions from replacing the active upstream. */
66
+ "subscribed",
67
+ false
68
+ );
69
+ _defineProperty(
70
+ this,
71
+ /** Suppresses signals and demand after cancellation or termination. */
72
+ "terminated",
73
+ false
74
+ );
75
+ this.actual = actual;
76
+ this.hooks = hooks;
77
+ }
78
+ /** Installs the upstream subscription and exposes this forwarding subscription downstream. */
79
+ onSubscribe(subscription) {
80
+ if (this.subscribed || this.terminated) {
81
+ subscription.cancel();
82
+ return;
83
+ }
84
+ this.subscribed = true;
85
+ this.upstream = subscription;
86
+ try {
87
+ this.hooks.onSubscribe?.(subscription);
88
+ } catch (error) {
89
+ this.terminated = true;
90
+ cancelSilently(subscription);
91
+ this.actual.onSubscribe(this);
92
+ this.signalError(error);
93
+ return;
94
+ }
95
+ try {
96
+ this.actual.onSubscribe(this);
97
+ } catch (error) {
98
+ this.terminated = true;
99
+ try {
100
+ subscription.cancel();
101
+ } finally {
102
+ this.runFinally("cancel");
103
+ }
104
+ throw error;
105
+ }
106
+ }
107
+ /** Converts and forwards one upstream value without changing demand. */
108
+ onNext(value) {
109
+ if (this.terminated) return;
110
+ let mapped;
111
+ try {
112
+ mapped = this.hooks.onNext(value);
113
+ } catch (error) {
114
+ this.terminateWithError(error, true);
115
+ return;
116
+ }
117
+ this.actual.onNext(mapped);
118
+ }
119
+ /** Forwards an upstream error after running the operator callback. */
120
+ onError(error) {
121
+ this.terminateWithError(error, false);
122
+ }
123
+ /** Forwards successful completion after running the operator callback. */
124
+ onComplete() {
125
+ if (this.terminated) return;
126
+ try {
127
+ this.hooks.onComplete?.();
128
+ } catch (error) {
129
+ this.terminateWithError(error, false);
130
+ return;
131
+ }
132
+ this.terminated = true;
133
+ try {
134
+ this.actual.onComplete();
135
+ } finally {
136
+ this.runFinally("complete");
137
+ }
138
+ }
139
+ /** Forwards exactly the requested amount to upstream. */
140
+ request(n) {
141
+ if (this.terminated) return;
142
+ try {
143
+ this.hooks.onRequest?.(n);
144
+ } catch (error) {
145
+ this.terminateWithError(error, true);
146
+ return;
147
+ }
148
+ this.upstream?.request(n);
149
+ }
150
+ /** Cancels upstream once and reports the cancellation lifecycle hooks. */
151
+ cancel() {
152
+ if (this.terminated) return;
153
+ this.terminated = true;
154
+ try {
155
+ this.upstream?.cancel();
156
+ } finally {
157
+ try {
158
+ this.hooks.onCancel?.();
159
+ } finally {
160
+ this.runFinally("cancel");
161
+ }
162
+ }
163
+ }
164
+ /** Exposes downstream context to context-aware upstream publishers. */
165
+ currentContext() {
166
+ return this.hooks.currentContext?.() ?? subscriberContext(this.actual);
167
+ }
168
+ /** Cancels when needed and emits one downstream error signal. */
169
+ terminateWithError(error, cancelUpstream) {
170
+ if (this.terminated) return;
171
+ this.terminated = true;
172
+ if (cancelUpstream && this.upstream) cancelSilently(this.upstream);
173
+ let failure = error;
174
+ try {
175
+ this.hooks.onError?.(error);
176
+ } catch (callbackError) {
177
+ failure = callbackError;
178
+ }
179
+ this.signalError(failure);
180
+ }
181
+ /** Delivers an error followed by the final error callback. */
182
+ signalError(error) {
183
+ try {
184
+ this.actual.onError(error);
185
+ } finally {
186
+ this.runFinally("error");
187
+ }
188
+ }
189
+ /** Runs a final callback without letting observer code alter terminal semantics. */
190
+ runFinally(signal) {
191
+ try {
192
+ this.hooks.onFinally?.(signal);
193
+ } catch {}
194
+ }
195
+ };
196
+ /** Filtering subscriber with stack-safe compensation for dropped values. */
197
+ var FilterOperatorSubscriber = class {
198
+ /** Creates a filtering subscriber. */
199
+ constructor(actual, predicate) {
200
+ _defineProperty(this, "actual", void 0);
201
+ _defineProperty(this, "predicate", void 0);
202
+ _defineProperty(
203
+ this,
204
+ /** Upstream subscription received during the Reactive Streams handshake. */
205
+ "upstream",
206
+ void 0
207
+ );
208
+ _defineProperty(
209
+ this,
210
+ /** Prevents duplicate subscriptions from replacing the active upstream. */
211
+ "subscribed",
212
+ false
213
+ );
214
+ _defineProperty(
215
+ this,
216
+ /** Suppresses signals and demand after cancellation or termination. */
217
+ "terminated",
218
+ false
219
+ );
220
+ _defineProperty(
221
+ this,
222
+ /** Avoids compensation requests after downstream switches to unbounded demand. */
223
+ "unbounded",
224
+ false
225
+ );
226
+ _defineProperty(
227
+ this,
228
+ /** Guards synchronous request calls against reentrant compensation. */
229
+ "requesting",
230
+ false
231
+ );
232
+ _defineProperty(
233
+ this,
234
+ /** Compensation or downstream demand accumulated during an active request call. */
235
+ "missedRequested",
236
+ 0
237
+ );
238
+ this.actual = actual;
239
+ this.predicate = predicate;
240
+ }
241
+ /** Installs upstream and exposes the demand-forwarding subscription downstream. */
242
+ onSubscribe(subscription) {
243
+ if (this.subscribed || this.terminated) {
244
+ subscription.cancel();
245
+ return;
246
+ }
247
+ this.subscribed = true;
248
+ this.upstream = subscription;
249
+ try {
250
+ this.actual.onSubscribe(this);
251
+ } catch (error) {
252
+ this.terminated = true;
253
+ subscription.cancel();
254
+ throw error;
255
+ }
256
+ }
257
+ /** Tests one value, forwarding matches and replenishing finite demand for drops. */
258
+ onNext(value) {
259
+ if (this.terminated) return;
260
+ let accepted;
261
+ try {
262
+ accepted = this.predicate(value);
263
+ } catch (error) {
264
+ this.terminated = true;
265
+ if (this.upstream) cancelSilently(this.upstream);
266
+ this.actual.onError(error);
267
+ return;
268
+ }
269
+ if (accepted) this.actual.onNext(value);
270
+ else if (!this.unbounded) this.requestUpstream(1);
271
+ }
272
+ /** Forwards one terminal error. */
273
+ onError(error) {
274
+ if (this.terminated) return;
275
+ this.terminated = true;
276
+ this.actual.onError(error);
277
+ }
278
+ /** Forwards successful completion once. */
279
+ onComplete() {
280
+ if (this.terminated) return;
281
+ this.terminated = true;
282
+ this.actual.onComplete();
283
+ }
284
+ /** Forwards demand and records when no further compensation is necessary. */
285
+ request(n) {
286
+ if (this.terminated) return;
287
+ if (n === Number.POSITIVE_INFINITY) this.unbounded = true;
288
+ this.requestUpstream(n);
289
+ }
290
+ /** Cancels the upstream once. */
291
+ cancel() {
292
+ if (this.terminated) return;
293
+ this.terminated = true;
294
+ this.upstream?.cancel();
295
+ }
296
+ /** Exposes the downstream context unchanged. */
297
+ currentContext() {
298
+ return subscriberContext(this.actual);
299
+ }
300
+ /** Drains demand iteratively so synchronous sources cannot recurse through dropped values. */
301
+ requestUpstream(n) {
302
+ if (this.requesting) {
303
+ this.missedRequested = addCap(this.missedRequested, n);
304
+ return;
305
+ }
306
+ const upstream = this.upstream;
307
+ if (!upstream) return;
308
+ this.requesting = true;
309
+ let request = n;
310
+ try {
311
+ while (!this.terminated) {
312
+ upstream.request(request);
313
+ if (this.terminated || this.missedRequested === 0) return;
314
+ request = this.missedRequested;
315
+ this.missedRequested = 0;
316
+ }
317
+ } finally {
318
+ this.requesting = false;
319
+ }
320
+ }
321
+ };
322
+ /** Signals a lifter assembly failure through a valid Reactive Streams handshake. */
323
+ function signalAssemblyError(subscriber, error) {
324
+ subscriber.onSubscribe(EMPTY_SUBSCRIPTION);
325
+ subscriber.onError(error);
326
+ }
327
+ /** Cancels an upstream while preserving the original operator failure. */
328
+ function cancelSilently(subscription) {
329
+ try {
330
+ subscription.cancel();
331
+ } catch {}
332
+ }
333
+ /** Shared inert subscription used only when operator assembly fails. */
334
+ var EMPTY_SUBSCRIPTION = Object.freeze({
335
+ /** Ignores requests because the sequence has already failed. */
336
+ request() {},
337
+ /** Ignores cancellation because no upstream was subscribed. */
338
+ cancel() {}
339
+ });
340
+ //#endregion
341
+ export { liftFilter, liftFlux, liftOneToOne, subscriberContext };
342
+
343
+ //# sourceMappingURL=lift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lift.js","names":[],"sources":["../../../src/publisher/operators/lift.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Internal subscriber-lifting primitives for demand-preserving Flux operators.\n */\nimport {Context} from \"@/context/context.js\";\nimport {addCap} from \"@/core/demand.js\";\nimport type {SourceFactory} from \"@/publisher/types.js\";\nimport {Flux} from \"@/publisher/flux.js\";\nimport type {CoreSubscriber} from \"@/subscription/core-subscriber.js\";\nimport type {Subscriber} from \"@/subscription/subscriber.js\";\nimport type {Subscription} from \"@/subscription/subscription.js\";\n\n/** Creates the subscriber that an upstream Flux sees for a downstream subscriber. */\nexport type SubscriberLifter<T, R> = (subscriber: Subscriber<R>) => Subscriber<T>;\n\n/** Hooks used by synchronous one-input/one-output operators. */\nexport interface OneToOneOperatorHooks<T, R> {\n /** Converts one upstream value into exactly one downstream value. */\n onNext(value: T): R;\n\n /** Runs before the downstream receives its subscription. */\n onSubscribe?(subscription: Subscription): void;\n\n /** Runs before an upstream error is forwarded. */\n onError?(error: unknown): void;\n\n /** Runs before downstream demand is forwarded upstream. */\n onRequest?(request: number): void;\n\n /** Runs before successful completion is forwarded. */\n onComplete?(): void;\n\n /** Runs when downstream cancellation is propagated upstream. */\n onCancel?(): void;\n\n /** Runs after the terminal signal or cancellation has been propagated. */\n onFinally?(signal: \"complete\" | \"error\" | \"cancel\"): void;\n\n /** Context exposed to the upstream subscriber. */\n currentContext?(): Context;\n}\n\n/**\n * Lifts a Flux at the Reactive Streams subscriber boundary while keeping an\n * iterable implementation for explicit async-iterator consumption.\n */\nexport function liftFlux<T, R>(\n source: Flux<T>,\n sourceFactory: SourceFactory<R>,\n lifter: SubscriberLifter<T, R>\n): Flux<R> {\n return new LiftedFlux(source, sourceFactory, lifter);\n}\n\n/** Creates a one-to-one operator that forwards downstream demand unchanged. */\nexport function liftOneToOne<T, R>(\n source: Flux<T>,\n sourceFactory: SourceFactory<R>,\n hooksFactory: (subscriber: Subscriber<R>) => OneToOneOperatorHooks<T, R>\n): Flux<R> {\n return liftFlux(source, sourceFactory, subscriber =>\n new OneToOneOperatorSubscriber(subscriber, hooksFactory(subscriber))\n );\n}\n\n/** Creates a filtering operator that replenishes only values dropped from finite demand. */\nexport function liftFilter<T>(\n source: Flux<T>,\n sourceFactory: SourceFactory<T>,\n predicate: (value: T) => boolean\n): Flux<T> {\n return liftFlux(source, sourceFactory, subscriber => new FilterOperatorSubscriber(subscriber, predicate));\n}\n\n/** Returns the context exposed by a subscriber, or the shared empty context. */\nexport function subscriberContext<T>(subscriber: Subscriber<T>): Context {\n return (subscriber as CoreSubscriber<T>).currentContext?.() ?? Context.empty();\n}\n\n/** Flux whose normal subscribe path is assembled through a subscriber lifter. */\nclass LiftedFlux<T, R> extends Flux<R> {\n /** Creates a lifted Flux around an upstream source. */\n public constructor(\n private readonly source: Flux<T>,\n sourceFactory: SourceFactory<R>,\n private readonly lifter: SubscriberLifter<T, R>\n ) {\n super(sourceFactory);\n }\n\n /** Subscribes without crossing the async-iterator bridge. */\n protected override subscribeActual(subscriber: Subscriber<R>): void {\n let upstreamSubscriber: Subscriber<T>;\n try {\n upstreamSubscriber = this.lifter(subscriber);\n } catch (error) {\n signalAssemblyError(subscriber, error);\n return;\n }\n this.source.subscribe(upstreamSubscriber);\n }\n}\n\n/** Subscription/subscriber pair shared by synchronous one-to-one operators. */\nclass OneToOneOperatorSubscriber<T, R> implements CoreSubscriber<T>, Subscription {\n /** Upstream subscription received during the Reactive Streams handshake. */\n private upstream: Subscription | undefined;\n /** Prevents duplicate subscriptions from replacing the active upstream. */\n private subscribed = false;\n /** Suppresses signals and demand after cancellation or termination. */\n private terminated = false;\n\n /** Creates a one-to-one operator subscriber. */\n public constructor(\n private readonly actual: Subscriber<R>,\n private readonly hooks: OneToOneOperatorHooks<T, R>\n ) {\n }\n\n /** Installs the upstream subscription and exposes this forwarding subscription downstream. */\n public onSubscribe(subscription: Subscription): void {\n if (this.subscribed || this.terminated) {\n subscription.cancel();\n return;\n }\n this.subscribed = true;\n this.upstream = subscription;\n\n try {\n this.hooks.onSubscribe?.(subscription);\n } catch (error) {\n this.terminated = true;\n cancelSilently(subscription);\n this.actual.onSubscribe(this);\n this.signalError(error);\n return;\n }\n\n try {\n this.actual.onSubscribe(this);\n } catch (error) {\n this.terminated = true;\n try {\n subscription.cancel();\n } finally {\n this.runFinally(\"cancel\");\n }\n throw error;\n }\n }\n\n /** Converts and forwards one upstream value without changing demand. */\n public onNext(value: T): void {\n if (this.terminated) {\n return;\n }\n let mapped: R;\n try {\n mapped = this.hooks.onNext(value);\n } catch (error) {\n this.terminateWithError(error, true);\n return;\n }\n this.actual.onNext(mapped);\n }\n\n /** Forwards an upstream error after running the operator callback. */\n public onError(error: unknown): void {\n this.terminateWithError(error, false);\n }\n\n /** Forwards successful completion after running the operator callback. */\n public onComplete(): void {\n if (this.terminated) {\n return;\n }\n try {\n this.hooks.onComplete?.();\n } catch (error) {\n this.terminateWithError(error, false);\n return;\n }\n this.terminated = true;\n try {\n this.actual.onComplete();\n } finally {\n this.runFinally(\"complete\");\n }\n }\n\n /** Forwards exactly the requested amount to upstream. */\n public request(n: number): void {\n if (this.terminated) {\n return;\n }\n try {\n this.hooks.onRequest?.(n);\n } catch (error) {\n this.terminateWithError(error, true);\n return;\n }\n this.upstream?.request(n);\n }\n\n /** Cancels upstream once and reports the cancellation lifecycle hooks. */\n public cancel(): void {\n if (this.terminated) {\n return;\n }\n this.terminated = true;\n try {\n this.upstream?.cancel();\n } finally {\n try {\n this.hooks.onCancel?.();\n } finally {\n this.runFinally(\"cancel\");\n }\n }\n }\n\n /** Exposes downstream context to context-aware upstream publishers. */\n public currentContext(): Context {\n return this.hooks.currentContext?.() ?? subscriberContext(this.actual);\n }\n\n /** Cancels when needed and emits one downstream error signal. */\n private terminateWithError(error: unknown, cancelUpstream: boolean): void {\n if (this.terminated) {\n return;\n }\n this.terminated = true;\n if (cancelUpstream && this.upstream) {\n cancelSilently(this.upstream);\n }\n let failure = error;\n try {\n this.hooks.onError?.(error);\n } catch (callbackError) {\n failure = callbackError;\n }\n this.signalError(failure);\n }\n\n /** Delivers an error followed by the final error callback. */\n private signalError(error: unknown): void {\n try {\n this.actual.onError(error);\n } finally {\n this.runFinally(\"error\");\n }\n }\n\n /** Runs a final callback without letting observer code alter terminal semantics. */\n private runFinally(signal: \"complete\" | \"error\" | \"cancel\"): void {\n try {\n this.hooks.onFinally?.(signal);\n } catch {\n // Final observers run after propagation and cannot replace the terminal signal.\n }\n }\n}\n\n/** Filtering subscriber with stack-safe compensation for dropped values. */\nclass FilterOperatorSubscriber<T> implements CoreSubscriber<T>, Subscription {\n /** Upstream subscription received during the Reactive Streams handshake. */\n private upstream: Subscription | undefined;\n /** Prevents duplicate subscriptions from replacing the active upstream. */\n private subscribed = false;\n /** Suppresses signals and demand after cancellation or termination. */\n private terminated = false;\n /** Avoids compensation requests after downstream switches to unbounded demand. */\n private unbounded = false;\n /** Guards synchronous request calls against reentrant compensation. */\n private requesting = false;\n /** Compensation or downstream demand accumulated during an active request call. */\n private missedRequested = 0;\n\n /** Creates a filtering subscriber. */\n public constructor(\n private readonly actual: Subscriber<T>,\n private readonly predicate: (value: T) => boolean\n ) {\n }\n\n /** Installs upstream and exposes the demand-forwarding subscription downstream. */\n public onSubscribe(subscription: Subscription): void {\n if (this.subscribed || this.terminated) {\n subscription.cancel();\n return;\n }\n this.subscribed = true;\n this.upstream = subscription;\n try {\n this.actual.onSubscribe(this);\n } catch (error) {\n this.terminated = true;\n subscription.cancel();\n throw error;\n }\n }\n\n /** Tests one value, forwarding matches and replenishing finite demand for drops. */\n public onNext(value: T): void {\n if (this.terminated) {\n return;\n }\n let accepted: boolean;\n try {\n accepted = this.predicate(value);\n } catch (error) {\n this.terminated = true;\n if (this.upstream) {\n cancelSilently(this.upstream);\n }\n this.actual.onError(error);\n return;\n }\n if (accepted) {\n this.actual.onNext(value);\n } else if (!this.unbounded) {\n this.requestUpstream(1);\n }\n }\n\n /** Forwards one terminal error. */\n public onError(error: unknown): void {\n if (this.terminated) {\n return;\n }\n this.terminated = true;\n this.actual.onError(error);\n }\n\n /** Forwards successful completion once. */\n public onComplete(): void {\n if (this.terminated) {\n return;\n }\n this.terminated = true;\n this.actual.onComplete();\n }\n\n /** Forwards demand and records when no further compensation is necessary. */\n public request(n: number): void {\n if (this.terminated) {\n return;\n }\n if (n === Number.POSITIVE_INFINITY) {\n this.unbounded = true;\n }\n this.requestUpstream(n);\n }\n\n /** Cancels the upstream once. */\n public cancel(): void {\n if (this.terminated) {\n return;\n }\n this.terminated = true;\n this.upstream?.cancel();\n }\n\n /** Exposes the downstream context unchanged. */\n public currentContext(): Context {\n return subscriberContext(this.actual);\n }\n\n /** Drains demand iteratively so synchronous sources cannot recurse through dropped values. */\n private requestUpstream(n: number): void {\n if (this.requesting) {\n this.missedRequested = addCap(this.missedRequested, n);\n return;\n }\n const upstream = this.upstream;\n if (!upstream) {\n return;\n }\n this.requesting = true;\n let request = n;\n try {\n while (!this.terminated) {\n upstream.request(request);\n if (this.terminated || this.missedRequested === 0) {\n return;\n }\n request = this.missedRequested;\n this.missedRequested = 0;\n }\n } finally {\n this.requesting = false;\n }\n }\n}\n\n/** Signals a lifter assembly failure through a valid Reactive Streams handshake. */\nfunction signalAssemblyError<T>(subscriber: Subscriber<T>, error: unknown): void {\n subscriber.onSubscribe(EMPTY_SUBSCRIPTION);\n subscriber.onError(error);\n}\n\n/** Cancels an upstream while preserving the original operator failure. */\nfunction cancelSilently(subscription: Subscription): void {\n try {\n subscription.cancel();\n } catch {\n // The operator failure remains the terminal signal.\n }\n}\n\n/** Shared inert subscription used only when operator assembly fails. */\nconst EMPTY_SUBSCRIPTION: Subscription = Object.freeze({\n /** Ignores requests because the sequence has already failed. */\n request() {\n // no-op\n },\n /** Ignores cancellation because no upstream was subscribed. */\n cancel() {\n // no-op\n }\n});\n"],"mappings":";;;;;;;;;;;;;AA8CA,SAAgB,SACZ,QACA,eACA,QACO;CACP,OAAO,IAAI,WAAW,QAAQ,eAAe,MAAM;AACvD;;AAGA,SAAgB,aACZ,QACA,eACA,cACO;CACP,OAAO,SAAS,QAAQ,gBAAe,eACnC,IAAI,2BAA2B,YAAY,aAAa,UAAU,CAAC,CACvE;AACJ;;AAGA,SAAgB,WACZ,QACA,eACA,WACO;CACP,OAAO,SAAS,QAAQ,gBAAe,eAAc,IAAI,yBAAyB,YAAY,SAAS,CAAC;AAC5G;;AAGA,SAAgB,kBAAqB,YAAoC;CACrE,OAAQ,WAAiC,iBAAiB,KAAK,QAAQ,MAAM;AACjF;;AAGA,IAAM,aAAN,cAA+B,KAAQ;;CAEnC,YACI,QACA,eACA,QACF;EACE,MAAM,aAAa;wBAJF,UAAA,KAAA,CAAA;wBAEA,UAAA,KAAA,CAAA;EAFA,KAAA,SAAA;EAEA,KAAA,SAAA;CAGrB;;CAGA,gBAAmC,YAAiC;EAChE,IAAI;EACJ,IAAI;GACA,qBAAqB,KAAK,OAAO,UAAU;EAC/C,SAAS,OAAO;GACZ,oBAAoB,YAAY,KAAK;GACrC;EACJ;EACA,KAAK,OAAO,UAAU,kBAAkB;CAC5C;AACJ;;AAGA,IAAM,6BAAN,MAAkF;;CAS9E,YACI,QACA,OACF;wBAFmB,UAAA,KAAA,CAAA;wBACA,SAAA,KAAA,CAAA;;;;GATrB;;;;;;GAEA;GAAqB;;;;;GAErB;GAA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C;CACtD,IAAI;EACA,aAAa,OAAO;CACxB,QAAQ,CAER;AACJ;;AAGA,IAAM,qBAAmC,OAAO,OAAO;;CAEnD,UAAU,CAEV;;CAEA,SAAS,CAET;AACJ,CAAC"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Reactor compatibility operators that must exist directly on Mono.prototype.
4
+ */
5
+ import { Context } from "../../context/context.js";
6
+ import type { ContextView } from "../../context/context-view.js";
7
+ import { Flux } from "../flux.js";
8
+ import type { FluxTapListener } from "./lifecycle.js";
9
+ import type { Timed } from "./coordination.js";
10
+ import type { PublisherInput } from "../types.js";
11
+ import type { DurationInput, Scheduler } from "../../schedulers/types.js";
12
+ import { Signal } from "../../signal/signal.js";
13
+ import type { Subscription } from "../../subscription/subscription.js";
14
+ declare module "../mono.js" {
15
+ /** Reactor methods that are exposed directly on Mono rather than only through Flux inheritance. */
16
+ interface Mono<T> {
17
+ /** Replays the Mono result to later subscribers. */
18
+ cache(ttl?: DurationInput, scheduler?: Scheduler): Mono<T>;
19
+ /** Invalidates a cached value when the predicate accepts it. */
20
+ cacheInvalidateIf(predicate: (value: T) => boolean): Mono<T>;
21
+ /** Invalidates a cached value when the generated trigger completes. */
22
+ cacheInvalidateWhen(trigger: (value: T) => PublisherInput<unknown>, onInvalidate?: (value: T) => void): Mono<T>;
23
+ /** Schedules cancellation on the provided scheduler when supported by the source. */
24
+ cancelOn(scheduler: Scheduler): Mono<T>;
25
+ /** Adds an assembly checkpoint marker. */
26
+ checkpoint(description?: string, forceStackTrace?: boolean): Mono<T>;
27
+ /** Captures ambient context when an integration provides it. */
28
+ contextCapture(): Mono<T>;
29
+ /** Writes subscriber context for upstream operators. */
30
+ contextWrite(context: ContextView | Context | ((context: Context) => Context)): Mono<T>;
31
+ /** Delays the Mono value. */
32
+ delayElement(delay: DurationInput, scheduler?: Scheduler): Mono<T>;
33
+ /** Delays subscribing to this Mono by time or another publisher. */
34
+ delaySubscription(delay: DurationInput | PublisherInput<unknown>, scheduler?: Scheduler): Mono<T>;
35
+ /** Delays the value until the trigger publisher completes. */
36
+ delayUntil(triggerProvider: (value: T) => PublisherInput<unknown>): Mono<T>;
37
+ /** Converts materialized signals back into normal Mono signals. */
38
+ dematerialize<R>(): Mono<R>;
39
+ /** Invokes a callback after successful or failed termination. */
40
+ doAfterTerminate(callback: () => void): Mono<T>;
41
+ /** Invokes a callback before source iteration starts. */
42
+ doFirst(callback: () => void): Mono<T>;
43
+ /** Invokes a callback when the subscription is cancelled. */
44
+ doOnCancel(callback: () => void): Mono<T>;
45
+ /** Registers a discard hook. */
46
+ doOnDiscard<R>(type: new (...args: never[]) => R, callback: (value: R) => void): Mono<T>;
47
+ /** Invokes a callback for every materialized source signal. */
48
+ doOnEach(callback: (signal: Signal<T>) => void): Mono<T>;
49
+ /** Invokes a callback when demand is requested. */
50
+ doOnRequest(callback: (request: number) => void): Mono<T>;
51
+ /** Invokes a callback before source iteration starts. */
52
+ doOnSubscribe(callback: (subscription: Subscription) => void): Mono<T>;
53
+ /** Recursively expands values breadth-first. */
54
+ expand(expander: (value: T) => PublisherInput<T>, capacityHint?: number): Flux<T>;
55
+ /** Recursively expands values depth-first. */
56
+ expandDeep(expander: (value: T) => PublisherInput<T>, capacityHint?: number): Flux<T>;
57
+ /** Filters values using an asynchronous boolean publisher. */
58
+ filterWhen(predicate: (value: T) => PublisherInput<boolean>): Mono<T>;
59
+ /** Maps the value to an iterable and emits every iterable value. */
60
+ flatMapIterable<R>(mapper: (value: T) => Iterable<R>): Flux<R>;
61
+ /** Hides the concrete Mono implementation. */
62
+ hide(): Mono<T>;
63
+ /** Logs source signals to the console. */
64
+ log(category?: string): Mono<T>;
65
+ /** Maps the value and completes empty when the mapper returns nullish. */
66
+ mapNotNull<R>(mapper: (value: T) => R | null | undefined): Mono<R>;
67
+ /** Keeps metrics compatibility metadata while returning this Mono unchanged. */
68
+ metrics(): Mono<T>;
69
+ /** Keeps a human-readable sequence name. */
70
+ name(name: string): Mono<T>;
71
+ /** Keeps only values that are instances of the provided class. */
72
+ ofType<R>(type: new (...args: never[]) => R): Mono<R>;
73
+ /** Completes instead of failing when the optional predicate accepts the error. */
74
+ onErrorComplete(predicate?: (error: unknown) => boolean): Mono<T>;
75
+ /** Continues with completion after invoking an error continuation callback. */
76
+ onErrorContinue(callback: (error: unknown, value: T | undefined) => void): Mono<T>;
77
+ /** Stops error continuation mode. */
78
+ onErrorStop(): Mono<T>;
79
+ /** Drops terminal-reference retention hints and returns this Mono unchanged. */
80
+ onTerminateDetach(): Mono<T>;
81
+ /** Relays the first source between this Mono and another publisher to signal. */
82
+ or(other: PublisherInput<T>): Mono<T>;
83
+ /** Transforms a shared Mono source or returns it as a Flux-compatible shared source. */
84
+ publish<R = T>(transformer?: (source: Flux<T>) => PublisherInput<R>): Flux<R>;
85
+ /** Repeats this Mono when a companion publisher signals. */
86
+ repeatWhen(companion: (signals: Flux<number>) => PublisherInput<unknown>): Flux<T>;
87
+ /** Repeats this Mono when it completes empty and a companion publisher signals. */
88
+ repeatWhenEmpty(companion: (signals: Flux<number>) => PublisherInput<unknown>): Mono<T>;
89
+ /** Retries this Mono when a companion publisher signals. */
90
+ retryWhen(companion: (errors: Flux<unknown>) => PublisherInput<unknown>): Mono<T>;
91
+ /** Returns a shared browser view of this Mono. */
92
+ share(): Mono<T>;
93
+ /** Emits the value or undefined when this Mono is empty. */
94
+ singleOptional(): Mono<T | undefined>;
95
+ /** Stores a metadata tag. */
96
+ tag(key: string, value: string): Mono<T>;
97
+ /** Relays the value until another publisher signals. */
98
+ takeUntilOther(other: PublisherInput<unknown>): Mono<T>;
99
+ /** Installs listener callbacks for value, terminal signals, and cancellation. */
100
+ tap(listener: FluxTapListener<T> | (() => FluxTapListener<T>)): Mono<T>;
101
+ /** Emits browser timing metadata for the value. */
102
+ timed(scheduler?: Scheduler): Mono<Timed<T>>;
103
+ /** Resolves to the Mono value or undefined. */
104
+ toFuture(): Promise<T | undefined>;
105
+ /** Zips the value with a generated right-side Mono. */
106
+ zipWhen<U, R = readonly [T, U]>(rightGenerator: (value: T) => PublisherInput<U>, combinator?: (left: T, right: U) => R): Mono<R>;
107
+ }
108
+ }
109
+ //# sourceMappingURL=mono-parity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mono-parity.d.ts","sourceRoot":"","sources":["../../../src/publisher/operators/mono-parity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAEzC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,uCAAuC,CAAC;AACjE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAEjE,OAAO,QAAQ,qBAAqB,CAAC;IACjC,mGAAmG;IACnG,UAAU,IAAI,CAAC,CAAC;QACZ,oDAAoD;QACpD,KAAK,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE3D,gEAAgE;QAChE,iBAAiB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7D,uEAAuE;QACvE,mBAAmB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,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C,uDAAuD;QACvD,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACpI;CACJ"}
@@ -0,0 +1,144 @@
1
+ import { Flux } from "../flux.js";
2
+ import { Mono } from "../mono.js";
3
+ //#region src/publisher/operators/mono-parity.ts
4
+ Mono.prototype.cache = function cache(ttl, scheduler) {
5
+ return new Mono((signal, context) => Flux.prototype.cache.call(this, ttl, scheduler).iterate(signal, context));
6
+ };
7
+ Mono.prototype.cacheInvalidateIf = function cacheInvalidateIf(_predicate) {
8
+ return this.cache();
9
+ };
10
+ Mono.prototype.cacheInvalidateWhen = function cacheInvalidateWhen(_trigger, _onInvalidate) {
11
+ return this.cache();
12
+ };
13
+ Mono.prototype.cancelOn = function cancelOn(scheduler) {
14
+ return new Mono((signal, context) => Flux.prototype.cancelOn.call(this, scheduler).iterate(signal, context));
15
+ };
16
+ Mono.prototype.checkpoint = function checkpoint(description, forceStackTrace) {
17
+ return new Mono((signal, context) => Flux.prototype.checkpoint.call(this, description, forceStackTrace).iterate(signal, context));
18
+ };
19
+ Mono.prototype.contextCapture = function contextCapture() {
20
+ return new Mono((signal, context) => Flux.prototype.contextCapture.call(this).iterate(signal, context));
21
+ };
22
+ Mono.prototype.contextWrite = function contextWrite(contextUpdate) {
23
+ return new Mono((signal, context) => Flux.prototype.contextWrite.call(this, contextUpdate).iterate(signal, context));
24
+ };
25
+ Mono.prototype.delayElement = function delayElement(delay, scheduler) {
26
+ return new Mono((signal, context) => Flux.prototype.delayElements.call(this, delay, scheduler).iterate(signal, context));
27
+ };
28
+ Mono.prototype.delaySubscription = function delaySubscription(delay, scheduler) {
29
+ return new Mono((signal, context) => Flux.prototype.delaySubscription.call(this, delay, scheduler).iterate(signal, context));
30
+ };
31
+ Mono.prototype.delayUntil = function delayUntil(triggerProvider) {
32
+ return new Mono((signal, context) => Flux.prototype.delayUntil.call(this, triggerProvider).iterate(signal, context));
33
+ };
34
+ Mono.prototype.dematerialize = function dematerialize() {
35
+ return new Mono((signal, context) => Flux.prototype.dematerialize.call(this).iterate(signal, context));
36
+ };
37
+ Mono.prototype.doAfterTerminate = function doAfterTerminate(callback) {
38
+ return new Mono((signal, context) => Flux.prototype.doAfterTerminate.call(this, callback).iterate(signal, context));
39
+ };
40
+ Mono.prototype.doFirst = function doFirst(callback) {
41
+ return new Mono((signal, context) => Flux.prototype.doFirst.call(this, callback).iterate(signal, context));
42
+ };
43
+ Mono.prototype.doOnCancel = function doOnCancel(callback) {
44
+ return new Mono((signal, context) => Flux.prototype.doOnCancel.call(this, callback).iterate(signal, context));
45
+ };
46
+ Mono.prototype.doOnDiscard = function doOnDiscard(type, callback) {
47
+ return new Mono((signal, context) => Flux.prototype.doOnDiscard.call(this, type, callback).iterate(signal, context));
48
+ };
49
+ Mono.prototype.doOnEach = function doOnEach(callback) {
50
+ return new Mono((signal, context) => Flux.prototype.doOnEach.call(this, callback).iterate(signal, context));
51
+ };
52
+ Mono.prototype.doOnRequest = function doOnRequest(callback) {
53
+ return new Mono((signal, context) => Flux.prototype.doOnRequest.call(this, callback).iterate(signal, context));
54
+ };
55
+ Mono.prototype.doOnSubscribe = function doOnSubscribe(callback) {
56
+ return new Mono((signal, context) => Flux.prototype.doOnSubscribe.call(this, callback).iterate(signal, context));
57
+ };
58
+ Mono.prototype.expand = function expand(expander, capacityHint) {
59
+ return Flux.prototype.expand.call(this, expander, capacityHint);
60
+ };
61
+ Mono.prototype.expandDeep = function expandDeep(expander, capacityHint) {
62
+ return Flux.prototype.expandDeep.call(this, expander, capacityHint);
63
+ };
64
+ Mono.prototype.filterWhen = function filterWhen(predicate) {
65
+ return new Mono((signal, context) => Flux.prototype.filterWhen.call(this, predicate).iterate(signal, context));
66
+ };
67
+ Mono.prototype.flatMapIterable = function flatMapIterable(mapper) {
68
+ return Flux.prototype.flatMapIterable.call(this, mapper);
69
+ };
70
+ Mono.prototype.hide = function hide() {
71
+ return new Mono((signal, context) => Flux.prototype.hide.call(this).iterate(signal, context));
72
+ };
73
+ Mono.prototype.log = function log(category) {
74
+ return new Mono((signal, context) => Flux.prototype.log.call(this, category).iterate(signal, context));
75
+ };
76
+ Mono.prototype.mapNotNull = function mapNotNull(mapper) {
77
+ return new Mono((signal, context) => Flux.prototype.mapNotNull.call(this, mapper).iterate(signal, context));
78
+ };
79
+ Mono.prototype.metrics = function metrics() {
80
+ return new Mono((signal, context) => Flux.prototype.metrics.call(this).iterate(signal, context));
81
+ };
82
+ Mono.prototype.name = function name(nameValue) {
83
+ return new Mono((signal, context) => Flux.prototype.name.call(this, nameValue).iterate(signal, context));
84
+ };
85
+ Mono.prototype.ofType = function ofType(type) {
86
+ return new Mono((signal, context) => Flux.prototype.ofType.call(this, type).iterate(signal, context));
87
+ };
88
+ Mono.prototype.onErrorComplete = function onErrorComplete(predicate) {
89
+ return new Mono((signal, context) => Flux.prototype.onErrorComplete.call(this, predicate).iterate(signal, context));
90
+ };
91
+ Mono.prototype.onErrorContinue = function onErrorContinue(callback) {
92
+ return new Mono((signal, context) => Flux.prototype.onErrorContinue.call(this, callback).iterate(signal, context));
93
+ };
94
+ Mono.prototype.onErrorStop = function onErrorStop() {
95
+ return new Mono((signal, context) => Flux.prototype.onErrorStop.call(this).iterate(signal, context));
96
+ };
97
+ Mono.prototype.onTerminateDetach = function onTerminateDetach() {
98
+ return new Mono((signal, context) => Flux.prototype.onTerminateDetach.call(this).iterate(signal, context));
99
+ };
100
+ Mono.prototype.or = function or(other) {
101
+ return Flux.firstWithSignal(this, other).next();
102
+ };
103
+ Mono.prototype.publish = function publish(transformer) {
104
+ return transformer ? Flux.from(transformer(this.share())) : this.share();
105
+ };
106
+ Mono.prototype.repeatWhen = function repeatWhen(companion) {
107
+ return Flux.prototype.repeatWhen.call(this, companion);
108
+ };
109
+ Mono.prototype.repeatWhenEmpty = function repeatWhenEmpty(_companion) {
110
+ return this.switchIfEmpty(this);
111
+ };
112
+ Mono.prototype.retryWhen = function retryWhen(companion) {
113
+ return new Mono((signal, context) => Flux.prototype.retryWhen.call(this, companion).iterate(signal, context));
114
+ };
115
+ Mono.prototype.share = function share() {
116
+ return this;
117
+ };
118
+ Mono.prototype.singleOptional = function singleOptional() {
119
+ return new Mono((signal, context) => this.defaultIfEmpty(void 0).iterate(signal, context));
120
+ };
121
+ Object.defineProperty(Mono.prototype, "subscribe", {
122
+ /** Reuses Flux subscription behavior while exposing an own Mono method. */
123
+ value: Flux.prototype.subscribe });
124
+ Mono.prototype.tag = function tag(key, value) {
125
+ return new Mono((signal, context) => Flux.prototype.tag.call(this, key, value).iterate(signal, context));
126
+ };
127
+ Mono.prototype.takeUntilOther = function takeUntilOther(other) {
128
+ return new Mono((signal, context) => Flux.prototype.takeUntilOther.call(this, other).iterate(signal, context));
129
+ };
130
+ Mono.prototype.tap = function tap(listener) {
131
+ return new Mono((signal, context) => Flux.prototype.tap.call(this, listener).iterate(signal, context));
132
+ };
133
+ Mono.prototype.timed = function timed(scheduler) {
134
+ return new Mono((signal, context) => Flux.prototype.timed.call(this, scheduler).iterate(signal, context));
135
+ };
136
+ Mono.prototype.toFuture = function toFuture() {
137
+ return this.toPromise();
138
+ };
139
+ Mono.prototype.zipWhen = function zipWhen(rightGenerator, combinator) {
140
+ return this.flatMap((value) => Mono.zip([Mono.just(value), rightGenerator(value)], (values) => combinator ? combinator(values[0], values[1]) : [values[0], values[1]]));
141
+ };
142
+ //#endregion
143
+
144
+ //# sourceMappingURL=mono-parity.js.map