@soffinal/stream 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +318 -299
  3. package/dist/index.d.ts +2 -4
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +12 -8
  7. package/dist/reactive/index.d.ts +5 -0
  8. package/dist/reactive/index.d.ts.map +1 -0
  9. package/dist/{list.d.ts → reactive/list.d.ts} +1 -1
  10. package/dist/reactive/list.d.ts.map +1 -0
  11. package/dist/{map.d.ts → reactive/map.d.ts} +1 -1
  12. package/dist/reactive/map.d.ts.map +1 -0
  13. package/dist/{set.d.ts → reactive/set.d.ts} +1 -1
  14. package/dist/reactive/set.d.ts.map +1 -0
  15. package/dist/{state.d.ts → reactive/state.d.ts} +1 -1
  16. package/dist/reactive/state.d.ts.map +1 -0
  17. package/dist/stream.d.ts +1 -279
  18. package/dist/stream.d.ts.map +1 -1
  19. package/dist/transformers/filter.d.ts +64 -0
  20. package/dist/transformers/filter.d.ts.map +1 -0
  21. package/dist/transformers/flat.d.ts +29 -0
  22. package/dist/transformers/flat.d.ts.map +1 -0
  23. package/dist/transformers/index.d.ts +5 -0
  24. package/dist/transformers/index.d.ts.map +1 -0
  25. package/dist/transformers/map.d.ts +64 -0
  26. package/dist/transformers/map.d.ts.map +1 -0
  27. package/dist/transformers/merge.d.ts +33 -0
  28. package/dist/transformers/merge.d.ts.map +1 -0
  29. package/package.json +5 -8
  30. package/src/transformers/filter.md +161 -0
  31. package/src/transformers/flat.md +56 -0
  32. package/src/transformers/map.md +184 -0
  33. package/src/transformers/merge.md +79 -0
  34. package/dist/benchmark.d.ts +0 -16
  35. package/dist/benchmark.d.ts.map +0 -1
  36. package/dist/list.d.ts.map +0 -1
  37. package/dist/map.d.ts.map +0 -1
  38. package/dist/set.d.ts.map +0 -1
  39. package/dist/state.d.ts.map +0 -1
package/dist/stream.d.ts CHANGED
@@ -1,8 +1,4 @@
1
1
  export type ValueOf<STREAM> = STREAM extends Stream<infer VALUE> ? VALUE : never;
2
- export type FlatArray<Arr, Depth extends number> = {
3
- "done": Arr;
4
- "recur": Arr extends ReadonlyArray<infer InnerArr> ? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]> : Arr;
5
- }[Depth extends -1 ? "done" : "recur"];
6
2
  /**
7
3
  * A reactive streaming library that provides async-first data structures with built-in event streams.
8
4
  *
@@ -152,7 +148,7 @@ export declare class Stream<VALUE = unknown> implements AsyncIterable<VALUE> {
152
148
  * cleanup();
153
149
  * ```
154
150
  */
155
- listen(listener: (value: VALUE) => void, signal?: AbortSignal): () => void;
151
+ listen(listener: (value: VALUE) => void, signal?: AbortSignal | Stream<any>): () => void;
156
152
  /**
157
153
  * Promise-like interface that resolves with the next value.
158
154
  *
@@ -173,111 +169,6 @@ export declare class Stream<VALUE = unknown> implements AsyncIterable<VALUE> {
173
169
  * ```
174
170
  */
175
171
  then(onfulfilled?: ((value: VALUE) => VALUE | PromiseLike<VALUE>) | null): Promise<VALUE>;
176
- /**
177
- * Filters values based on a predicate function.
178
- *
179
- * @param predicate - Function to test each value
180
- * @returns New stream with filtered values
181
- *
182
- * @example
183
- * ```typescript
184
- * const numbers = new Stream<number>();
185
- * const evens = numbers.filter(n => n % 2 === 0);
186
- *
187
- * evens.listen(n => console.log('Even:', n));
188
- * numbers.push(1, 2, 3, 4); // Even: 2, Even: 4
189
- *
190
- * // With accumulator
191
- * const increasing = numbers.filter(0, (prev, curr) =>
192
- * [curr > prev, Math.max(prev, curr)]
193
- * );
194
- * ```
195
- */
196
- filter<FILTERED extends VALUE>(predicate: (value: VALUE) => value is FILTERED): Stream<FILTERED>;
197
- filter<FILTERED extends VALUE>(predicate: (value: VALUE) => boolean | Promise<boolean>): Stream<FILTERED>;
198
- filter<FILTERED extends VALUE, ACC>(initialValue: ACC, predicate: (accumulator: ACC, value: VALUE) => [boolean, ACC] | Promise<[boolean, ACC]>): Stream<FILTERED>;
199
- /**
200
- * Transforms values using a mapper function.
201
- *
202
- * @param mapper - Function to transform each value
203
- * @returns New stream with transformed values
204
- *
205
- * @example
206
- * ```typescript
207
- * const numbers = new Stream<number>();
208
- * const doubled = numbers.map(n => n * 2);
209
- *
210
- * doubled.listen(n => console.log('Doubled:', n));
211
- * numbers.push(1, 2, 3); // Doubled: 2, Doubled: 4, Doubled: 6
212
- *
213
- * // With accumulator (running sum)
214
- * const sums = numbers.map(0, (sum, n) => [sum + n, sum + n]);
215
- * ```
216
- */
217
- map<MAPPED>(mapper: (value: VALUE) => MAPPED | Promise<MAPPED>): Stream<MAPPED>;
218
- map<MAPPED, ACC>(initialValue: ACC, mapper: (accumulator: ACC, value: VALUE) => [MAPPED, ACC] | Promise<[MAPPED, ACC]>): Stream<MAPPED>;
219
- /**
220
- * Groups values into batches based on a predicate.
221
- *
222
- * @param predicate - Function to determine when to emit a group
223
- * @returns New stream with grouped values
224
- *
225
- * @example
226
- * ```typescript
227
- * const numbers = new Stream<number>();
228
- * const batches = numbers.group(batch => batch.length === 3);
229
- *
230
- * batches.listen(batch => console.log('Batch:', batch));
231
- * numbers.push(1, 2, 3, 4, 5, 6); // Batch: [1,2,3], Batch: [4,5,6]
232
- *
233
- * // With accumulator (sum-based grouping)
234
- * const sumGroups = numbers.group(0, (sum, n) =>
235
- * sum + n >= 10 ? [true, 0] : [false, sum + n]
236
- * );
237
- * ```
238
- */
239
- group(predicate: (accumulator: VALUE[], value: VALUE) => boolean | Promise<boolean>): Stream<VALUE[]>;
240
- group<ACC>(initialValue: ACC, predicate: (accumulator: ACC, value: VALUE) => [boolean, ACC] | Promise<[boolean, ACC]>): Stream<ACC>;
241
- /**
242
- * Merges this stream with other streams.
243
- *
244
- * @param streams - Other streams to merge with
245
- * @returns New stream with values from all streams
246
- *
247
- * @example
248
- * ```typescript
249
- * const stream1 = new Stream<string>();
250
- * const stream2 = new Stream<number>();
251
- * const merged = stream1.merge(stream2);
252
- *
253
- * merged.listen(msg => console.log('Merged:', msg));
254
- *
255
- * stream1.push('from stream1');
256
- * stream2.push(42);
257
- * // Output: Merged: from stream1, Merged: 42
258
- * ```
259
- */
260
- merge<STREAMS extends [Stream<any>, ...Stream<any>[]]>(...streams: STREAMS): Stream<VALUE | ValueOf<STREAMS[number]>>;
261
- /**
262
- * Flattens array values in the stream.
263
- *
264
- * @param depth - Depth to flatten (default: 0)
265
- * @returns New stream with flattened values
266
- *
267
- * @example
268
- * ```typescript
269
- * const arrays = new Stream<number[]>();
270
- * const flattened = arrays.flat();
271
- *
272
- * flattened.listen(n => console.log('Flat:', n));
273
- * arrays.push([1, 2], [3, 4]); // Flat: 1, Flat: 2, Flat: 3, Flat: 4
274
- *
275
- * // Deep flattening
276
- * const nested = new Stream<number[][][]>();
277
- * const deepFlat = nested.flat(2);
278
- * ```
279
- */
280
- flat<DEPTH extends number = 0>(depth?: DEPTH): Stream<FlatArray<VALUE, DEPTH>>;
281
172
  /**
282
173
  * Applies a transformer function to this stream, enabling functional composition.
283
174
  *
@@ -312,173 +203,4 @@ export declare class Stream<VALUE = unknown> implements AsyncIterable<VALUE> {
312
203
  */
313
204
  pipe<OUTPUT>(transformer: (stream: Stream<VALUE>) => Stream<OUTPUT>): Stream<OUTPUT>;
314
205
  }
315
- /**
316
- * Transformer function interface for mapping stream values.
317
- * Supports both simple mapping and stateful mapping with accumulators.
318
- */
319
- export interface MapFunction {
320
- <VALUE, MAPPED>(mapper: (value: VALUE) => MAPPED | Promise<MAPPED>): (stream: Stream<VALUE>) => Stream<MAPPED>;
321
- <VALUE, MAPPED, ACC>(initialValue: ACC, mapper: (accumulator: ACC, value: VALUE) => [MAPPED, ACC] | Promise<[MAPPED, ACC]>): (stream: Stream<VALUE>) => Stream<MAPPED>;
322
- }
323
- /**
324
- * Creates a map transformer for use with pipe().
325
- *
326
- * @param mapper - Function to transform each value, or initial accumulator value
327
- * @param mapper - Optional mapper function when using accumulator
328
- * @returns Transformer function for pipe()
329
- *
330
- * @example
331
- * ```typescript
332
- * const numbers = new Stream<number>();
333
- *
334
- * // Simple mapping
335
- * const doubled = numbers.pipe(map(n => n * 2));
336
- *
337
- * // Stateful mapping (running sum)
338
- * const sums = numbers.pipe(map(0, (sum, n) => [sum + n, sum + n]));
339
- *
340
- * // Async mapping
341
- * const enriched = numbers.pipe(map(async n => {
342
- * const data = await fetchData(n);
343
- * return { value: n, data };
344
- * }));
345
- * ```
346
- */
347
- export declare const map: MapFunction;
348
- /**
349
- * Transformer function interface for filtering stream values.
350
- * Supports type guards, boolean predicates, and stateful filtering.
351
- */
352
- export interface FilterFunction {
353
- <VALUE, FILTERED extends VALUE>(predicate: (value: VALUE) => value is FILTERED): (stream: Stream<VALUE>) => Stream<FILTERED>;
354
- <VALUE>(predicate: (value: VALUE) => boolean | Promise<boolean>): (stream: Stream<VALUE>) => Stream<VALUE>;
355
- <VALUE, ACC>(initialValue: ACC, predicate: (accumulator: ACC, value: VALUE) => [boolean, ACC] | Promise<[boolean, ACC]>): (stream: Stream<VALUE>) => Stream<VALUE>;
356
- }
357
- /**
358
- * Creates a filter transformer for use with pipe().
359
- *
360
- * @param predicate - Function to test each value, or initial accumulator value
361
- * @param predicate - Optional predicate function when using accumulator
362
- * @returns Transformer function for pipe()
363
- *
364
- * @example
365
- * ```typescript
366
- * const numbers = new Stream<number>();
367
- *
368
- * // Simple filtering
369
- * const positives = numbers.pipe(filter(n => n > 0));
370
- *
371
- * // Type guard filtering
372
- * const strings = mixed.pipe(filter((x): x is string => typeof x === 'string'));
373
- *
374
- * // Stateful filtering (only increasing values)
375
- * const increasing = numbers.pipe(filter(0, (prev, curr) =>
376
- * [curr > prev, Math.max(prev, curr)]
377
- * ));
378
- * ```
379
- */
380
- export declare const filter: FilterFunction;
381
- /**
382
- * Transformer function interface for grouping stream values into batches.
383
- * Supports both simple batching and stateful grouping with accumulators.
384
- */
385
- export interface GroupFunction {
386
- <VALUE>(predicate: (accumulator: VALUE[], value: VALUE) => boolean | Promise<boolean>): (stream: Stream<VALUE>) => Stream<VALUE[]>;
387
- <VALUE, ACC>(initialValue: ACC, predicate: (accumulator: ACC, value: VALUE) => [boolean, ACC] | Promise<[boolean, ACC]>): (stream: Stream<VALUE>) => Stream<ACC>;
388
- }
389
- /**
390
- * Creates a group transformer for use with pipe().
391
- *
392
- * @param predicate - Function to determine when to emit a group, or initial accumulator value
393
- * @param predicate - Optional predicate function when using accumulator
394
- * @returns Transformer function for pipe()
395
- *
396
- * @example
397
- * ```typescript
398
- * const numbers = new Stream<number>();
399
- *
400
- * // Group by count
401
- * const batches = numbers.pipe(group(batch => batch.length >= 5));
402
- *
403
- * // Group by sum
404
- * const sumGroups = numbers.pipe(group(0, (sum, n) =>
405
- * sum + n >= 100 ? [true, 0] : [false, sum + n]
406
- * ));
407
- *
408
- * // Time-based grouping
409
- * const timeGroups = events.pipe(group([], (window, event) => {
410
- * const now = Date.now();
411
- * const recent = window.filter(e => now - e.timestamp < 5000);
412
- * return [recent.length >= 10, [...recent, event]];
413
- * }));
414
- * ```
415
- */
416
- export declare const group: GroupFunction;
417
- /**
418
- * Transformer function interface for merging multiple streams.
419
- * Combines values from all streams into a single output stream.
420
- */
421
- export interface MergeFunction {
422
- <STREAMS extends [Stream<any>, ...Stream<any>[]]>(...streams: STREAMS): <VALUE>(stream: Stream<VALUE>) => Stream<VALUE | ValueOf<STREAMS[number]>>;
423
- }
424
- /**
425
- * Creates a merge transformer for use with pipe().
426
- *
427
- * @param streams - Additional streams to merge with the source stream
428
- * @returns Transformer function for pipe()
429
- *
430
- * @example
431
- * ```typescript
432
- * const stream1 = new Stream<string>();
433
- * const stream2 = new Stream<number>();
434
- * const stream3 = new Stream<boolean>();
435
- *
436
- * // Merge multiple streams
437
- * const merged = stream1.pipe(merge(stream2, stream3));
438
- * // Type: Stream<string | number | boolean>
439
- *
440
- * merged.listen(value => {
441
- * console.log('Received:', value); // Could be string, number, or boolean
442
- * });
443
- *
444
- * stream1.push('hello');
445
- * stream2.push(42);
446
- * stream3.push(true);
447
- * ```
448
- */
449
- export declare const merge: MergeFunction;
450
- /**
451
- * Transformer function interface for flattening array values in streams.
452
- * Supports configurable depth for nested array flattening.
453
- */
454
- export interface FlatFunction {
455
- (): <VALUE>(stream: Stream<VALUE>) => Stream<FlatArray<VALUE, 0>>;
456
- <DEPTH extends number>(depth: DEPTH): <VALUE>(stream: Stream<VALUE>) => Stream<FlatArray<VALUE, DEPTH>>;
457
- }
458
- /**
459
- * Creates a flat transformer for use with pipe().
460
- *
461
- * @param depth - Optional depth to flatten (default: 0 for single level)
462
- * @returns Transformer function for pipe()
463
- *
464
- * @example
465
- * ```typescript
466
- * const arrays = new Stream<number[]>();
467
- *
468
- * // Flatten single level
469
- * const flattened = arrays.pipe(flat());
470
- * arrays.push([1, 2], [3, 4]); // Emits: 1, 2, 3, 4
471
- *
472
- * // Flatten multiple levels
473
- * const nested = new Stream<number[][][]>();
474
- * const deepFlat = nested.pipe(flat(2));
475
- * nested.push([[[1, 2]], [[3, 4]]]); // Emits: 1, 2, 3, 4
476
- *
477
- * // Mixed content (non-arrays pass through)
478
- * const mixed = new Stream<number | number[]>();
479
- * const result = mixed.pipe(flat());
480
- * mixed.push(1, [2, 3], 4); // Emits: 1, 2, 3, 4
481
- * ```
482
- */
483
- export declare const flat: FlatFunction;
484
206
  //# sourceMappingURL=stream.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,CAAC,MAAM,IAAI,MAAM,SAAS,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAGjF,MAAM,MAAM,SAAS,CAAC,GAAG,EAAE,KAAK,SAAS,MAAM,IAAI;IACjD,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,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AK,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;CAGrF"}
@@ -0,0 +1,64 @@
1
+ import { Stream } from "../stream.ts";
2
+ /**
3
+ * Adaptive filter transformer that maintains state and can terminate streams.
4
+ *
5
+ * @template VALUE - The type of values flowing through the stream
6
+ * @template STATE - The type of the internal state object
7
+ *
8
+ * @param initialState - Initial state object for the transformer
9
+ * @param predicate - Function that determines if a value should pass through
10
+ * - Returns `[boolean, newState]` to continue with updated state
11
+ * - Returns `void` or `undefined` to terminate the stream
12
+ * - Can be async for complex filtering logic
13
+ *
14
+ * @returns A transformer function that can be used with `.pipe()`
15
+ *
16
+ * @example
17
+ * // Simple filtering
18
+ * stream.pipe(filter({}, (_, value) => [value > 0, {}]))
19
+ *
20
+ * @example
21
+ * // Async filtering
22
+ * stream.pipe(
23
+ * filter({}, async (_, value) => {
24
+ * const valid = await validate(value);
25
+ * return [valid, {}];
26
+ * })
27
+ * )
28
+ *
29
+ * @example
30
+ * // 📦 COPY-PASTE TRANSFORMER: simpleFilter() - Simple predicate filtering
31
+ * const simpleFilter = <T>(predicate: (value: T) => boolean | Promise<boolean>) =>
32
+ * filter<T, {}>({}, async (_, value) => {
33
+ * const shouldPass = await predicate(value);
34
+ * return [shouldPass, {}];
35
+ * });
36
+ *
37
+ * @example
38
+ * // 📦 COPY-PASTE TRANSFORMER: take(n) - Limit to N items
39
+ * const take = <T>(n: number) =>
40
+ * filter<T, { count: number }>({ count: 0 }, (state, value) => {
41
+ * if (state.count >= n) return;
42
+ * return [true, { count: state.count + 1 }];
43
+ * });
44
+ *
45
+ * @example
46
+ * // 📦 COPY-PASTE TRANSFORMER: skip(n) - Skip first N items
47
+ * const skip = <T>(n: number) =>
48
+ * filter<T, { count: number }>({ count: 0 }, (state, value) => {
49
+ * const newCount = state.count + 1;
50
+ * return [newCount > n, { count: newCount }];
51
+ * });
52
+ *
53
+ * @example
54
+ * // 📦 COPY-PASTE TRANSFORMER: distinct() - Remove duplicates
55
+ * const distinct = <T>() =>
56
+ * filter<T, { seen: Set<T> }>({ seen: new Set() }, (state, value) => {
57
+ * if (state.seen.has(value)) return [false, state];
58
+ * state.seen.add(value);
59
+ * return [true, state];
60
+ * });
61
+ *
62
+ */
63
+ export declare function filter<VALUE, STATE extends Record<string, unknown> = {}>(initialState: STATE, predicate: (state: STATE, value: VALUE) => [boolean, STATE] | void | Promise<[boolean, STATE] | void>): (stream: Stream<VALUE>) => Stream<VALUE>;
64
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/transformers/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EACtE,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,GACpG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,CAe1C"}
@@ -0,0 +1,29 @@
1
+ import { Stream } from "../stream.ts";
2
+ /**
3
+ * Flatten arrays in a stream, converting 1 array event into N individual events.
4
+ *
5
+ * @template VALUE - The type of values in the stream (should be arrays)
6
+ * @template DEPTH - The depth of flattening (0 = one level, 1 = two levels, etc.)
7
+ *
8
+ * @param depth - How many levels deep to flatten (default: 0 = one level)
9
+ *
10
+ * @returns A transformer that flattens array values into individual events
11
+ *
12
+ * @example
13
+ * // Basic flattening - 1 array → N events
14
+ * const arrayStream = new Stream<number[]>();
15
+ * const individualNumbers = arrayStream.pipe(flat());
16
+ *
17
+ * arrayStream.push([1, 2, 3]); // Emits: 1, 2, 3 as separate events
18
+ *
19
+ * @example
20
+ * // Deep flattening
21
+ * const deepArrays = new Stream<number[][]>();
22
+ * const flattened = deepArrays.pipe(flat(1)); // Flatten 2 levels
23
+ *
24
+ * deepArrays.push([[1, 2], [3, 4]]);
25
+ * // Emits: 1, 2, 3, 4 as separate events
26
+ *
27
+ */
28
+ export declare function flat<VALUE, DEPTH extends number = 0>(depth?: DEPTH): (stream: Stream<VALUE>) => Stream<FlatArray<VALUE, DEPTH>>;
29
+ //# sourceMappingURL=flat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["../../src/transformers/flat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,GAAG,CAAC,EAClD,KAAK,GAAE,KAAkB,GACxB,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAe5D"}
@@ -0,0 +1,5 @@
1
+ export * from "./filter.ts";
2
+ export * from "./map.ts";
3
+ export * from "./merge.ts";
4
+ export * from "./flat.ts";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { Stream } from "../stream.ts";
2
+ /**
3
+ * Adaptive map transformer that transforms values while maintaining state.
4
+ *
5
+ * @template VALUE - The type of input values
6
+ * @template STATE - The type of the internal state object
7
+ * @template MAPPED - The type of output values after transformation
8
+ *
9
+ * @param initialState - Initial state object for the transformer
10
+ * @param predicate - Function that transforms values and updates state
11
+ * - Must return `[transformedValue, newState]`
12
+ * - Can be async for complex transformations
13
+ * - Preserves order even with async operations
14
+ *
15
+ * @returns A transformer function that can be used with `.pipe()`
16
+ *
17
+ * @example
18
+ * // Simple transformation
19
+ * stream.pipe(map({}, (_, value) => [value * 2, {}]))
20
+ *
21
+ * @example
22
+ * // Async transformation
23
+ * stream.pipe(
24
+ * map({}, async (_, value) => {
25
+ * const result = await process(value);
26
+ * return [result, {}];
27
+ * })
28
+ * )
29
+ *
30
+ * @example
31
+ * // 📦 COPY-PASTE TRANSFORMER: simpleMap() - Simple transformation
32
+ * const simpleMap = <T, U>(fn: (value: T) => U | Promise<U>) =>
33
+ * map<T, {}, U>({}, async (_, value) => {
34
+ * const result = await fn(value);
35
+ * return [result, {}];
36
+ * });
37
+ *
38
+ * @example
39
+ * // 📦 COPY-PASTE TRANSFORMER: withIndex() - Add index to values
40
+ * const withIndex = <T>() =>
41
+ * map<T, { index: number }, { value: T; index: number }>(
42
+ * { index: 0 },
43
+ * (state, value) => [
44
+ * { value, index: state.index },
45
+ * { index: state.index + 1 }
46
+ * ]
47
+ * );
48
+ *
49
+ * @example
50
+ * // 📦 COPY-PASTE TRANSFORMER: delay(ms) - Delay each value
51
+ * const delay = <T>(ms: number) =>
52
+ * map<T, {}, T>({}, async (_, value) => {
53
+ * await new Promise(resolve => setTimeout(resolve, ms));
54
+ * return [value, {}];
55
+ * });
56
+ *
57
+ * @example
58
+ * // 📦 COPY-PASTE TRANSFORMER: pluck(key) - Extract property
59
+ * const pluck = <T, K extends keyof T>(key: K) =>
60
+ * map<T, {}, T[K]>({}, (_, value) => [value[key], {}]);
61
+ *
62
+ */
63
+ export declare function map<VALUE, STATE extends Record<string, unknown>, MAPPED>(initialState: STATE, predicate: (state: STATE, value: VALUE) => [MAPPED, STATE] | Promise<[MAPPED, STATE]>): (stream: Stream<VALUE>) => Stream<MAPPED>;
64
+ //# sourceMappingURL=map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/transformers/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EACtE,YAAY,EAAE,KAAK,EACnB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,GACpF,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAU3C"}
@@ -0,0 +1,33 @@
1
+ import { Stream } from "../stream.ts";
2
+ type ValueOf<STREAM> = STREAM extends Stream<infer VALUE> ? VALUE : never;
3
+ /**
4
+ * Merge multiple streams into a single stream with temporal ordering.
5
+ *
6
+ * @template VALUE - The type of values from the source stream
7
+ * @template STREAMS - Tuple type of additional streams to merge
8
+ *
9
+ * @param streams - Additional streams to merge with the source stream
10
+ *
11
+ * @returns A transformer that merges all streams into one with union types
12
+ *
13
+ * @example
14
+ * // Basic merge with type safety
15
+ * const numbers = new Stream<number>();
16
+ * const strings = new Stream<string>();
17
+ * const merged = numbers.pipe(merge(strings));
18
+ * // Type: Stream<number | string>
19
+ *
20
+ * @example
21
+ * // Multiple streams
22
+ * const stream1 = new Stream<number>();
23
+ * const stream2 = new Stream<string>();
24
+ * const stream3 = new Stream<boolean>();
25
+ *
26
+ * const combined = stream1.pipe(merge(stream2, stream3));
27
+ * // Type: Stream<number | string | boolean>
28
+ *
29
+
30
+ */
31
+ export declare function merge<VALUE, STREAMS extends [Stream<any>, ...Stream<any>[]]>(...streams: STREAMS): (stream: Stream<VALUE>) => Stream<VALUE | ValueOf<STREAMS[number]>>;
32
+ export {};
33
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/transformers/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,KAAK,OAAO,CAAC,MAAM,IAAI,MAAM,SAAS,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAC1E,GAAG,OAAO,EAAE,OAAO,GAClB,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CA0BrE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soffinal/stream",
3
3
  "module": "./dist/index.js",
4
- "version": "0.1.4",
4
+ "version": "0.2.0",
5
5
  "description": "A reactive event streaming library for TypeScript/JavaScript",
6
6
  "type": "module",
7
7
  "devDependencies": {
@@ -10,12 +10,6 @@
10
10
  "peerDependencies": {
11
11
  "typescript": "^5.9.2"
12
12
  },
13
- "scripts": {
14
- "clean": "rm -rf dist",
15
- "build": "bun run clean && bun build src/index.ts --outdir dist --target node --format esm --sourcemap --minify && bun run build:types",
16
- "build:types": "tsc --emitDeclarationOnly --allowImportingTsExtensions --noEmit false",
17
- "release": " git add . && git commit -m \"Release v$(node -p 'require(\"./package.json\").version')\" && git tag v$(node -p 'require(\"./package.json\").version')"
18
- },
19
13
  "exports": {
20
14
  ".": {
21
15
  "import": "./dist/index.js",
@@ -29,7 +23,8 @@
29
23
  "typescript",
30
24
  "event",
31
25
  "observable",
32
- "emitter"
26
+ "emitter",
27
+ "adaptive constraints"
33
28
  ],
34
29
  "author": "Soffinal <smari.sofiane@gmail.com>",
35
30
  "license": "MIT",
@@ -41,7 +36,9 @@
41
36
  "types": "./dist/index.d.ts",
42
37
  "files": [
43
38
  "dist",
39
+ "src/transformers/*.md",
44
40
  "README.md",
41
+ "CHANGELOG.md",
45
42
  "LICENSE"
46
43
  ]
47
44
  }