@helpers4/observable 2.0.0-alpha.2 → 2.0.0-alpha.21

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/README.md CHANGED
@@ -9,7 +9,7 @@ A set of helpers for working with URLs.
9
9
 
10
10
  ## Documentation
11
11
 
12
- [https://helpers4.js.org/observable](https://helpers4.js.org/observable)
12
+ [https://helpers4.dev/typescript/categories/observable/](https://helpers4.dev/typescript/categories/observable/)
13
13
 
14
14
  <!-- AUTOMATIC-METHODS -->
15
15
  - combine
@@ -20,8 +20,10 @@ A set of helpers for working with URLs.
20
20
 
21
21
  <!-- AUTOMATIC-SIBLINGS -->
22
22
  - [array](../array)
23
+ - [commit](../commit)
23
24
  - [date](../date)
24
25
  - [function](../function)
26
+ - [math](../math)
25
27
  - [number](../number)
26
28
  - [object](../object)
27
29
  - [promise](../promise)
@@ -37,14 +39,16 @@ A set of helpers for working with URLs.
37
39
  | Name | Package | Source Code | Description |
38
40
  |------|---------|-------------|-------------|
39
41
  | array | [@helpers4/array](https://www.npmjs.com/package/@helpers4/array) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/array) | Array manipulation utilities |
40
- | date | [@helpers4/date](https://www.npmjs.com/package/@helpers4/date) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/date) | date utilities |
42
+ | commit | [@helpers4/commit](https://www.npmjs.com/package/@helpers4/commit) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/commit) | Conventional Commits parsing and analysis |
43
+ | date | [@helpers4/date](https://www.npmjs.com/package/@helpers4/date) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/date) | Date and time utility functions |
41
44
  | function | [@helpers4/function](https://www.npmjs.com/package/@helpers4/function) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/function) | Function utilities and type guards |
42
- | number | [@helpers4/number](https://www.npmjs.com/package/@helpers4/number) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/number) | number utilities |
45
+ | math | [@helpers4/math](https://www.npmjs.com/package/@helpers4/math) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/math) | Mathematical utility functions and calculations |
46
+ | number | [@helpers4/number](https://www.npmjs.com/package/@helpers4/number) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/number) | Number utility functions and validation |
43
47
  | object | [@helpers4/object](https://www.npmjs.com/package/@helpers4/object) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/object) | Object manipulation utilities |
44
48
  | observable | [@helpers4/observable](https://www.npmjs.com/package/@helpers4/observable) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/observable) | Observable utilities and combinators |
45
49
  | promise | [@helpers4/promise](https://www.npmjs.com/package/@helpers4/promise) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/promise) | Promise utilities and error handling |
46
50
  | string | [@helpers4/string](https://www.npmjs.com/package/@helpers4/string) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/string) | String manipulation and formatting utilities |
47
- | type | [@helpers4/type](https://www.npmjs.com/package/@helpers4/type) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/type) | type utilities |
51
+ | type | [@helpers4/type](https://www.npmjs.com/package/@helpers4/type) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/type) | Type checking and validation utilities |
48
52
  | url | [@helpers4/url](https://www.npmjs.com/package/@helpers4/url) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/url) | URL parsing and manipulation utilities |
49
53
  | version | [@helpers4/version](https://www.npmjs.com/package/@helpers4/version) | [Source](https://github.com/helpers4/helpers4/tree/main/helpers/version) | Version string manipulation utilities |
50
54
  <!-- /AUTOMATIC-CATEGORIES-TABLE -->
package/lib/index.d.ts CHANGED
@@ -1,4 +1,41 @@
1
- export declare function combine<T, U, R>(source1: Observable<T>, source2: Observable<U>, map: (c: readonly [T, U]);
2
- export declare function combineLatest<A extends readonly unknown[]>(sources: readonly [...ObservableInputTuple<A>]): Observable<A>; // combineLatest(;
3
- export declare function combineLatest<T extends Record<string, ObservableInput<any>>>(sourcesObject: T): Observable<;
4
- export declare function combineLatest(input: any): any;
1
+ import { Observable, OperatorFunction, ObservableInputTuple, ObservableInput, ObservedValueOf } from 'rxjs';
2
+
3
+ /**
4
+ * This file is part of helpers4.
5
+ * Copyright (C) 2025 baxyz
6
+ * SPDX-License-Identifier: LGPL-3.0-or-later
7
+ */
8
+
9
+ type combineOptions<T, U> = {
10
+ readonly preTreatment?: OperatorFunction<readonly [T, U], readonly [T, U]>;
11
+ };
12
+ /**
13
+ * Combine two observables with a map function and an optional pre-treatment.
14
+ *
15
+ * Note: you can use the pre-treatment to add a filter, a distinctUntilChanged,
16
+ * any other operator that can be used in a pipe, or even an `UntilDestroy`
17
+ * operator.
18
+ *
19
+ * @param source1 first source of data
20
+ * @param source2 second source of data
21
+ * @param map way to combine data
22
+ * @param options options for the combineLatest operator
23
+ * @returns an observable that emits the result of the map function
24
+ * @see combineLatestOperator
25
+ * @see mapOperator
26
+ * @since 1.0.0
27
+ */
28
+ declare function combine<T, U, R>(source1: Observable<T>, source2: Observable<U>, map: (c: readonly [T, U]) => R, options?: combineOptions<T, U>): Observable<R>;
29
+
30
+ /**
31
+ * This file is part of helpers4.
32
+ * Copyright (C) 2025 baxyz
33
+ * SPDX-License-Identifier: LGPL-3.0-or-later
34
+ */
35
+
36
+ declare function combineLatest<A extends readonly unknown[]>(sources: readonly [...ObservableInputTuple<A>]): Observable<A>;
37
+ declare function combineLatest<T extends Record<string, ObservableInput<unknown>>>(sourcesObject: T): Observable<{
38
+ [K in keyof T]: ObservedValueOf<T[K]>;
39
+ }>;
40
+
41
+ export { combine, combineLatest };