silentium 0.0.150 → 0.0.152
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.
- package/CHANGELOG.md +14 -0
- package/dist/silentium.cjs +156 -153
- package/dist/silentium.cjs.map +1 -1
- package/dist/silentium.d.ts +2 -2
- package/dist/silentium.js +156 -153
- package/dist/silentium.js.map +1 -1
- package/dist/silentium.min.js +1 -1
- package/dist/silentium.min.mjs +1 -1
- package/dist/silentium.min.mjs.map +1 -1
- package/dist/silentium.mjs +156 -153
- package/dist/silentium.mjs.map +1 -1
- package/package.json +1 -1
- package/src/base/Message.ts +5 -2
- package/src/components/ContextChain.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.152](https://github.com/silentium-lab/silentium/compare/v0.0.151...v0.0.152) (2025-11-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **main:** message component lint fix ([de43262](https://github.com/silentium-lab/silentium/commit/de43262108b65267a029df7ef8423def26bf1cbc))
|
|
11
|
+
|
|
12
|
+
### [0.0.151](https://github.com/silentium-lab/silentium/compare/v0.0.150...v0.0.151) (2025-11-24)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **main:** message chain fix ([220b44b](https://github.com/silentium-lab/silentium/commit/220b44b4a25437b508f9179feae34d7408eb964d))
|
|
18
|
+
|
|
5
19
|
### [0.0.150](https://github.com/silentium-lab/silentium/compare/v0.0.149...v0.0.150) (2025-11-24)
|
|
6
20
|
|
|
7
21
|
|
package/dist/silentium.cjs
CHANGED
|
@@ -82,6 +82,146 @@ class Rejections {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
var __defProp$4 = Object.defineProperty;
|
|
86
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
87
|
+
var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
88
|
+
function Late(v) {
|
|
89
|
+
return new LateImpl(v);
|
|
90
|
+
}
|
|
91
|
+
class LateImpl {
|
|
92
|
+
constructor(v) {
|
|
93
|
+
this.v = v;
|
|
94
|
+
__publicField$4(this, "rejections", new Rejections());
|
|
95
|
+
__publicField$4(this, "lateR", null);
|
|
96
|
+
__publicField$4(this, "notify", () => {
|
|
97
|
+
if (isFilled(this.v) && this.lateR) {
|
|
98
|
+
try {
|
|
99
|
+
this.lateR(this.v);
|
|
100
|
+
} catch (e) {
|
|
101
|
+
this.rejections.reject(e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
then(r) {
|
|
107
|
+
if (this.lateR) {
|
|
108
|
+
throw new Error(
|
|
109
|
+
"Late component gets new resolver, when another was already connected!"
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
this.lateR = r;
|
|
113
|
+
this.notify();
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
use(value) {
|
|
117
|
+
this.v = value;
|
|
118
|
+
this.notify();
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
catch(rejected) {
|
|
122
|
+
this.rejections.catch(rejected);
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
var __defProp$3 = Object.defineProperty;
|
|
128
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
129
|
+
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, key + "" , value);
|
|
130
|
+
function Primitive($base, theValue = null) {
|
|
131
|
+
return new PrimitiveImpl($base, theValue);
|
|
132
|
+
}
|
|
133
|
+
class PrimitiveImpl {
|
|
134
|
+
constructor($base, theValue = null) {
|
|
135
|
+
this.$base = $base;
|
|
136
|
+
this.theValue = theValue;
|
|
137
|
+
__publicField$3(this, "touched", false);
|
|
138
|
+
}
|
|
139
|
+
ensureTouched() {
|
|
140
|
+
if (!this.touched) {
|
|
141
|
+
this.$base.then((v) => {
|
|
142
|
+
this.theValue = v;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
this.touched = true;
|
|
146
|
+
}
|
|
147
|
+
[Symbol.toPrimitive]() {
|
|
148
|
+
this.ensureTouched();
|
|
149
|
+
return this.theValue;
|
|
150
|
+
}
|
|
151
|
+
primitive() {
|
|
152
|
+
this.ensureTouched();
|
|
153
|
+
return this.theValue;
|
|
154
|
+
}
|
|
155
|
+
primitiveWithException() {
|
|
156
|
+
this.ensureTouched();
|
|
157
|
+
if (this.theValue === null) {
|
|
158
|
+
throw new Error("Primitive value is null");
|
|
159
|
+
}
|
|
160
|
+
return this.theValue;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
var __defProp$2 = Object.defineProperty;
|
|
165
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
166
|
+
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
167
|
+
function Shared($base, source) {
|
|
168
|
+
return new SharedImpl($base, source);
|
|
169
|
+
}
|
|
170
|
+
class SharedImpl {
|
|
171
|
+
constructor($base, source) {
|
|
172
|
+
this.$base = $base;
|
|
173
|
+
this.source = source;
|
|
174
|
+
__publicField$2(this, "resolver", (v) => {
|
|
175
|
+
this.lastV = v;
|
|
176
|
+
this.resolvers.forEach((r) => {
|
|
177
|
+
r(v);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
__publicField$2(this, "lastV");
|
|
181
|
+
__publicField$2(this, "resolvers", /* @__PURE__ */ new Set());
|
|
182
|
+
if (isSource($base)) {
|
|
183
|
+
this.source = $base;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
then(resolved) {
|
|
187
|
+
this.resolvers.add(resolved);
|
|
188
|
+
if (this.resolvers.size === 1) {
|
|
189
|
+
this.$base.then(this.resolver);
|
|
190
|
+
} else if (isFilled(this.lastV)) {
|
|
191
|
+
resolved(this.lastV);
|
|
192
|
+
}
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
use(value) {
|
|
196
|
+
if (this.source) {
|
|
197
|
+
this.source.use(value);
|
|
198
|
+
} else {
|
|
199
|
+
this.resolver(value);
|
|
200
|
+
}
|
|
201
|
+
return this;
|
|
202
|
+
}
|
|
203
|
+
catch(rejected) {
|
|
204
|
+
this.$base.catch(rejected);
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
207
|
+
destroy() {
|
|
208
|
+
this.resolvers.clear();
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
value() {
|
|
212
|
+
return Primitive(this);
|
|
213
|
+
}
|
|
214
|
+
chain(m) {
|
|
215
|
+
m.then(this.use.bind(this));
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function LateShared(value) {
|
|
221
|
+
const l = Late(value);
|
|
222
|
+
return Shared(l, l);
|
|
223
|
+
}
|
|
224
|
+
|
|
85
225
|
function ensureFunction(v, label) {
|
|
86
226
|
if (typeof v !== "function") {
|
|
87
227
|
throw new Error(`${label}: is not function`);
|
|
@@ -93,27 +233,29 @@ function ensureMessage(v, label) {
|
|
|
93
233
|
}
|
|
94
234
|
}
|
|
95
235
|
|
|
96
|
-
var __defProp$
|
|
97
|
-
var __defNormalProp$
|
|
98
|
-
var __publicField$
|
|
236
|
+
var __defProp$1 = Object.defineProperty;
|
|
237
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
238
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
99
239
|
function Message(executor) {
|
|
100
240
|
return new MessageRx(executor);
|
|
101
241
|
}
|
|
102
242
|
class MessageRx {
|
|
103
243
|
constructor(executor) {
|
|
104
244
|
this.executor = executor;
|
|
105
|
-
__publicField$
|
|
106
|
-
__publicField$
|
|
245
|
+
__publicField$1(this, "rejections", new Rejections());
|
|
246
|
+
__publicField$1(this, "dc", DestroyContainer());
|
|
107
247
|
ensureFunction(executor, "Message: executor");
|
|
108
248
|
}
|
|
109
249
|
then(resolve) {
|
|
110
|
-
|
|
250
|
+
const thenResult = LateShared();
|
|
111
251
|
try {
|
|
112
252
|
const proxyResolve = (v) => {
|
|
113
253
|
const result = resolve(v);
|
|
114
254
|
this.dc.add(result);
|
|
115
255
|
if (isMessage(result)) {
|
|
116
|
-
thenResult
|
|
256
|
+
thenResult.chain(result);
|
|
257
|
+
} else {
|
|
258
|
+
thenResult.use(v);
|
|
117
259
|
}
|
|
118
260
|
};
|
|
119
261
|
this.dc.add(this.executor(proxyResolve, this.rejections.reject));
|
|
@@ -171,16 +313,16 @@ function Local(_base) {
|
|
|
171
313
|
});
|
|
172
314
|
}
|
|
173
315
|
|
|
174
|
-
var __defProp
|
|
175
|
-
var __defNormalProp
|
|
176
|
-
var __publicField
|
|
316
|
+
var __defProp = Object.defineProperty;
|
|
317
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
318
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
177
319
|
function MessageSource(messageExecutor, sourceExecutor) {
|
|
178
320
|
return new MessageSourceImpl(messageExecutor, sourceExecutor);
|
|
179
321
|
}
|
|
180
322
|
class MessageSourceImpl {
|
|
181
323
|
constructor(messageExecutor, sourceExecutor) {
|
|
182
324
|
this.sourceExecutor = sourceExecutor;
|
|
183
|
-
__publicField
|
|
325
|
+
__publicField(this, "message");
|
|
184
326
|
this.message = Message(messageExecutor);
|
|
185
327
|
}
|
|
186
328
|
use(value) {
|
|
@@ -257,48 +399,6 @@ function AppliedDestructured($base, applier) {
|
|
|
257
399
|
});
|
|
258
400
|
}
|
|
259
401
|
|
|
260
|
-
var __defProp$2 = Object.defineProperty;
|
|
261
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
262
|
-
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
263
|
-
function Late(v) {
|
|
264
|
-
return new LateImpl(v);
|
|
265
|
-
}
|
|
266
|
-
class LateImpl {
|
|
267
|
-
constructor(v) {
|
|
268
|
-
this.v = v;
|
|
269
|
-
__publicField$2(this, "rejections", new Rejections());
|
|
270
|
-
__publicField$2(this, "lateR", null);
|
|
271
|
-
__publicField$2(this, "notify", () => {
|
|
272
|
-
if (isFilled(this.v) && this.lateR) {
|
|
273
|
-
try {
|
|
274
|
-
this.lateR(this.v);
|
|
275
|
-
} catch (e) {
|
|
276
|
-
this.rejections.reject(e);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
then(r) {
|
|
282
|
-
if (this.lateR) {
|
|
283
|
-
throw new Error(
|
|
284
|
-
"Late component gets new resolver, when another was already connected!"
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
this.lateR = r;
|
|
288
|
-
this.notify();
|
|
289
|
-
return this;
|
|
290
|
-
}
|
|
291
|
-
use(value) {
|
|
292
|
-
this.v = value;
|
|
293
|
-
this.notify();
|
|
294
|
-
return this;
|
|
295
|
-
}
|
|
296
|
-
catch(rejected) {
|
|
297
|
-
this.rejections.catch(rejected);
|
|
298
|
-
return this;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
402
|
function Catch($base) {
|
|
303
403
|
const rejections = new Rejections();
|
|
304
404
|
$base.catch(rejections.reject);
|
|
@@ -359,113 +459,16 @@ function Context(msg) {
|
|
|
359
459
|
});
|
|
360
460
|
}
|
|
361
461
|
|
|
362
|
-
function ContextChain(
|
|
462
|
+
function ContextChain(base) {
|
|
463
|
+
const $base = ActualMessage(base);
|
|
363
464
|
return (context) => {
|
|
364
465
|
if (!context.result) {
|
|
365
466
|
throw new Error("ContextChain did not find result in rpc message");
|
|
366
467
|
}
|
|
367
|
-
|
|
468
|
+
$base.then(context.result);
|
|
368
469
|
};
|
|
369
470
|
}
|
|
370
471
|
|
|
371
|
-
var __defProp$1 = Object.defineProperty;
|
|
372
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
373
|
-
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "" , value);
|
|
374
|
-
function Primitive($base, theValue = null) {
|
|
375
|
-
return new PrimitiveImpl($base, theValue);
|
|
376
|
-
}
|
|
377
|
-
class PrimitiveImpl {
|
|
378
|
-
constructor($base, theValue = null) {
|
|
379
|
-
this.$base = $base;
|
|
380
|
-
this.theValue = theValue;
|
|
381
|
-
__publicField$1(this, "touched", false);
|
|
382
|
-
}
|
|
383
|
-
ensureTouched() {
|
|
384
|
-
if (!this.touched) {
|
|
385
|
-
this.$base.then((v) => {
|
|
386
|
-
this.theValue = v;
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
this.touched = true;
|
|
390
|
-
}
|
|
391
|
-
[Symbol.toPrimitive]() {
|
|
392
|
-
this.ensureTouched();
|
|
393
|
-
return this.theValue;
|
|
394
|
-
}
|
|
395
|
-
primitive() {
|
|
396
|
-
this.ensureTouched();
|
|
397
|
-
return this.theValue;
|
|
398
|
-
}
|
|
399
|
-
primitiveWithException() {
|
|
400
|
-
this.ensureTouched();
|
|
401
|
-
if (this.theValue === null) {
|
|
402
|
-
throw new Error("Primitive value is null");
|
|
403
|
-
}
|
|
404
|
-
return this.theValue;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
var __defProp = Object.defineProperty;
|
|
409
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
410
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
411
|
-
function Shared($base, source) {
|
|
412
|
-
return new SharedImpl($base, source);
|
|
413
|
-
}
|
|
414
|
-
class SharedImpl {
|
|
415
|
-
constructor($base, source) {
|
|
416
|
-
this.$base = $base;
|
|
417
|
-
this.source = source;
|
|
418
|
-
__publicField(this, "resolver", (v) => {
|
|
419
|
-
this.lastV = v;
|
|
420
|
-
this.resolvers.forEach((r) => {
|
|
421
|
-
r(v);
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
__publicField(this, "lastV");
|
|
425
|
-
__publicField(this, "resolvers", /* @__PURE__ */ new Set());
|
|
426
|
-
if (isSource($base)) {
|
|
427
|
-
this.source = $base;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
then(resolved) {
|
|
431
|
-
this.resolvers.add(resolved);
|
|
432
|
-
if (this.resolvers.size === 1) {
|
|
433
|
-
this.$base.then(this.resolver);
|
|
434
|
-
} else if (isFilled(this.lastV)) {
|
|
435
|
-
resolved(this.lastV);
|
|
436
|
-
}
|
|
437
|
-
return this;
|
|
438
|
-
}
|
|
439
|
-
use(value) {
|
|
440
|
-
if (this.source) {
|
|
441
|
-
this.source.use(value);
|
|
442
|
-
} else {
|
|
443
|
-
this.resolver(value);
|
|
444
|
-
}
|
|
445
|
-
return this;
|
|
446
|
-
}
|
|
447
|
-
catch(rejected) {
|
|
448
|
-
this.$base.catch(rejected);
|
|
449
|
-
return this;
|
|
450
|
-
}
|
|
451
|
-
destroy() {
|
|
452
|
-
this.resolvers.clear();
|
|
453
|
-
return this;
|
|
454
|
-
}
|
|
455
|
-
value() {
|
|
456
|
-
return Primitive(this);
|
|
457
|
-
}
|
|
458
|
-
chain(m) {
|
|
459
|
-
m.then(this.use.bind(this));
|
|
460
|
-
return this;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
function LateShared(value) {
|
|
465
|
-
const l = Late(value);
|
|
466
|
-
return Shared(l, l);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
472
|
function ContextOf(transport) {
|
|
470
473
|
const $msg = LateShared();
|
|
471
474
|
Context.transport.set(transport, $msg.use.bind($msg));
|
package/dist/silentium.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"silentium.cjs","sources":["../src/helpers/guards.ts","../src/base/Destroyable.ts","../src/base/DestroyContainer.ts","../src/base/Rejections.ts","../src/helpers/ensures.ts","../src/base/Message.ts","../src/base/Of.ts","../src/base/ActualMessage.ts","../src/base/Chainable.ts","../src/base/Local.ts","../src/base/MessageSource.ts","../src/base/New.ts","../src/base/Void.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/AppliedDestructured.ts","../src/components/Late.ts","../src/components/Catch.ts","../src/components/Chain.ts","../src/components/Context.ts","../src/components/ContextChain.ts","../src/components/Primitive.ts","../src/components/Shared.ts","../src/components/LateShared.ts","../src/components/ContextOf.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromEvent.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Stream.ts"],"sourcesContent":["import { DestroyableType, DestroyedType } from \"types/DestroyableType\";\nimport { MessageType } from \"types/MessageType\";\nimport { SourceType } from \"types/SourceType\";\n\n/**\n * Checks that the value is neither undefined nor null\n */\nexport const isFilled = <T>(\n value?: T,\n): value is Exclude<T, null | undefined> => {\n return value !== undefined && value !== null;\n};\n\n/**\n * Checks that the object is an message\n */\nexport function isMessage(o: unknown): o is MessageType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"then\" in o &&\n typeof (o as any).then === \"function\"\n );\n}\n\n/**\n * Checks that the object is an message\n */\nexport function isSource(o: unknown): o is SourceType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"use\" in o &&\n typeof (o as any).use === \"function\"\n );\n}\n\n/**\n * Checks that the object is destroyable\n */\nexport function isDestroyable(o: unknown): o is DestroyableType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"destroy\" in o &&\n typeof (o as any).destroy === \"function\"\n );\n}\n\n/**\n * Checks that the object can indicate whether it has been destroyed or not\n */\nexport function isDestroyed(o: unknown): o is DestroyedType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"destroyed\" in o &&\n typeof (o as any).destroyed === \"function\"\n );\n}\n","import { isDestroyable } from \"helpers/guards\";\nimport { DestroyableType } from \"types/DestroyableType\";\n\n/**\n * Allows creating an object that definitely has a destructor,\n * useful to avoid creating unnecessary conditions\n */\nexport function Destroyable<T>(base: T) {\n return new DestroyableImpl(base);\n}\n\nexport class DestroyableImpl<T> implements DestroyableType {\n public constructor(private base: T) {}\n\n public destroy(): this {\n if (isDestroyable(this.base)) {\n this.base.destroy();\n }\n\n if (typeof this.base === \"function\") {\n this.base();\n }\n\n return this;\n }\n}\n","import { Destroyable } from \"base/Destroyable\";\nimport { DestroyableType } from \"types/DestroyableType\";\n\n/**\n * An object that allows collecting all disposable objects and\n * disposing them later all together\n */\nexport function DestroyContainer() {\n return new DestroyContainerImpl();\n}\n\nexport class DestroyContainerImpl implements DestroyableType {\n private destructors: DestroyableType[] = [];\n\n public add<R>(e: R): R {\n this.destructors.push(Destroyable(e));\n return e;\n }\n\n public destroy() {\n this.destructors.forEach((d) => d.destroy());\n this.destructors.length = 0;\n return this;\n }\n}\n","import { ConstructorType } from \"types/ConstructorType\";\n\n/**\n * Handles rejections collection\n */\nexport class Rejections {\n private catchers: ConstructorType<[unknown]>[] = [];\n private lastRejectReason: unknown = null;\n\n public reject = (reason: unknown) => {\n this.lastRejectReason = reason;\n this.catchers.forEach((catcher) => {\n catcher(reason);\n });\n };\n\n public catch(rejected: ConstructorType<[unknown]>) {\n if (this.lastRejectReason !== null) {\n rejected(this.lastRejectReason);\n }\n this.catchers.push(rejected);\n return this;\n }\n\n public destroy() {\n this.catchers.length = 0;\n return this;\n }\n}\n","import { isMessage } from \"helpers/guards\";\n\nexport function ensureFunction(v: unknown, label: string) {\n if (typeof v !== \"function\") {\n throw new Error(`${label}: is not function`);\n }\n}\n\nexport function ensureMessage(v: unknown, label: string) {\n if (!isMessage(v)) {\n throw new Error(`${label}: is not message`);\n }\n}\n","import { DestroyContainer } from \"base/DestroyContainer\";\nimport { Rejections } from \"base/Rejections\";\nimport { ensureFunction } from \"helpers/ensures\";\nimport { isMessage } from \"helpers/guards\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { DestroyableType } from \"types/DestroyableType\";\nimport { MessageType } from \"types/MessageType\";\n\nexport type MessageExecutorType<T> = (\n resolve: ConstructorType<[T]>,\n reject: ConstructorType<[unknown]>,\n) => MessageType | (() => void) | void;\n\n/**\n * A message created from an executor function.\n * The executor function can return a message destruction function.\n */\nexport function Message<T>(executor: MessageExecutorType<T>) {\n return new MessageRx<T>(executor);\n}\n\n/**\n * Reactive message implementation\n */\nexport class MessageRx<T> implements MessageType<T>, DestroyableType {\n private rejections = new Rejections();\n private dc = DestroyContainer();\n\n public constructor(private executor: MessageExecutorType<T>) {\n ensureFunction(executor, \"Message: executor\");\n }\n\n public then(resolve: ConstructorType<[T]>) {\n let thenResult: MessageType<T> = this as MessageType<T>;\n try {\n const proxyResolve = (v: T) => {\n const result = resolve(v);\n this.dc.add(result);\n if (isMessage(result)) {\n thenResult = result as MessageType<T>;\n }\n };\n this.dc.add(this.executor(proxyResolve, this.rejections.reject));\n } catch (e: any) {\n this.rejections.reject(e);\n }\n return thenResult;\n }\n\n public catch(rejected: ConstructorType<[unknown]>) {\n this.rejections.catch(rejected);\n return this;\n }\n\n public destroy() {\n this.dc.destroy();\n this.rejections.destroy();\n return this;\n }\n}\n","import { Message } from \"base/Message\";\n\n/**\n * Helps convert a value into a message\n */\nexport function Of<T>(value: T) {\n return Message<T>(function OfImpl(r) {\n r(value);\n });\n}\n","import { Of } from \"base/Of\";\nimport { isMessage } from \"helpers/guards\";\nimport { MaybeMessage, MessageType } from \"types/MessageType\";\n\n/**\n * A function that helps to ensure that\n * the message is indeed a message object\n * and not just a value\n */\nexport function ActualMessage<T>(message: MaybeMessage<T>): MessageType<T> {\n return isMessage(message) ? message : Of(message);\n}\n","import { ChainableType } from \"types/ChainableType\";\nimport { MessageType } from \"types/MessageType\";\nimport { SourceType } from \"types/SourceType\";\n\n/**\n * Helps to connect Different\n * message and source\n */\nexport function Chainable<T>(src: SourceType<T>) {\n return new ChainableImpl(src);\n}\n\nexport class ChainableImpl<T> implements ChainableType<T> {\n public constructor(private src: SourceType<T>) {}\n\n public chain($m: MessageType<T>) {\n $m.then(this.src.use.bind(this.src));\n return this;\n }\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * Create local copy of source what can be destroyed\n */\nexport function Local<T>(_base: MaybeMessage<T>) {\n const $base = ActualMessage(_base);\n return Message<T>(function LocalImpl(r) {\n let destroyed = false;\n $base.then((v) => {\n if (!destroyed) {\n r(v);\n }\n });\n return () => {\n destroyed = true;\n };\n });\n}\n","import { Message, MessageExecutorType, MessageRx } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MessageSourceType } from \"types/SourceType\";\n\n/**\n * Base message source object\n */\nexport function MessageSource<T>(\n messageExecutor: MessageExecutorType<T>,\n sourceExecutor: ConstructorType<[T]>,\n) {\n return new MessageSourceImpl(messageExecutor, sourceExecutor);\n}\n\nexport class MessageSourceImpl<T> implements MessageSourceType<T> {\n private message: MessageRx<T>;\n\n public constructor(\n messageExecutor: MessageExecutorType<T>,\n private sourceExecutor: ConstructorType<[T]>,\n ) {\n this.message = Message(messageExecutor);\n }\n\n public use(value: T): this {\n this.sourceExecutor(value);\n return this;\n }\n\n public then(resolved: ConstructorType<[T]>): this {\n this.message.then(resolved);\n return this;\n }\n\n public catch(rejected: ConstructorType<[unknown]>): this {\n this.message.catch(rejected);\n return this;\n }\n}\n","import { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\n\n/**\n * A component that, on each access, returns a new instance\n * of a reference type based on the constructor function\n */\nexport function New<T>(construct: ConstructorType<[], T>) {\n return Message<T>(function NewImpl(resolve) {\n resolve(construct());\n });\n}\n","/**\n * Resolver that does nothing with the passed value,\n * needed for silent message triggering\n */\nexport function Void() {\n return () => {};\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\ntype ExtractTypeS<T> = T extends MaybeMessage<infer U> ? U : never;\n\ntype ExtractTypesFromArrayS<T extends MaybeMessage<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\nconst isAllFilled = (keysFilled: Set<string>, keysKnown: Set<string>) => {\n return keysFilled.size > 0 && keysFilled.size === keysKnown.size;\n};\n\n/**\n * A message that represents values from\n * all provided messages as an array.\n * When all messages emit their values,\n * the combined value will be returned.\n * If at least one message later emits a new\n * value, the updated array with the new value\n * will be emitted by All.\n */\nexport function All<const T extends MaybeMessage[]>(...messages: T) {\n const $messages = messages.map(ActualMessage);\n return Message<ExtractTypesFromArrayS<T>>(function AllImpl(r) {\n const known = new Set<string>(Object.keys(messages));\n const filled = new Set<string>();\n const result: unknown[] = [];\n if (known.size === 0) {\n r([] as ExtractTypesFromArrayS<T>);\n return;\n }\n $messages.map((m, key) => {\n m.then((v) => {\n filled.add(key.toString());\n result[key] = v;\n if (isAllFilled(filled, known)) {\n r(result as ExtractTypesFromArrayS<T>);\n }\n });\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * A message that emits values received from\n * any of its bound messages\n */\nexport function Any<const T>(...messages: MaybeMessage<T>[]) {\n const $messages = messages.map(ActualMessage);\n return Message<T>(function AnyImpl(r) {\n $messages.forEach((message) => {\n message.then(r);\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * An message that applies a function\n * to the value of the base message\n */\nexport function Applied<const T, R>(\n base: MaybeMessage<T>,\n applier: ConstructorType<[T], R>,\n) {\n const $base = ActualMessage(base);\n return Message<R>(function AppliedImpl(r) {\n $base.then((v) => {\n r(applier(v));\n });\n });\n}\n","import { Applied } from \"components/Applied\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * Allows applying variables from an message that passes an array to a function,\n * where each element of the array will be passed as a separate argument\n */\nexport function AppliedDestructured<const T extends any[], R>(\n $base: MaybeMessage<T>,\n applier: ConstructorType<T[number][], R>,\n) {\n return Applied($base, function AppliedDestructuredImpl(args) {\n return applier(...args);\n });\n}\n","import { Rejections } from \"base/Rejections\";\nimport { isFilled } from \"helpers/guards\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MessageSourceType } from \"types/SourceType\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport function Late<T>(v?: T) {\n return new LateImpl<T>(v);\n}\n\nexport class LateImpl<T> implements MessageSourceType<T> {\n private rejections = new Rejections();\n private lateR: ConstructorType<[T]> | null = null;\n private notify = () => {\n if (isFilled(this.v) && this.lateR) {\n try {\n this.lateR(this.v);\n } catch (e: any) {\n this.rejections.reject(e);\n }\n }\n };\n\n public constructor(private v?: T) {}\n\n public then(r: ConstructorType<[T]>): this {\n if (this.lateR) {\n throw new Error(\n \"Late component gets new resolver, when another was already connected!\",\n );\n }\n this.lateR = r;\n this.notify();\n return this;\n }\n\n public use(value: T): this {\n this.v = value;\n this.notify();\n return this;\n }\n\n public catch(rejected: ConstructorType<[unknown]>) {\n this.rejections.catch(rejected);\n return this;\n }\n}\n","import { Rejections } from \"base/Rejections\";\nimport { Late } from \"components/Late\";\nimport { MessageType } from \"types/MessageType\";\n\n/**\n * Message with error catched\n * inside another message\n */\nexport function Catch<T>($base: MessageType) {\n const rejections = new Rejections();\n $base.catch(rejections.reject);\n const $error = Late<T>();\n rejections.catch((e) => {\n $error.use(e as T);\n });\n\n return $error;\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MessageType, MessageTypeValue } from \"types/MessageType\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends readonly any[]> = T extends readonly [...infer _, infer L]\n ? L\n : never;\n\n/**\n * Chains messages together and triggers\n * the last message only when all previous messages\n * have emitted their values. The value of Chain will be the value\n * of the last message. If any messages\n * emit a value again after the overall Chain response was already returned,\n * then Chain emits again with the value of the last message.\n */\nexport function Chain<T extends readonly MessageType[]>(...messages: T) {\n const $messages = messages.map(ActualMessage);\n return Message<MessageTypeValue<Last<T>>>(function ChainImpl(r) {\n let $latest: MessageTypeValue<Last<T>> | undefined;\n const handleMessage = (index: number) => {\n const message = $messages[index] as Last<T>;\n const next = $messages[index + 1] as Last<T> | undefined;\n message.then((v) => {\n oneMessage(v as MessageTypeValue<Last<T>>, next, index);\n });\n };\n function oneMessage(\n v: MessageTypeValue<Last<T>>,\n next: Last<T> | undefined,\n index: number,\n ) {\n if (!next) {\n $latest = v as MessageTypeValue<Last<T>>;\n }\n if ($latest) {\n r($latest);\n }\n if (next && !$latest) {\n handleMessage(index + 1);\n }\n }\n handleMessage(0);\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { ContextType } from \"types/ContextType\";\nimport { MaybeMessage } from \"types/MessageType\";\n\nContext.transport = new Map<any, ConstructorType<[ContextType]>>();\n\n/**\n * The ability to call an external system through\n * sending a message in a standardized format\n * ContextType, the list of transport should be defined via\n * the Context.transport map object\n */\nexport function Context<T>(msg: MaybeMessage<ContextType>) {\n const $msg = ActualMessage(msg);\n return Message<T>((resolve, reject) => {\n $msg.then((message) => {\n const transport = Context.transport.get(message.transport);\n if (transport === undefined) {\n throw new Error(`Context: unknown transport ${message.transport}`);\n }\n if (!message.result) {\n message.result = resolve;\n }\n if (!message.error) {\n message.error = reject;\n }\n try {\n transport(message);\n } catch (error) {\n reject(error);\n }\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { MaybeMessage } from \"types/MessageType\";\nimport { ContextType } from \"types/ContextType\";\n\n/**\n * Connects an external message to an RPC message chain\n */\nexport function ContextChain($base: MaybeMessage) {\n return (context: ContextType) => {\n if (!context.result) {\n throw new Error(\"ContextChain did not find result in rpc message\");\n }\n ActualMessage($base).then(context.result);\n };\n}\n","import { MessageType } from \"types/MessageType\";\n\n/**\n * Helps represent an message as a primitive type, which can be useful\n * for cases when you need to always have a reference to the current value\n * without updating the shared value when the current one changes.\n * For example, this could be used when passing an authorization token.\n * It can also be useful for testing or logging purposes.\n */\nexport function Primitive<T>($base: MessageType<T>, theValue: T | null = null) {\n return new PrimitiveImpl<T>($base, theValue);\n}\n\nexport class PrimitiveImpl<T> {\n private touched = false;\n\n public constructor(\n private $base: MessageType<T>,\n private theValue: T | null = null,\n ) {}\n\n private ensureTouched() {\n if (!this.touched) {\n this.$base.then((v) => {\n this.theValue = v;\n });\n }\n this.touched = true;\n }\n\n public [Symbol.toPrimitive]() {\n this.ensureTouched();\n return this.theValue;\n }\n\n public primitive() {\n this.ensureTouched();\n return this.theValue;\n }\n\n public primitiveWithException() {\n this.ensureTouched();\n if (this.theValue === null) {\n throw new Error(\"Primitive value is null\");\n }\n return this.theValue;\n }\n}\n","import { MessageType } from \"types/MessageType\";\nimport { MessageSourceType, SourceType } from \"types/SourceType\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { isFilled, isSource } from \"helpers/guards\";\nimport { Primitive } from \"components/Primitive\";\nimport { ChainableType } from \"types/ChainableType\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n */\nexport function Shared<T>($base: MessageType<T>, source?: SourceType<T>) {\n return new SharedImpl<T>($base, source);\n}\n\nexport class SharedImpl<T> implements MessageSourceType<T>, ChainableType<T> {\n private resolver = (v: T) => {\n this.lastV = v;\n this.resolvers.forEach((r) => {\n r(v);\n });\n };\n private lastV: T | undefined;\n private resolvers = new Set<ConstructorType<[T]>>();\n\n public constructor(\n private $base: MessageType<T>,\n private source?: SourceType<T>,\n ) {\n if (isSource($base)) {\n this.source = $base;\n }\n }\n\n public then(resolved: ConstructorType<[T]>) {\n this.resolvers.add(resolved);\n if (this.resolvers.size === 1) {\n this.$base.then(this.resolver);\n } else if (isFilled(this.lastV)) {\n resolved(this.lastV);\n }\n return this;\n }\n\n public use(value: T) {\n if (this.source) {\n this.source.use(value);\n } else {\n this.resolver(value);\n }\n return this;\n }\n\n public catch(rejected: ConstructorType<[unknown]>) {\n this.$base.catch(rejected);\n return this;\n }\n\n public destroy() {\n this.resolvers.clear();\n return this;\n }\n\n public value() {\n return Primitive(this);\n }\n\n public chain(m: MessageType<T>) {\n m.then(this.use.bind(this));\n return this;\n }\n}\n","import { Late } from \"components/Late\";\nimport { Shared } from \"components/Shared\";\n\n/**\n * An message with a value that will be set later,\n * capable of responding to many resolvers\n */\nexport function LateShared<T>(value?: T) {\n const l = Late(value);\n return Shared(l, l);\n}\n","import { Message } from \"base/Message\";\nimport { LateShared } from \"components/LateShared\";\nimport { Context } from \"components/Context\";\nimport { ContextType } from \"types/ContextType\";\n\n/**\n * Message for the arrival of a specific RPC message\n * for specific transport\n */\nexport function ContextOf(transport: string) {\n const $msg = LateShared<ContextType>();\n Context.transport.set(transport, $msg.use.bind($msg));\n return Message<ContextType>((t) => {\n $msg.then(t);\n });\n}\n","import { Message } from \"base/Message\";\nimport { MessageType } from \"types/MessageType\";\n\ntype ExecutorApplier<T> = (executor: (v: T) => void) => (v: T) => void;\n\n/**\n * Applies a value transfer function to the resolver\n * and returns the same value transfer function for the resolver\n * Useful for applying functions like debounced or throttle\n */\nexport function ExecutorApplied<T>(\n $base: MessageType<T>,\n applier: ExecutorApplier<T>,\n) {\n return Message<T>(function ExecutorAppliedImpl(r) {\n $base.then(applier(r));\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MaybeMessage, MessageType } from \"types/MessageType\";\n\n/**\n * Filters values from the source message based on a predicate function,\n * optionally providing a default value when the predicate fails.\n */\nexport function Filtered<T>(\n base: MaybeMessage<T>,\n predicate: ConstructorType<[T], boolean>,\n defaultValue?: T,\n): MessageType<T> {\n const $base = ActualMessage(base);\n return Message<T>(function FilteredImpl(r) {\n $base.then((v) => {\n if (predicate(v)) {\n r(v);\n } else if (defaultValue !== undefined) {\n r(defaultValue);\n }\n });\n });\n}\n","import { MaybeMessage } from \"types/MessageType\";\nimport { All } from \"components/All\";\nimport { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\n\n/**\n * A message derived from event with a different\n * method call interface, based on callbacks.\n * Allows attaching a custom handler to an existing event source\n * and presenting it as a silentium message\n */\nexport function FromEvent<T>(\n emitter: MaybeMessage<any>,\n eventName: MaybeMessage<string>,\n subscribeMethod: MaybeMessage<string>,\n unsubscribeMethod?: MaybeMessage<string>,\n) {\n const $emitter = ActualMessage(emitter);\n const $eventName = ActualMessage(eventName);\n const $subscribeMethod = ActualMessage(subscribeMethod);\n const $unsubscribeMethod = ActualMessage(unsubscribeMethod);\n return Message<T>((r) => {\n let lastR: ConstructorType<[T]> | null = null;\n const handler = (v: T) => {\n if (lastR) {\n lastR(v);\n }\n };\n All($emitter, $eventName, $subscribeMethod).then(\n ([emitter, eventName, subscribe]) => {\n lastR = r;\n if (!emitter?.[subscribe]) {\n return;\n }\n emitter[subscribe](eventName, handler);\n },\n );\n return () => {\n lastR = null;\n if (!$unsubscribeMethod) {\n return;\n }\n All($emitter, $eventName, $unsubscribeMethod).then(\n ([emitter, eventName, unsubscribe]) => {\n emitter?.[unsubscribe as string]?.(eventName, handler);\n },\n );\n };\n });\n}\n","import { MaybeMessage, MessageType } from \"types/MessageType\";\nimport { All } from \"components/All\";\nimport { isMessage } from \"helpers/guards\";\nimport { Of } from \"base/Of\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { Message } from \"base/Message\";\nimport { ActualMessage } from \"base/ActualMessage\";\nimport { DestroyContainer } from \"base/DestroyContainer\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n */\nexport function Map<T, TG>(\n base: MaybeMessage<T[]>,\n target: ConstructorType<[any], MessageType<TG>>,\n) {\n const $base = ActualMessage(base);\n return Message<TG[]>((r) => {\n const infos: MessageType<TG>[] = [];\n const dc = DestroyContainer();\n $base.then((v) => {\n dc.destroy();\n v.forEach((val) => {\n let $val: MessageType<T> | T = val;\n if (!isMessage($val as object)) {\n $val = Of($val);\n }\n const info = target($val);\n dc.add(info);\n infos.push(info);\n });\n All(...infos).then(r);\n });\n });\n}\n","import { Message } from \"base/Message\";\nimport { MessageType } from \"types/MessageType\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n */\nexport function Once<T>($base: MessageType<T>) {\n return Message<T>((r) => {\n let isFilled = false;\n $base.then((v) => {\n if (!isFilled) {\n isFilled = true;\n r(v);\n }\n });\n });\n}\n","import { Message } from \"base/Message\";\nimport { MessageType } from \"types/MessageType\";\n\n/**\n * Creates a sequence that accumulates all values from the source into an array,\n * emitting the growing array with each new value.\n */\nexport function Sequence<T>($base: MessageType<T>) {\n return Message<T[]>((r) => {\n const result: T[] = [];\n $base.then((v) => {\n result.push(v);\n r(result);\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * Component that receives a data array and yields values one by one\n */\nexport function Stream<T>(base: MaybeMessage<T[]>) {\n const $base = ActualMessage(base);\n return Message<T>((r) => {\n $base.then((v) => {\n v.forEach((cv) => {\n r(cv);\n });\n });\n });\n}\n"],"names":["__publicField","emitter","eventName","Map"],"mappings":";;AAOO,MAAM,QAAA,GAAW,CACtB,KAAA,KAC0C;AAC1C,EAAA,OAAO,KAAA,KAAU,UAAa,KAAA,KAAU,IAAA;AAC1C;AAKO,SAAS,UAAU,CAAA,EAA8B;AACtD,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,MAAA,IAAU,CAAA,IACV,OAAQ,CAAA,CAAU,IAAA,KAAS,UAAA;AAE/B;AAKO,SAAS,SAAS,CAAA,EAA6B;AACpD,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,KAAA,IAAS,CAAA,IACT,OAAQ,CAAA,CAAU,GAAA,KAAQ,UAAA;AAE9B;AAKO,SAAS,cAAc,CAAA,EAAkC;AAC9D,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,SAAA,IAAa,CAAA,IACb,OAAQ,CAAA,CAAU,OAAA,KAAY,UAAA;AAElC;AAKO,SAAS,YAAY,CAAA,EAAgC;AAC1D,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,WAAA,IAAe,CAAA,IACf,OAAQ,CAAA,CAAU,SAAA,KAAc,UAAA;AAEpC;;ACpDO,SAAS,YAAe,IAAA,EAAS;AACtC,EAAA,OAAO,IAAI,gBAAgB,IAAI,CAAA;AACjC;AAEO,MAAM,eAAA,CAA8C;AAAA,EAClD,YAAoB,IAAA,EAAS;AAA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A,CAAO,KAAK,CAAC,CAAA;AACb,MAAA,CAAA,CAAE,MAAM,CAAA;AAAA,IACV,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH;;ACRO,SAAS,OAAU,IAAA,EAAyB;AACjD,EAAA,MAAM,KAAA,GAAQ,cAAc,IAAI,CAAA;AAChC,EAAA,OAAO,OAAA,CAAW,CAAC,CAAA,KAAM;AACvB,IAAA,KAAA,CAAM,IAAA,CAAK,CAAC,CAAA,KAAM;AAChB,MAAA,CAAA,CAAE,OAAA,CAAQ,CAAC,EAAA,KAAO;AAChB,QAAA,CAAA,CAAE,EAAE,CAAA;AAAA,MACN,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"silentium.cjs","sources":["../src/helpers/guards.ts","../src/base/Destroyable.ts","../src/base/DestroyContainer.ts","../src/base/Rejections.ts","../src/components/Late.ts","../src/components/Primitive.ts","../src/components/Shared.ts","../src/components/LateShared.ts","../src/helpers/ensures.ts","../src/base/Message.ts","../src/base/Of.ts","../src/base/ActualMessage.ts","../src/base/Chainable.ts","../src/base/Local.ts","../src/base/MessageSource.ts","../src/base/New.ts","../src/base/Void.ts","../src/components/All.ts","../src/components/Any.ts","../src/components/Applied.ts","../src/components/AppliedDestructured.ts","../src/components/Catch.ts","../src/components/Chain.ts","../src/components/Context.ts","../src/components/ContextChain.ts","../src/components/ContextOf.ts","../src/components/ExecutorApplied.ts","../src/components/Filtered.ts","../src/components/FromEvent.ts","../src/components/Map.ts","../src/components/Once.ts","../src/components/Sequence.ts","../src/components/Stream.ts"],"sourcesContent":["import { DestroyableType, DestroyedType } from \"types/DestroyableType\";\nimport { MessageType } from \"types/MessageType\";\nimport { SourceType } from \"types/SourceType\";\n\n/**\n * Checks that the value is neither undefined nor null\n */\nexport const isFilled = <T>(\n value?: T,\n): value is Exclude<T, null | undefined> => {\n return value !== undefined && value !== null;\n};\n\n/**\n * Checks that the object is an message\n */\nexport function isMessage(o: unknown): o is MessageType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"then\" in o &&\n typeof (o as any).then === \"function\"\n );\n}\n\n/**\n * Checks that the object is an message\n */\nexport function isSource(o: unknown): o is SourceType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"use\" in o &&\n typeof (o as any).use === \"function\"\n );\n}\n\n/**\n * Checks that the object is destroyable\n */\nexport function isDestroyable(o: unknown): o is DestroyableType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"destroy\" in o &&\n typeof (o as any).destroy === \"function\"\n );\n}\n\n/**\n * Checks that the object can indicate whether it has been destroyed or not\n */\nexport function isDestroyed(o: unknown): o is DestroyedType {\n return (\n o !== null &&\n typeof o === \"object\" &&\n \"destroyed\" in o &&\n typeof (o as any).destroyed === \"function\"\n );\n}\n","import { isDestroyable } from \"helpers/guards\";\nimport { DestroyableType } from \"types/DestroyableType\";\n\n/**\n * Allows creating an object that definitely has a destructor,\n * useful to avoid creating unnecessary conditions\n */\nexport function Destroyable<T>(base: T) {\n return new DestroyableImpl(base);\n}\n\nexport class DestroyableImpl<T> implements DestroyableType {\n public constructor(private base: T) {}\n\n public destroy(): this {\n if (isDestroyable(this.base)) {\n this.base.destroy();\n }\n\n if (typeof this.base === \"function\") {\n this.base();\n }\n\n return this;\n }\n}\n","import { Destroyable } from \"base/Destroyable\";\nimport { DestroyableType } from \"types/DestroyableType\";\n\n/**\n * An object that allows collecting all disposable objects and\n * disposing them later all together\n */\nexport function DestroyContainer() {\n return new DestroyContainerImpl();\n}\n\nexport class DestroyContainerImpl implements DestroyableType {\n private destructors: DestroyableType[] = [];\n\n public add<R>(e: R): R {\n this.destructors.push(Destroyable(e));\n return e;\n }\n\n public destroy() {\n this.destructors.forEach((d) => d.destroy());\n this.destructors.length = 0;\n return this;\n }\n}\n","import { ConstructorType } from \"types/ConstructorType\";\n\n/**\n * Handles rejections collection\n */\nexport class Rejections {\n private catchers: ConstructorType<[unknown]>[] = [];\n private lastRejectReason: unknown = null;\n\n public reject = (reason: unknown) => {\n this.lastRejectReason = reason;\n this.catchers.forEach((catcher) => {\n catcher(reason);\n });\n };\n\n public catch(rejected: ConstructorType<[unknown]>) {\n if (this.lastRejectReason !== null) {\n rejected(this.lastRejectReason);\n }\n this.catchers.push(rejected);\n return this;\n }\n\n public destroy() {\n this.catchers.length = 0;\n return this;\n }\n}\n","import { Rejections } from \"base/Rejections\";\nimport { isFilled } from \"helpers/guards\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MessageSourceType } from \"types/SourceType\";\n\n/**\n * A component that allows creating linked objects of information and its owner\n * in such a way that if a new value is assigned to the owner, this value\n * will become the value of the linked information source\n * https://silentium-lab.github.io/silentium/#/en/information/of\n */\nexport function Late<T>(v?: T) {\n return new LateImpl<T>(v);\n}\n\nexport class LateImpl<T> implements MessageSourceType<T> {\n private rejections = new Rejections();\n private lateR: ConstructorType<[T]> | null = null;\n private notify = () => {\n if (isFilled(this.v) && this.lateR) {\n try {\n this.lateR(this.v);\n } catch (e: any) {\n this.rejections.reject(e);\n }\n }\n };\n\n public constructor(private v?: T) {}\n\n public then(r: ConstructorType<[T]>): this {\n if (this.lateR) {\n throw new Error(\n \"Late component gets new resolver, when another was already connected!\",\n );\n }\n this.lateR = r;\n this.notify();\n return this;\n }\n\n public use(value: T): this {\n this.v = value;\n this.notify();\n return this;\n }\n\n public catch(rejected: ConstructorType<[unknown]>) {\n this.rejections.catch(rejected);\n return this;\n }\n}\n","import { MessageType } from \"types/MessageType\";\n\n/**\n * Helps represent an message as a primitive type, which can be useful\n * for cases when you need to always have a reference to the current value\n * without updating the shared value when the current one changes.\n * For example, this could be used when passing an authorization token.\n * It can also be useful for testing or logging purposes.\n */\nexport function Primitive<T>($base: MessageType<T>, theValue: T | null = null) {\n return new PrimitiveImpl<T>($base, theValue);\n}\n\nexport class PrimitiveImpl<T> {\n private touched = false;\n\n public constructor(\n private $base: MessageType<T>,\n private theValue: T | null = null,\n ) {}\n\n private ensureTouched() {\n if (!this.touched) {\n this.$base.then((v) => {\n this.theValue = v;\n });\n }\n this.touched = true;\n }\n\n public [Symbol.toPrimitive]() {\n this.ensureTouched();\n return this.theValue;\n }\n\n public primitive() {\n this.ensureTouched();\n return this.theValue;\n }\n\n public primitiveWithException() {\n this.ensureTouched();\n if (this.theValue === null) {\n throw new Error(\"Primitive value is null\");\n }\n return this.theValue;\n }\n}\n","import { MessageType } from \"types/MessageType\";\nimport { MessageSourceType, SourceType } from \"types/SourceType\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { isFilled, isSource } from \"helpers/guards\";\nimport { Primitive } from \"components/Primitive\";\nimport { ChainableType } from \"types/ChainableType\";\n\n/**\n * An information object that helps multiple owners access\n * a single another information object\n */\nexport function Shared<T>($base: MessageType<T>, source?: SourceType<T>) {\n return new SharedImpl<T>($base, source);\n}\n\nexport class SharedImpl<T> implements MessageSourceType<T>, ChainableType<T> {\n private resolver = (v: T) => {\n this.lastV = v;\n this.resolvers.forEach((r) => {\n r(v);\n });\n };\n private lastV: T | undefined;\n private resolvers = new Set<ConstructorType<[T]>>();\n\n public constructor(\n private $base: MessageType<T>,\n private source?: SourceType<T>,\n ) {\n if (isSource($base)) {\n this.source = $base;\n }\n }\n\n public then(resolved: ConstructorType<[T]>) {\n this.resolvers.add(resolved);\n if (this.resolvers.size === 1) {\n this.$base.then(this.resolver);\n } else if (isFilled(this.lastV)) {\n resolved(this.lastV);\n }\n return this;\n }\n\n public use(value: T) {\n if (this.source) {\n this.source.use(value);\n } else {\n this.resolver(value);\n }\n return this;\n }\n\n public catch(rejected: ConstructorType<[unknown]>) {\n this.$base.catch(rejected);\n return this;\n }\n\n public destroy() {\n this.resolvers.clear();\n return this;\n }\n\n public value() {\n return Primitive(this);\n }\n\n public chain(m: MessageType<T>) {\n m.then(this.use.bind(this));\n return this;\n }\n}\n","import { Late } from \"components/Late\";\nimport { Shared } from \"components/Shared\";\n\n/**\n * An message with a value that will be set later,\n * capable of responding to many resolvers\n */\nexport function LateShared<T>(value?: T) {\n const l = Late(value);\n return Shared(l, l);\n}\n","import { isMessage } from \"helpers/guards\";\n\nexport function ensureFunction(v: unknown, label: string) {\n if (typeof v !== \"function\") {\n throw new Error(`${label}: is not function`);\n }\n}\n\nexport function ensureMessage(v: unknown, label: string) {\n if (!isMessage(v)) {\n throw new Error(`${label}: is not message`);\n }\n}\n","import { DestroyContainer } from \"base/DestroyContainer\";\nimport { Rejections } from \"base/Rejections\";\nimport { LateShared } from \"components/LateShared\";\nimport { ensureFunction } from \"helpers/ensures\";\nimport { isMessage } from \"helpers/guards\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { DestroyableType } from \"types/DestroyableType\";\nimport { MessageType } from \"types/MessageType\";\n\nexport type MessageExecutorType<T> = (\n resolve: ConstructorType<[T]>,\n reject: ConstructorType<[unknown]>,\n) => MessageType | (() => void) | void;\n\n/**\n * A message created from an executor function.\n * The executor function can return a message destruction function.\n */\nexport function Message<T>(executor: MessageExecutorType<T>) {\n return new MessageRx<T>(executor);\n}\n\n/**\n * Reactive message implementation\n */\nexport class MessageRx<T> implements MessageType<T>, DestroyableType {\n private rejections = new Rejections();\n private dc = DestroyContainer();\n\n public constructor(private executor: MessageExecutorType<T>) {\n ensureFunction(executor, \"Message: executor\");\n }\n\n public then(resolve: ConstructorType<[T]>) {\n const thenResult = LateShared<T>();\n try {\n const proxyResolve = (v: T) => {\n const result = resolve(v);\n this.dc.add(result);\n if (isMessage(result)) {\n thenResult.chain(result as MessageType<T>);\n } else {\n thenResult.use(v);\n }\n };\n this.dc.add(this.executor(proxyResolve, this.rejections.reject));\n } catch (e: any) {\n this.rejections.reject(e);\n }\n return thenResult;\n }\n\n public catch(rejected: ConstructorType<[unknown]>) {\n this.rejections.catch(rejected);\n return this;\n }\n\n public destroy() {\n this.dc.destroy();\n this.rejections.destroy();\n return this;\n }\n}\n","import { Message } from \"base/Message\";\n\n/**\n * Helps convert a value into a message\n */\nexport function Of<T>(value: T) {\n return Message<T>(function OfImpl(r) {\n r(value);\n });\n}\n","import { Of } from \"base/Of\";\nimport { isMessage } from \"helpers/guards\";\nimport { MaybeMessage, MessageType } from \"types/MessageType\";\n\n/**\n * A function that helps to ensure that\n * the message is indeed a message object\n * and not just a value\n */\nexport function ActualMessage<T>(message: MaybeMessage<T>): MessageType<T> {\n return isMessage(message) ? message : Of(message);\n}\n","import { ChainableType } from \"types/ChainableType\";\nimport { MessageType } from \"types/MessageType\";\nimport { SourceType } from \"types/SourceType\";\n\n/**\n * Helps to connect Different\n * message and source\n */\nexport function Chainable<T>(src: SourceType<T>) {\n return new ChainableImpl(src);\n}\n\nexport class ChainableImpl<T> implements ChainableType<T> {\n public constructor(private src: SourceType<T>) {}\n\n public chain($m: MessageType<T>) {\n $m.then(this.src.use.bind(this.src));\n return this;\n }\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * Create local copy of source what can be destroyed\n */\nexport function Local<T>(_base: MaybeMessage<T>) {\n const $base = ActualMessage(_base);\n return Message<T>(function LocalImpl(r) {\n let destroyed = false;\n $base.then((v) => {\n if (!destroyed) {\n r(v);\n }\n });\n return () => {\n destroyed = true;\n };\n });\n}\n","import { Message, MessageExecutorType, MessageRx } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MessageSourceType } from \"types/SourceType\";\n\n/**\n * Base message source object\n */\nexport function MessageSource<T>(\n messageExecutor: MessageExecutorType<T>,\n sourceExecutor: ConstructorType<[T]>,\n) {\n return new MessageSourceImpl(messageExecutor, sourceExecutor);\n}\n\nexport class MessageSourceImpl<T> implements MessageSourceType<T> {\n private message: MessageRx<T>;\n\n public constructor(\n messageExecutor: MessageExecutorType<T>,\n private sourceExecutor: ConstructorType<[T]>,\n ) {\n this.message = Message(messageExecutor);\n }\n\n public use(value: T): this {\n this.sourceExecutor(value);\n return this;\n }\n\n public then(resolved: ConstructorType<[T]>): this {\n this.message.then(resolved);\n return this;\n }\n\n public catch(rejected: ConstructorType<[unknown]>): this {\n this.message.catch(rejected);\n return this;\n }\n}\n","import { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\n\n/**\n * A component that, on each access, returns a new instance\n * of a reference type based on the constructor function\n */\nexport function New<T>(construct: ConstructorType<[], T>) {\n return Message<T>(function NewImpl(resolve) {\n resolve(construct());\n });\n}\n","/**\n * Resolver that does nothing with the passed value,\n * needed for silent message triggering\n */\nexport function Void() {\n return () => {};\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\ntype ExtractTypeS<T> = T extends MaybeMessage<infer U> ? U : never;\n\ntype ExtractTypesFromArrayS<T extends MaybeMessage<any>[]> = {\n [K in keyof T]: ExtractTypeS<T[K]>;\n};\n\nconst isAllFilled = (keysFilled: Set<string>, keysKnown: Set<string>) => {\n return keysFilled.size > 0 && keysFilled.size === keysKnown.size;\n};\n\n/**\n * A message that represents values from\n * all provided messages as an array.\n * When all messages emit their values,\n * the combined value will be returned.\n * If at least one message later emits a new\n * value, the updated array with the new value\n * will be emitted by All.\n */\nexport function All<const T extends MaybeMessage[]>(...messages: T) {\n const $messages = messages.map(ActualMessage);\n return Message<ExtractTypesFromArrayS<T>>(function AllImpl(r) {\n const known = new Set<string>(Object.keys(messages));\n const filled = new Set<string>();\n const result: unknown[] = [];\n if (known.size === 0) {\n r([] as ExtractTypesFromArrayS<T>);\n return;\n }\n $messages.map((m, key) => {\n m.then((v) => {\n filled.add(key.toString());\n result[key] = v;\n if (isAllFilled(filled, known)) {\n r(result as ExtractTypesFromArrayS<T>);\n }\n });\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * A message that emits values received from\n * any of its bound messages\n */\nexport function Any<const T>(...messages: MaybeMessage<T>[]) {\n const $messages = messages.map(ActualMessage);\n return Message<T>(function AnyImpl(r) {\n $messages.forEach((message) => {\n message.then(r);\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * An message that applies a function\n * to the value of the base message\n */\nexport function Applied<const T, R>(\n base: MaybeMessage<T>,\n applier: ConstructorType<[T], R>,\n) {\n const $base = ActualMessage(base);\n return Message<R>(function AppliedImpl(r) {\n $base.then((v) => {\n r(applier(v));\n });\n });\n}\n","import { Applied } from \"components/Applied\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * Allows applying variables from an message that passes an array to a function,\n * where each element of the array will be passed as a separate argument\n */\nexport function AppliedDestructured<const T extends any[], R>(\n $base: MaybeMessage<T>,\n applier: ConstructorType<T[number][], R>,\n) {\n return Applied($base, function AppliedDestructuredImpl(args) {\n return applier(...args);\n });\n}\n","import { Rejections } from \"base/Rejections\";\nimport { Late } from \"components/Late\";\nimport { MessageType } from \"types/MessageType\";\n\n/**\n * Message with error catched\n * inside another message\n */\nexport function Catch<T>($base: MessageType) {\n const rejections = new Rejections();\n $base.catch(rejections.reject);\n const $error = Late<T>();\n rejections.catch((e) => {\n $error.use(e as T);\n });\n\n return $error;\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MessageType, MessageTypeValue } from \"types/MessageType\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ntype Last<T extends readonly any[]> = T extends readonly [...infer _, infer L]\n ? L\n : never;\n\n/**\n * Chains messages together and triggers\n * the last message only when all previous messages\n * have emitted their values. The value of Chain will be the value\n * of the last message. If any messages\n * emit a value again after the overall Chain response was already returned,\n * then Chain emits again with the value of the last message.\n */\nexport function Chain<T extends readonly MessageType[]>(...messages: T) {\n const $messages = messages.map(ActualMessage);\n return Message<MessageTypeValue<Last<T>>>(function ChainImpl(r) {\n let $latest: MessageTypeValue<Last<T>> | undefined;\n const handleMessage = (index: number) => {\n const message = $messages[index] as Last<T>;\n const next = $messages[index + 1] as Last<T> | undefined;\n message.then((v) => {\n oneMessage(v as MessageTypeValue<Last<T>>, next, index);\n });\n };\n function oneMessage(\n v: MessageTypeValue<Last<T>>,\n next: Last<T> | undefined,\n index: number,\n ) {\n if (!next) {\n $latest = v as MessageTypeValue<Last<T>>;\n }\n if ($latest) {\n r($latest);\n }\n if (next && !$latest) {\n handleMessage(index + 1);\n }\n }\n handleMessage(0);\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { ContextType } from \"types/ContextType\";\nimport { MaybeMessage } from \"types/MessageType\";\n\nContext.transport = new Map<any, ConstructorType<[ContextType]>>();\n\n/**\n * The ability to call an external system through\n * sending a message in a standardized format\n * ContextType, the list of transport should be defined via\n * the Context.transport map object\n */\nexport function Context<T>(msg: MaybeMessage<ContextType>) {\n const $msg = ActualMessage(msg);\n return Message<T>((resolve, reject) => {\n $msg.then((message) => {\n const transport = Context.transport.get(message.transport);\n if (transport === undefined) {\n throw new Error(`Context: unknown transport ${message.transport}`);\n }\n if (!message.result) {\n message.result = resolve;\n }\n if (!message.error) {\n message.error = reject;\n }\n try {\n transport(message);\n } catch (error) {\n reject(error);\n }\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { MaybeMessage } from \"types/MessageType\";\nimport { ContextType } from \"types/ContextType\";\n\n/**\n * Connects an external message to an RPC message chain\n */\nexport function ContextChain(base: MaybeMessage) {\n const $base = ActualMessage(base);\n return (context: ContextType) => {\n if (!context.result) {\n throw new Error(\"ContextChain did not find result in rpc message\");\n }\n $base.then(context.result);\n };\n}\n","import { Message } from \"base/Message\";\nimport { LateShared } from \"components/LateShared\";\nimport { Context } from \"components/Context\";\nimport { ContextType } from \"types/ContextType\";\n\n/**\n * Message for the arrival of a specific RPC message\n * for specific transport\n */\nexport function ContextOf(transport: string) {\n const $msg = LateShared<ContextType>();\n Context.transport.set(transport, $msg.use.bind($msg));\n return Message<ContextType>((t) => {\n $msg.then(t);\n });\n}\n","import { Message } from \"base/Message\";\nimport { MessageType } from \"types/MessageType\";\n\ntype ExecutorApplier<T> = (executor: (v: T) => void) => (v: T) => void;\n\n/**\n * Applies a value transfer function to the resolver\n * and returns the same value transfer function for the resolver\n * Useful for applying functions like debounced or throttle\n */\nexport function ExecutorApplied<T>(\n $base: MessageType<T>,\n applier: ExecutorApplier<T>,\n) {\n return Message<T>(function ExecutorAppliedImpl(r) {\n $base.then(applier(r));\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { MaybeMessage, MessageType } from \"types/MessageType\";\n\n/**\n * Filters values from the source message based on a predicate function,\n * optionally providing a default value when the predicate fails.\n */\nexport function Filtered<T>(\n base: MaybeMessage<T>,\n predicate: ConstructorType<[T], boolean>,\n defaultValue?: T,\n): MessageType<T> {\n const $base = ActualMessage(base);\n return Message<T>(function FilteredImpl(r) {\n $base.then((v) => {\n if (predicate(v)) {\n r(v);\n } else if (defaultValue !== undefined) {\n r(defaultValue);\n }\n });\n });\n}\n","import { MaybeMessage } from \"types/MessageType\";\nimport { All } from \"components/All\";\nimport { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { ConstructorType } from \"types/ConstructorType\";\n\n/**\n * A message derived from event with a different\n * method call interface, based on callbacks.\n * Allows attaching a custom handler to an existing event source\n * and presenting it as a silentium message\n */\nexport function FromEvent<T>(\n emitter: MaybeMessage<any>,\n eventName: MaybeMessage<string>,\n subscribeMethod: MaybeMessage<string>,\n unsubscribeMethod?: MaybeMessage<string>,\n) {\n const $emitter = ActualMessage(emitter);\n const $eventName = ActualMessage(eventName);\n const $subscribeMethod = ActualMessage(subscribeMethod);\n const $unsubscribeMethod = ActualMessage(unsubscribeMethod);\n return Message<T>((r) => {\n let lastR: ConstructorType<[T]> | null = null;\n const handler = (v: T) => {\n if (lastR) {\n lastR(v);\n }\n };\n All($emitter, $eventName, $subscribeMethod).then(\n ([emitter, eventName, subscribe]) => {\n lastR = r;\n if (!emitter?.[subscribe]) {\n return;\n }\n emitter[subscribe](eventName, handler);\n },\n );\n return () => {\n lastR = null;\n if (!$unsubscribeMethod) {\n return;\n }\n All($emitter, $eventName, $unsubscribeMethod).then(\n ([emitter, eventName, unsubscribe]) => {\n emitter?.[unsubscribe as string]?.(eventName, handler);\n },\n );\n };\n });\n}\n","import { MaybeMessage, MessageType } from \"types/MessageType\";\nimport { All } from \"components/All\";\nimport { isMessage } from \"helpers/guards\";\nimport { Of } from \"base/Of\";\nimport { ConstructorType } from \"types/ConstructorType\";\nimport { Message } from \"base/Message\";\nimport { ActualMessage } from \"base/ActualMessage\";\nimport { DestroyContainer } from \"base/DestroyContainer\";\n\n/**\n * Component that applies an info object constructor to each data item,\n * producing an information source with new values\n */\nexport function Map<T, TG>(\n base: MaybeMessage<T[]>,\n target: ConstructorType<[any], MessageType<TG>>,\n) {\n const $base = ActualMessage(base);\n return Message<TG[]>((r) => {\n const infos: MessageType<TG>[] = [];\n const dc = DestroyContainer();\n $base.then((v) => {\n dc.destroy();\n v.forEach((val) => {\n let $val: MessageType<T> | T = val;\n if (!isMessage($val as object)) {\n $val = Of($val);\n }\n const info = target($val);\n dc.add(info);\n infos.push(info);\n });\n All(...infos).then(r);\n });\n });\n}\n","import { Message } from \"base/Message\";\nimport { MessageType } from \"types/MessageType\";\n\n/**\n * Limits the number of values from the information source\n * to a single value - once the first value is emitted, no more\n * values are delivered from the source\n */\nexport function Once<T>($base: MessageType<T>) {\n return Message<T>((r) => {\n let isFilled = false;\n $base.then((v) => {\n if (!isFilled) {\n isFilled = true;\n r(v);\n }\n });\n });\n}\n","import { Message } from \"base/Message\";\nimport { MessageType } from \"types/MessageType\";\n\n/**\n * Creates a sequence that accumulates all values from the source into an array,\n * emitting the growing array with each new value.\n */\nexport function Sequence<T>($base: MessageType<T>) {\n return Message<T[]>((r) => {\n const result: T[] = [];\n $base.then((v) => {\n result.push(v);\n r(result);\n });\n });\n}\n","import { ActualMessage } from \"base/ActualMessage\";\nimport { Message } from \"base/Message\";\nimport { MaybeMessage } from \"types/MessageType\";\n\n/**\n * Component that receives a data array and yields values one by one\n */\nexport function Stream<T>(base: MaybeMessage<T[]>) {\n const $base = ActualMessage(base);\n return Message<T>((r) => {\n $base.then((v) => {\n v.forEach((cv) => {\n r(cv);\n });\n });\n });\n}\n"],"names":["__publicField","emitter","eventName","Map"],"mappings":";;AAOO,MAAM,QAAA,GAAW,CACtB,KAAA,KAC0C;AAC1C,EAAA,OAAO,KAAA,KAAU,UAAa,KAAA,KAAU,IAAA;AAC1C;AAKO,SAAS,UAAU,CAAA,EAA8B;AACtD,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,MAAA,IAAU,CAAA,IACV,OAAQ,CAAA,CAAU,IAAA,KAAS,UAAA;AAE/B;AAKO,SAAS,SAAS,CAAA,EAA6B;AACpD,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,KAAA,IAAS,CAAA,IACT,OAAQ,CAAA,CAAU,GAAA,KAAQ,UAAA;AAE9B;AAKO,SAAS,cAAc,CAAA,EAAkC;AAC9D,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,SAAA,IAAa,CAAA,IACb,OAAQ,CAAA,CAAU,OAAA,KAAY,UAAA;AAElC;AAKO,SAAS,YAAY,CAAA,EAAgC;AAC1D,EAAA,OACE,CAAA,KAAM,QACN,OAAO,CAAA,KAAM,YACb,WAAA,IAAe,CAAA,IACf,OAAQ,CAAA,CAAU,SAAA,KAAc,UAAA;AAEpC;;ACpDO,SAAS,YAAe,IAAA,EAAS;AACtC,EAAA,OAAO,IAA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CAAC,CAAA;AACH;;ACXO,SAAS,SAAY,KAAA,EAAuB;AACjD,EAAA,OAAO,OAAA,CAAa,CAAC,CAAA,KAAM;AACzB,IAAA,MAAM,SAAc,EAAC;AACrB,IAAA,KAAA,CAAM,IAAA,CAAK,CAAC,CAAA,KAAM;AAChB,MAAA,MAAA,CAAO,KAAK,CAAC,CAAA;AACb,MAAA,CAAA,CAAE,MAAM,CAAA;AAAA,IACV,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH;;ACRO,SAAS,OAAU,IAAA,EAAyB;AACjD,EAAA,MAAM,KAAA,GAAQ,cAAc,IAAI,CAAA;AAChC,EAAA,OAAO,OAAA,CAAW,CAAC,CAAA,KAAM;AACvB,IAAA,KAAA,CAAM,IAAA,CAAK,CAAC,CAAA,KAAM;AAChB,MAAA,CAAA,CAAE,OAAA,CAAQ,CAAC,EAAA,KAAO;AAChB,QAAA,CAAA,CAAE,EAAE,CAAA;AAAA,MACN,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH,CAAC,CAAA;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/silentium.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ declare class MessageRx<T> implements MessageType<T>, DestroyableType {
|
|
|
105
105
|
private rejections;
|
|
106
106
|
private dc;
|
|
107
107
|
constructor(executor: MessageExecutorType<T>);
|
|
108
|
-
then(resolve: ConstructorType<[T]>):
|
|
108
|
+
then(resolve: ConstructorType<[T]>): SharedImpl<T>;
|
|
109
109
|
catch(rejected: ConstructorType<[unknown]>): this;
|
|
110
110
|
destroy(): this;
|
|
111
111
|
}
|
|
@@ -249,7 +249,7 @@ declare namespace Context {
|
|
|
249
249
|
/**
|
|
250
250
|
* Connects an external message to an RPC message chain
|
|
251
251
|
*/
|
|
252
|
-
declare function ContextChain(
|
|
252
|
+
declare function ContextChain(base: MaybeMessage): (context: ContextType) => void;
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* Message for the arrival of a specific RPC message
|