@mastra/nestjs 0.1.8-alpha.0 → 0.1.8-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/_types/rxjs/dist/types/index.d.ts +173 -0
- package/dist/_types/rxjs/dist/types/internal/AnyCatcher.d.ts +10 -0
- package/dist/_types/rxjs/dist/types/internal/AsyncSubject.d.ts +15 -0
- package/dist/_types/rxjs/dist/types/internal/BehaviorSubject.d.ts +15 -0
- package/dist/_types/rxjs/dist/types/internal/Notification.d.ts +180 -0
- package/dist/_types/rxjs/dist/types/internal/Observable.d.ts +128 -0
- package/dist/_types/rxjs/dist/types/internal/Operator.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/ReplaySubject.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/Scheduler.d.ts +55 -0
- package/dist/_types/rxjs/dist/types/internal/Subject.d.ts +58 -0
- package/dist/_types/rxjs/dist/types/internal/Subscriber.d.ts +78 -0
- package/dist/_types/rxjs/dist/types/internal/Subscription.d.ts +96 -0
- package/dist/_types/rxjs/dist/types/internal/config.d.ts +73 -0
- package/dist/_types/rxjs/dist/types/internal/firstValueFrom.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/lastValueFrom.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/observable/ConnectableObservable.d.ts +42 -0
- package/dist/_types/rxjs/dist/types/internal/observable/bindCallback.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/bindNodeCallback.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/combineLatest.d.ts +33 -0
- package/dist/_types/rxjs/dist/types/internal/observable/concat.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/connectable.d.ts +27 -0
- package/dist/_types/rxjs/dist/types/internal/observable/defer.d.ts +52 -0
- package/dist/_types/rxjs/dist/types/internal/observable/dom/animationFrames.d.ts +76 -0
- package/dist/_types/rxjs/dist/types/internal/observable/empty.d.ts +72 -0
- package/dist/_types/rxjs/dist/types/internal/observable/forkJoin.d.ts +24 -0
- package/dist/_types/rxjs/dist/types/internal/observable/from.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/observable/fromEvent.d.ts +45 -0
- package/dist/_types/rxjs/dist/types/internal/observable/fromEventPattern.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/generate.d.ts +311 -0
- package/dist/_types/rxjs/dist/types/internal/observable/iif.d.ts +82 -0
- package/dist/_types/rxjs/dist/types/internal/observable/interval.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/observable/merge.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/observable/never.d.ts +40 -0
- package/dist/_types/rxjs/dist/types/internal/observable/of.d.ts +14 -0
- package/dist/_types/rxjs/dist/types/internal/observable/onErrorResumeNext.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/observable/pairs.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/observable/partition.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/observable/race.d.ts +12 -0
- package/dist/_types/rxjs/dist/types/internal/observable/range.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/observable/throwError.d.ts +115 -0
- package/dist/_types/rxjs/dist/types/internal/observable/timer.d.ts +126 -0
- package/dist/_types/rxjs/dist/types/internal/observable/using.d.ts +32 -0
- package/dist/_types/rxjs/dist/types/internal/observable/zip.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/audit.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/auditTime.d.ts +50 -0
- package/dist/_types/rxjs/dist/types/internal/operators/buffer.d.ts +41 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferCount.d.ts +54 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferTime.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferToggle.d.ts +46 -0
- package/dist/_types/rxjs/dist/types/internal/operators/bufferWhen.d.ts +41 -0
- package/dist/_types/rxjs/dist/types/internal/operators/catchError.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/combineAll.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/combineLatestAll.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/combineLatestWith.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatAll.d.ts +59 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatMapTo.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/concatWith.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/connect.d.ts +87 -0
- package/dist/_types/rxjs/dist/types/internal/operators/count.d.ts +58 -0
- package/dist/_types/rxjs/dist/types/internal/operators/debounce.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/debounceTime.d.ts +60 -0
- package/dist/_types/rxjs/dist/types/internal/operators/defaultIfEmpty.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/operators/delay.d.ts +59 -0
- package/dist/_types/rxjs/dist/types/internal/operators/delayWhen.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/dematerialize.d.ts +51 -0
- package/dist/_types/rxjs/dist/types/internal/operators/distinct.d.ts +60 -0
- package/dist/_types/rxjs/dist/types/internal/operators/distinctUntilChanged.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/distinctUntilKeyChanged.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/elementAt.d.ts +51 -0
- package/dist/_types/rxjs/dist/types/internal/operators/endWith.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/every.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/exhaust.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/exhaustAll.d.ts +47 -0
- package/dist/_types/rxjs/dist/types/internal/operators/exhaustMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/expand.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/filter.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/finalize.d.ts +64 -0
- package/dist/_types/rxjs/dist/types/internal/operators/find.d.ts +12 -0
- package/dist/_types/rxjs/dist/types/internal/operators/findIndex.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/first.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/flatMap.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/groupBy.d.ts +119 -0
- package/dist/_types/rxjs/dist/types/internal/operators/ignoreElements.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/operators/isEmpty.d.ts +64 -0
- package/dist/_types/rxjs/dist/types/internal/operators/last.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/map.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mapTo.d.ts +10 -0
- package/dist/_types/rxjs/dist/types/internal/operators/materialize.d.ts +52 -0
- package/dist/_types/rxjs/dist/types/internal/operators/max.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeAll.d.ts +62 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeMapTo.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeScan.d.ts +69 -0
- package/dist/_types/rxjs/dist/types/internal/operators/mergeWith.d.ts +44 -0
- package/dist/_types/rxjs/dist/types/internal/operators/min.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/operators/multicast.d.ts +63 -0
- package/dist/_types/rxjs/dist/types/internal/operators/observeOn.d.ts +56 -0
- package/dist/_types/rxjs/dist/types/internal/operators/onErrorResumeNextWith.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/pairwise.d.ts +46 -0
- package/dist/_types/rxjs/dist/types/internal/operators/pluck.d.ts +18 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publish.d.ts +30 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publishBehavior.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publishLast.d.ts +69 -0
- package/dist/_types/rxjs/dist/types/internal/operators/publishReplay.d.ts +56 -0
- package/dist/_types/rxjs/dist/types/internal/operators/raceWith.d.ts +29 -0
- package/dist/_types/rxjs/dist/types/internal/operators/reduce.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/refCount.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/repeat.d.ts +108 -0
- package/dist/_types/rxjs/dist/types/internal/operators/repeatWhen.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/operators/retry.d.ts +28 -0
- package/dist/_types/rxjs/dist/types/internal/operators/retryWhen.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/sample.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/sampleTime.d.ts +46 -0
- package/dist/_types/rxjs/dist/types/internal/operators/scan.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/sequenceEqual.d.ts +60 -0
- package/dist/_types/rxjs/dist/types/internal/operators/share.d.ts +43 -0
- package/dist/_types/rxjs/dist/types/internal/operators/shareReplay.d.ts +10 -0
- package/dist/_types/rxjs/dist/types/internal/operators/single.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skip.d.ts +36 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skipLast.d.ts +45 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skipUntil.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/skipWhile.d.ts +5 -0
- package/dist/_types/rxjs/dist/types/internal/operators/startWith.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/subscribeOn.d.ts +62 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchAll.d.ts +61 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchMap.d.ts +7 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchMapTo.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/switchScan.d.ts +20 -0
- package/dist/_types/rxjs/dist/types/internal/operators/take.d.ts +45 -0
- package/dist/_types/rxjs/dist/types/internal/operators/takeLast.d.ts +42 -0
- package/dist/_types/rxjs/dist/types/internal/operators/takeUntil.d.ts +42 -0
- package/dist/_types/rxjs/dist/types/internal/operators/takeWhile.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/tap.d.ts +72 -0
- package/dist/_types/rxjs/dist/types/internal/operators/throttle.d.ts +78 -0
- package/dist/_types/rxjs/dist/types/internal/operators/throttleTime.d.ts +53 -0
- package/dist/_types/rxjs/dist/types/internal/operators/throwIfEmpty.d.ts +39 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timeInterval.d.ts +50 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timeout.d.ts +257 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timeoutWith.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/operators/timestamp.d.ts +35 -0
- package/dist/_types/rxjs/dist/types/internal/operators/toArray.d.ts +33 -0
- package/dist/_types/rxjs/dist/types/internal/operators/window.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowCount.d.ts +66 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowTime.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowToggle.d.ts +51 -0
- package/dist/_types/rxjs/dist/types/internal/operators/windowWhen.d.ts +48 -0
- package/dist/_types/rxjs/dist/types/internal/operators/withLatestFrom.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/operators/zipAll.d.ts +14 -0
- package/dist/_types/rxjs/dist/types/internal/operators/zipWith.d.ts +26 -0
- package/dist/_types/rxjs/dist/types/internal/scheduled/scheduled.d.ts +15 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/Action.d.ts +32 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AnimationFrameScheduler.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AsapScheduler.d.ts +6 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AsyncAction.d.ts +25 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/AsyncScheduler.d.ts +9 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/QueueScheduler.d.ts +4 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/VirtualTimeScheduler.d.ts +49 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/animationFrame.d.ts +38 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/asap.d.ts +41 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/async.d.ts +53 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/queue.d.ts +69 -0
- package/dist/_types/rxjs/dist/types/internal/scheduler/timerHandle.d.ts +2 -0
- package/dist/_types/rxjs/dist/types/internal/symbol/observable.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/types.d.ts +301 -0
- package/dist/_types/rxjs/dist/types/internal/util/ArgumentOutOfRangeError.d.ts +21 -0
- package/dist/_types/rxjs/dist/types/internal/util/EmptyError.d.ts +23 -0
- package/dist/_types/rxjs/dist/types/internal/util/NotFoundError.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/util/ObjectUnsubscribedError.d.ts +20 -0
- package/dist/_types/rxjs/dist/types/internal/util/SequenceError.d.ts +19 -0
- package/dist/_types/rxjs/dist/types/internal/util/UnsubscriptionError.d.ts +16 -0
- package/dist/_types/rxjs/dist/types/internal/util/identity.d.ts +44 -0
- package/dist/_types/rxjs/dist/types/internal/util/isObservable.d.ts +8 -0
- package/dist/_types/rxjs/dist/types/internal/util/noop.d.ts +2 -0
- package/dist/_types/rxjs/dist/types/internal/util/pipe.d.ts +14 -0
- package/dist/index.cjs +3 -228
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -226
- package/dist/index.js.map +1 -1
- package/dist/interceptors/request-tracking.interceptor.d.ts +1 -1
- package/dist/interceptors/streaming.interceptor.d.ts +1 -1
- package/dist/interceptors/tracing.interceptor.d.ts +1 -1
- package/package.json +9 -8
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits the single value at the specified `index` in a sequence of emissions
|
|
4
|
+
* from the source Observable.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Emits only the i-th value, then completes.</span>
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* `elementAt` returns an Observable that emits the item at the specified
|
|
11
|
+
* `index` in the source Observable, or a default value if that `index` is out
|
|
12
|
+
* of range and the `default` argument is provided. If the `default` argument is
|
|
13
|
+
* not given and the `index` is out of range, the output Observable will emit an
|
|
14
|
+
* `ArgumentOutOfRangeError` error.
|
|
15
|
+
*
|
|
16
|
+
* ## Example
|
|
17
|
+
*
|
|
18
|
+
* Emit only the third click event
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { fromEvent, elementAt } from 'rxjs';
|
|
22
|
+
*
|
|
23
|
+
* const clicks = fromEvent(document, 'click');
|
|
24
|
+
* const result = clicks.pipe(elementAt(2));
|
|
25
|
+
* result.subscribe(x => console.log(x));
|
|
26
|
+
*
|
|
27
|
+
* // Results in:
|
|
28
|
+
* // click 1 = nothing
|
|
29
|
+
* // click 2 = nothing
|
|
30
|
+
* // click 3 = MouseEvent object logged to console
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @see {@link first}
|
|
34
|
+
* @see {@link last}
|
|
35
|
+
* @see {@link skip}
|
|
36
|
+
* @see {@link single}
|
|
37
|
+
* @see {@link take}
|
|
38
|
+
*
|
|
39
|
+
* @throws {ArgumentOutOfRangeError} When using `elementAt(i)`, it delivers an
|
|
40
|
+
* ArgumentOutOfRangeError to the Observer's `error` callback if `i < 0` or the
|
|
41
|
+
* Observable has completed before emitting the i-th `next` notification.
|
|
42
|
+
*
|
|
43
|
+
* @param {number} index Is the number `i` for the i-th source emission that has
|
|
44
|
+
* happened since the subscription, starting from the number `0`.
|
|
45
|
+
* @param {T} [defaultValue] The default value returned for missing indices.
|
|
46
|
+
* @return A function that returns an Observable that emits a single item, if
|
|
47
|
+
* it is found. Otherwise, it will emit the default value if given. If not, it
|
|
48
|
+
* emits an error.
|
|
49
|
+
*/
|
|
50
|
+
export declare function elementAt<T, D = T>(index: number, defaultValue?: D): OperatorFunction<T, T | D>;
|
|
51
|
+
//# sourceMappingURL=elementAt.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, SchedulerLike, OperatorFunction, ValueFromArray } from '../types';
|
|
2
|
+
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `concatAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
3
|
+
export declare function endWith<T>(scheduler: SchedulerLike): MonoTypeOperatorFunction<T>;
|
|
4
|
+
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `concatAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
5
|
+
export declare function endWith<T, A extends unknown[] = T[]>(...valuesAndScheduler: [...A, SchedulerLike]): OperatorFunction<T, T | ValueFromArray<A>>;
|
|
6
|
+
export declare function endWith<T, A extends unknown[] = T[]>(...values: A): OperatorFunction<T, T | ValueFromArray<A>>;
|
|
7
|
+
//# sourceMappingURL=endWith.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { Falsy, OperatorFunction } from '../types';
|
|
3
|
+
export declare function every<T>(predicate: BooleanConstructor): OperatorFunction<T, Exclude<T, Falsy> extends never ? false : boolean>;
|
|
4
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
5
|
+
export declare function every<T>(predicate: BooleanConstructor, thisArg: any): OperatorFunction<T, Exclude<T, Falsy> extends never ? false : boolean>;
|
|
6
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
7
|
+
export declare function every<T, A>(predicate: (this: A, value: T, index: number, source: Observable<T>) => boolean, thisArg: A): OperatorFunction<T, boolean>;
|
|
8
|
+
export declare function every<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean): OperatorFunction<T, boolean>;
|
|
9
|
+
//# sourceMappingURL=every.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInput, ObservedValueOf } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a higher-order Observable into a first-order Observable by dropping
|
|
4
|
+
* inner Observables while the previous inner Observable has not yet completed.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Flattens an Observable-of-Observables by dropping the
|
|
7
|
+
* next inner Observables while the current inner is still executing.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `exhaustAll` subscribes to an Observable that emits Observables, also known as a
|
|
12
|
+
* higher-order Observable. Each time it observes one of these emitted inner
|
|
13
|
+
* Observables, the output Observable begins emitting the items emitted by that
|
|
14
|
+
* inner Observable. So far, it behaves like {@link mergeAll}. However,
|
|
15
|
+
* `exhaustAll` ignores every new inner Observable if the previous Observable has
|
|
16
|
+
* not yet completed. Once that one completes, it will accept and flatten the
|
|
17
|
+
* next inner Observable and repeat this process.
|
|
18
|
+
*
|
|
19
|
+
* ## Example
|
|
20
|
+
*
|
|
21
|
+
* Run a finite timer for each click, only if there is no currently active timer
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { fromEvent, map, interval, take, exhaustAll } from 'rxjs';
|
|
25
|
+
*
|
|
26
|
+
* const clicks = fromEvent(document, 'click');
|
|
27
|
+
* const higherOrder = clicks.pipe(
|
|
28
|
+
* map(() => interval(1000).pipe(take(5)))
|
|
29
|
+
* );
|
|
30
|
+
* const result = higherOrder.pipe(exhaustAll());
|
|
31
|
+
* result.subscribe(x => console.log(x));
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @see {@link combineLatestAll}
|
|
35
|
+
* @see {@link concatAll}
|
|
36
|
+
* @see {@link switchAll}
|
|
37
|
+
* @see {@link switchMap}
|
|
38
|
+
* @see {@link mergeAll}
|
|
39
|
+
* @see {@link exhaustMap}
|
|
40
|
+
* @see {@link zipAll}
|
|
41
|
+
*
|
|
42
|
+
* @return A function that returns an Observable that takes a source of
|
|
43
|
+
* Observables and propagates the first Observable exclusively until it
|
|
44
|
+
* completes before subscribing to the next.
|
|
45
|
+
*/
|
|
46
|
+
export declare function exhaustAll<O extends ObservableInput<any>>(): OperatorFunction<O, ObservedValueOf<O>>;
|
|
47
|
+
//# sourceMappingURL=exhaustAll.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
2
|
+
export declare function exhaustMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O): OperatorFunction<T, ObservedValueOf<O>>;
|
|
3
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
4
|
+
export declare function exhaustMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction<T, ObservedValueOf<O>>;
|
|
5
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
6
|
+
export declare function exhaustMap<T, I, R>(project: (value: T, index: number) => ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;
|
|
7
|
+
//# sourceMappingURL=exhaustMap.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInput, ObservedValueOf, SchedulerLike } from '../types';
|
|
2
|
+
export declare function expand<T, O extends ObservableInput<unknown>>(project: (value: T, index: number) => O, concurrent?: number, scheduler?: SchedulerLike): OperatorFunction<T, ObservedValueOf<O>>;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The `scheduler` parameter will be removed in v8. If you need to schedule the inner subscription,
|
|
5
|
+
* use `subscribeOn` within the projection function: `expand((value) => fn(value).pipe(subscribeOn(scheduler)))`.
|
|
6
|
+
* Details: Details: https://rxjs.dev/deprecations/scheduler-argument
|
|
7
|
+
*/
|
|
8
|
+
export declare function expand<T, O extends ObservableInput<unknown>>(project: (value: T, index: number) => O, concurrent: number | undefined, scheduler: SchedulerLike): OperatorFunction<T, ObservedValueOf<O>>;
|
|
9
|
+
//# sourceMappingURL=expand.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OperatorFunction, MonoTypeOperatorFunction, TruthyTypesOf } from '../types';
|
|
2
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
3
|
+
export declare function filter<T, S extends T, A>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction<T, S>;
|
|
4
|
+
export declare function filter<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;
|
|
5
|
+
export declare function filter<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
|
|
6
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
7
|
+
export declare function filter<T, A>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction<T>;
|
|
8
|
+
export declare function filter<T>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction<T>;
|
|
9
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns an Observable that mirrors the source Observable, but will call a specified function when
|
|
4
|
+
* the source terminates on complete or error.
|
|
5
|
+
* The specified function will also be called when the subscriber explicitly unsubscribes.
|
|
6
|
+
*
|
|
7
|
+
* ## Examples
|
|
8
|
+
*
|
|
9
|
+
* Execute callback function when the observable completes
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { interval, take, finalize } from 'rxjs';
|
|
13
|
+
*
|
|
14
|
+
* // emit value in sequence every 1 second
|
|
15
|
+
* const source = interval(1000);
|
|
16
|
+
* const example = source.pipe(
|
|
17
|
+
* take(5), //take only the first 5 values
|
|
18
|
+
* finalize(() => console.log('Sequence complete')) // Execute when the observable completes
|
|
19
|
+
* );
|
|
20
|
+
* const subscribe = example.subscribe(val => console.log(val));
|
|
21
|
+
*
|
|
22
|
+
* // results:
|
|
23
|
+
* // 0
|
|
24
|
+
* // 1
|
|
25
|
+
* // 2
|
|
26
|
+
* // 3
|
|
27
|
+
* // 4
|
|
28
|
+
* // 'Sequence complete'
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Execute callback function when the subscriber explicitly unsubscribes
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { interval, finalize, tap, noop, timer } from 'rxjs';
|
|
35
|
+
*
|
|
36
|
+
* const source = interval(100).pipe(
|
|
37
|
+
* finalize(() => console.log('[finalize] Called')),
|
|
38
|
+
* tap({
|
|
39
|
+
* next: () => console.log('[next] Called'),
|
|
40
|
+
* error: () => console.log('[error] Not called'),
|
|
41
|
+
* complete: () => console.log('[tap complete] Not called')
|
|
42
|
+
* })
|
|
43
|
+
* );
|
|
44
|
+
*
|
|
45
|
+
* const sub = source.subscribe({
|
|
46
|
+
* next: x => console.log(x),
|
|
47
|
+
* error: noop,
|
|
48
|
+
* complete: () => console.log('[complete] Not called')
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* timer(150).subscribe(() => sub.unsubscribe());
|
|
52
|
+
*
|
|
53
|
+
* // results:
|
|
54
|
+
* // '[next] Called'
|
|
55
|
+
* // 0
|
|
56
|
+
* // '[finalize] Called'
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param {function} callback Function to be called when source terminates.
|
|
60
|
+
* @return A function that returns an Observable that mirrors the source, but
|
|
61
|
+
* will call the specified function on termination.
|
|
62
|
+
*/
|
|
63
|
+
export declare function finalize<T>(callback: () => void): MonoTypeOperatorFunction<T>;
|
|
64
|
+
//# sourceMappingURL=finalize.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { Subscriber } from '../Subscriber';
|
|
3
|
+
import { OperatorFunction, TruthyTypesOf } from '../types';
|
|
4
|
+
export declare function find<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
|
|
5
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
6
|
+
export declare function find<T, S extends T, A>(predicate: (this: A, value: T, index: number, source: Observable<T>) => value is S, thisArg: A): OperatorFunction<T, S | undefined>;
|
|
7
|
+
export declare function find<T, S extends T>(predicate: (value: T, index: number, source: Observable<T>) => value is S): OperatorFunction<T, S | undefined>;
|
|
8
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
9
|
+
export declare function find<T, A>(predicate: (this: A, value: T, index: number, source: Observable<T>) => boolean, thisArg: A): OperatorFunction<T, T | undefined>;
|
|
10
|
+
export declare function find<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean): OperatorFunction<T, T | undefined>;
|
|
11
|
+
export declare function createFind<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean, thisArg: any, emit: 'value' | 'index'): (source: Observable<T>, subscriber: Subscriber<any>) => void;
|
|
12
|
+
//# sourceMappingURL=find.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { Falsy, OperatorFunction } from '../types';
|
|
3
|
+
export declare function findIndex<T>(predicate: BooleanConstructor): OperatorFunction<T, T extends Falsy ? -1 : number>;
|
|
4
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
5
|
+
export declare function findIndex<T>(predicate: BooleanConstructor, thisArg: any): OperatorFunction<T, T extends Falsy ? -1 : number>;
|
|
6
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
7
|
+
export declare function findIndex<T, A>(predicate: (this: A, value: T, index: number, source: Observable<T>) => boolean, thisArg: A): OperatorFunction<T, number>;
|
|
8
|
+
export declare function findIndex<T>(predicate: (value: T, index: number, source: Observable<T>) => boolean): OperatorFunction<T, number>;
|
|
9
|
+
//# sourceMappingURL=findIndex.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { OperatorFunction, TruthyTypesOf } from '../types';
|
|
3
|
+
export declare function first<T, D = T>(predicate?: null, defaultValue?: D): OperatorFunction<T, T | D>;
|
|
4
|
+
export declare function first<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
|
|
5
|
+
export declare function first<T, D>(predicate: BooleanConstructor, defaultValue: D): OperatorFunction<T, TruthyTypesOf<T> | D>;
|
|
6
|
+
export declare function first<T, S extends T>(predicate: (value: T, index: number, source: Observable<T>) => value is S, defaultValue?: S): OperatorFunction<T, S>;
|
|
7
|
+
export declare function first<T, S extends T, D>(predicate: (value: T, index: number, source: Observable<T>) => value is S, defaultValue: D): OperatorFunction<T, S | D>;
|
|
8
|
+
export declare function first<T, D = T>(predicate: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: D): OperatorFunction<T, T | D>;
|
|
9
|
+
//# sourceMappingURL=first.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { Subject } from '../Subject';
|
|
3
|
+
import { ObservableInput, OperatorFunction, SubjectLike } from '../types';
|
|
4
|
+
export interface BasicGroupByOptions<K, T> {
|
|
5
|
+
element?: undefined;
|
|
6
|
+
duration?: (grouped: GroupedObservable<K, T>) => ObservableInput<any>;
|
|
7
|
+
connector?: () => SubjectLike<T>;
|
|
8
|
+
}
|
|
9
|
+
export interface GroupByOptionsWithElement<K, E, T> {
|
|
10
|
+
element: (value: T) => E;
|
|
11
|
+
duration?: (grouped: GroupedObservable<K, E>) => ObservableInput<any>;
|
|
12
|
+
connector?: () => SubjectLike<E>;
|
|
13
|
+
}
|
|
14
|
+
export declare function groupBy<T, K>(key: (value: T) => K, options: BasicGroupByOptions<K, T>): OperatorFunction<T, GroupedObservable<K, T>>;
|
|
15
|
+
export declare function groupBy<T, K, E>(key: (value: T) => K, options: GroupByOptionsWithElement<K, E, T>): OperatorFunction<T, GroupedObservable<K, E>>;
|
|
16
|
+
export declare function groupBy<T, K extends T>(key: (value: T) => value is K): OperatorFunction<T, GroupedObservable<true, K> | GroupedObservable<false, Exclude<T, K>>>;
|
|
17
|
+
export declare function groupBy<T, K>(key: (value: T) => K): OperatorFunction<T, GroupedObservable<K, T>>;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated use the options parameter instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare function groupBy<T, K>(key: (value: T) => K, element: void, duration: (grouped: GroupedObservable<K, T>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, T>>;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated use the options parameter instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function groupBy<T, K, R>(key: (value: T) => K, element?: (value: T) => R, duration?: (grouped: GroupedObservable<K, R>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, R>>;
|
|
26
|
+
/**
|
|
27
|
+
* Groups the items emitted by an Observable according to a specified criterion,
|
|
28
|
+
* and emits these grouped items as `GroupedObservables`, one
|
|
29
|
+
* {@link GroupedObservable} per group.
|
|
30
|
+
*
|
|
31
|
+
* 
|
|
32
|
+
*
|
|
33
|
+
* When the Observable emits an item, a key is computed for this item with the key function.
|
|
34
|
+
*
|
|
35
|
+
* If a {@link GroupedObservable} for this key exists, this {@link GroupedObservable} emits. Otherwise, a new
|
|
36
|
+
* {@link GroupedObservable} for this key is created and emits.
|
|
37
|
+
*
|
|
38
|
+
* A {@link GroupedObservable} represents values belonging to the same group represented by a common key. The common
|
|
39
|
+
* key is available as the `key` field of a {@link GroupedObservable} instance.
|
|
40
|
+
*
|
|
41
|
+
* The elements emitted by {@link GroupedObservable}s are by default the items emitted by the Observable, or elements
|
|
42
|
+
* returned by the element function.
|
|
43
|
+
*
|
|
44
|
+
* ## Examples
|
|
45
|
+
*
|
|
46
|
+
* Group objects by `id` and return as array
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* import { of, groupBy, mergeMap, reduce } from 'rxjs';
|
|
50
|
+
*
|
|
51
|
+
* of(
|
|
52
|
+
* { id: 1, name: 'JavaScript' },
|
|
53
|
+
* { id: 2, name: 'Parcel' },
|
|
54
|
+
* { id: 2, name: 'webpack' },
|
|
55
|
+
* { id: 1, name: 'TypeScript' },
|
|
56
|
+
* { id: 3, name: 'TSLint' }
|
|
57
|
+
* ).pipe(
|
|
58
|
+
* groupBy(p => p.id),
|
|
59
|
+
* mergeMap(group$ => group$.pipe(reduce((acc, cur) => [...acc, cur], [])))
|
|
60
|
+
* )
|
|
61
|
+
* .subscribe(p => console.log(p));
|
|
62
|
+
*
|
|
63
|
+
* // displays:
|
|
64
|
+
* // [{ id: 1, name: 'JavaScript' }, { id: 1, name: 'TypeScript'}]
|
|
65
|
+
* // [{ id: 2, name: 'Parcel' }, { id: 2, name: 'webpack'}]
|
|
66
|
+
* // [{ id: 3, name: 'TSLint' }]
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* Pivot data on the `id` field
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { of, groupBy, mergeMap, reduce, map } from 'rxjs';
|
|
73
|
+
*
|
|
74
|
+
* of(
|
|
75
|
+
* { id: 1, name: 'JavaScript' },
|
|
76
|
+
* { id: 2, name: 'Parcel' },
|
|
77
|
+
* { id: 2, name: 'webpack' },
|
|
78
|
+
* { id: 1, name: 'TypeScript' },
|
|
79
|
+
* { id: 3, name: 'TSLint' }
|
|
80
|
+
* ).pipe(
|
|
81
|
+
* groupBy(p => p.id, { element: p => p.name }),
|
|
82
|
+
* mergeMap(group$ => group$.pipe(reduce((acc, cur) => [...acc, cur], [`${ group$.key }`]))),
|
|
83
|
+
* map(arr => ({ id: parseInt(arr[0], 10), values: arr.slice(1) }))
|
|
84
|
+
* )
|
|
85
|
+
* .subscribe(p => console.log(p));
|
|
86
|
+
*
|
|
87
|
+
* // displays:
|
|
88
|
+
* // { id: 1, values: [ 'JavaScript', 'TypeScript' ] }
|
|
89
|
+
* // { id: 2, values: [ 'Parcel', 'webpack' ] }
|
|
90
|
+
* // { id: 3, values: [ 'TSLint' ] }
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @param key A function that extracts the key
|
|
94
|
+
* for each item.
|
|
95
|
+
* @param element A function that extracts the
|
|
96
|
+
* return element for each item.
|
|
97
|
+
* @param duration
|
|
98
|
+
* A function that returns an Observable to determine how long each group should
|
|
99
|
+
* exist.
|
|
100
|
+
* @param connector Factory function to create an
|
|
101
|
+
* intermediate Subject through which grouped elements are emitted.
|
|
102
|
+
* @return A function that returns an Observable that emits GroupedObservables,
|
|
103
|
+
* each of which corresponds to a unique key value and each of which emits
|
|
104
|
+
* those items from the source Observable that share that key value.
|
|
105
|
+
*
|
|
106
|
+
* @deprecated Use the options parameter instead.
|
|
107
|
+
*/
|
|
108
|
+
export declare function groupBy<T, K, R>(key: (value: T) => K, element?: (value: T) => R, duration?: (grouped: GroupedObservable<K, R>) => Observable<any>, connector?: () => Subject<R>): OperatorFunction<T, GroupedObservable<K, R>>;
|
|
109
|
+
/**
|
|
110
|
+
* An observable of values that is the emitted by the result of a {@link groupBy} operator,
|
|
111
|
+
* contains a `key` property for the grouping.
|
|
112
|
+
*/
|
|
113
|
+
export interface GroupedObservable<K, T> extends Observable<T> {
|
|
114
|
+
/**
|
|
115
|
+
* The key value for the grouped notifications.
|
|
116
|
+
*/
|
|
117
|
+
readonly key: K;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=groupBy.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`.
|
|
4
|
+
*
|
|
5
|
+
* 
|
|
6
|
+
*
|
|
7
|
+
* The `ignoreElements` operator suppresses all items emitted by the source Observable,
|
|
8
|
+
* but allows its termination notification (either `error` or `complete`) to pass through unchanged.
|
|
9
|
+
*
|
|
10
|
+
* If you do not care about the items being emitted by an Observable, but you do want to be notified
|
|
11
|
+
* when it completes or when it terminates with an error, you can apply the `ignoreElements` operator
|
|
12
|
+
* to the Observable, which will ensure that it will never call its observers’ `next` handlers.
|
|
13
|
+
*
|
|
14
|
+
* ## Example
|
|
15
|
+
*
|
|
16
|
+
* Ignore all `next` emissions from the source
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { of, ignoreElements } from 'rxjs';
|
|
20
|
+
*
|
|
21
|
+
* of('you', 'talking', 'to', 'me')
|
|
22
|
+
* .pipe(ignoreElements())
|
|
23
|
+
* .subscribe({
|
|
24
|
+
* next: word => console.log(word),
|
|
25
|
+
* error: err => console.log('error:', err),
|
|
26
|
+
* complete: () => console.log('the end'),
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // result:
|
|
30
|
+
* // 'the end'
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @return A function that returns an empty Observable that only calls
|
|
34
|
+
* `complete` or `error`, based on which one is called by the source
|
|
35
|
+
* Observable.
|
|
36
|
+
*/
|
|
37
|
+
export declare function ignoreElements(): OperatorFunction<unknown, never>;
|
|
38
|
+
//# sourceMappingURL=ignoreElements.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits `false` if the input Observable emits any values, or emits `true` if the
|
|
4
|
+
* input Observable completes without emitting any values.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Tells whether any values are emitted by an Observable.</span>
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* `isEmpty` transforms an Observable that emits values into an Observable that
|
|
11
|
+
* emits a single boolean value representing whether or not any values were
|
|
12
|
+
* emitted by the source Observable. As soon as the source Observable emits a
|
|
13
|
+
* value, `isEmpty` will emit a `false` and complete. If the source Observable
|
|
14
|
+
* completes having not emitted anything, `isEmpty` will emit a `true` and
|
|
15
|
+
* complete.
|
|
16
|
+
*
|
|
17
|
+
* A similar effect could be achieved with {@link count}, but `isEmpty` can emit
|
|
18
|
+
* a `false` value sooner.
|
|
19
|
+
*
|
|
20
|
+
* ## Examples
|
|
21
|
+
*
|
|
22
|
+
* Emit `false` for a non-empty Observable
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { Subject, isEmpty } from 'rxjs';
|
|
26
|
+
*
|
|
27
|
+
* const source = new Subject<string>();
|
|
28
|
+
* const result = source.pipe(isEmpty());
|
|
29
|
+
*
|
|
30
|
+
* source.subscribe(x => console.log(x));
|
|
31
|
+
* result.subscribe(x => console.log(x));
|
|
32
|
+
*
|
|
33
|
+
* source.next('a');
|
|
34
|
+
* source.next('b');
|
|
35
|
+
* source.next('c');
|
|
36
|
+
* source.complete();
|
|
37
|
+
*
|
|
38
|
+
* // Outputs
|
|
39
|
+
* // 'a'
|
|
40
|
+
* // false
|
|
41
|
+
* // 'b'
|
|
42
|
+
* // 'c'
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* Emit `true` for an empty Observable
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { EMPTY, isEmpty } from 'rxjs';
|
|
49
|
+
*
|
|
50
|
+
* const result = EMPTY.pipe(isEmpty());
|
|
51
|
+
* result.subscribe(x => console.log(x));
|
|
52
|
+
*
|
|
53
|
+
* // Outputs
|
|
54
|
+
* // true
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @see {@link count}
|
|
58
|
+
* @see {@link EMPTY}
|
|
59
|
+
*
|
|
60
|
+
* @return A function that returns an Observable that emits boolean value
|
|
61
|
+
* indicating whether the source Observable was empty or not.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isEmpty<T>(): OperatorFunction<T, boolean>;
|
|
64
|
+
//# sourceMappingURL=isEmpty.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { OperatorFunction, TruthyTypesOf } from '../types';
|
|
3
|
+
export declare function last<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
|
|
4
|
+
export declare function last<T, D>(predicate: BooleanConstructor, defaultValue: D): OperatorFunction<T, TruthyTypesOf<T> | D>;
|
|
5
|
+
export declare function last<T, D = T>(predicate?: null, defaultValue?: D): OperatorFunction<T, T | D>;
|
|
6
|
+
export declare function last<T, S extends T>(predicate: (value: T, index: number, source: Observable<T>) => value is S, defaultValue?: S): OperatorFunction<T, S>;
|
|
7
|
+
export declare function last<T, D = T>(predicate: (value: T, index: number, source: Observable<T>) => boolean, defaultValue?: D): OperatorFunction<T, T | D>;
|
|
8
|
+
//# sourceMappingURL=last.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
export declare function map<T, R>(project: (value: T, index: number) => R): OperatorFunction<T, R>;
|
|
3
|
+
/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */
|
|
4
|
+
export declare function map<T, R, A>(project: (this: A, value: T, index: number) => R, thisArg: A): OperatorFunction<T, R>;
|
|
5
|
+
//# sourceMappingURL=map.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OperatorFunction } from '../types';
|
|
2
|
+
/** @deprecated To be removed in v9. Use {@link map} instead: `map(() => value)`. */
|
|
3
|
+
export declare function mapTo<R>(value: R): OperatorFunction<unknown, R>;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Do not specify explicit type parameters. Signatures with type parameters
|
|
6
|
+
* that cannot be inferred will be removed in v8. `mapTo` itself will be removed in v9,
|
|
7
|
+
* use {@link map} instead: `map(() => value)`.
|
|
8
|
+
* */
|
|
9
|
+
export declare function mapTo<T, R>(value: R): OperatorFunction<T, R>;
|
|
10
|
+
//# sourceMappingURL=mapTo.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Notification } from '../Notification';
|
|
2
|
+
import { OperatorFunction, ObservableNotification } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents all of the notifications from the source Observable as `next`
|
|
5
|
+
* emissions marked with their original types within {@link Notification}
|
|
6
|
+
* objects.
|
|
7
|
+
*
|
|
8
|
+
* <span class="informal">Wraps `next`, `error` and `complete` emissions in
|
|
9
|
+
* {@link Notification} objects, emitted as `next` on the output Observable.
|
|
10
|
+
* </span>
|
|
11
|
+
*
|
|
12
|
+
* 
|
|
13
|
+
*
|
|
14
|
+
* `materialize` returns an Observable that emits a `next` notification for each
|
|
15
|
+
* `next`, `error`, or `complete` emission of the source Observable. When the
|
|
16
|
+
* source Observable emits `complete`, the output Observable will emit `next` as
|
|
17
|
+
* a Notification of type "complete", and then it will emit `complete` as well.
|
|
18
|
+
* When the source Observable emits `error`, the output will emit `next` as a
|
|
19
|
+
* Notification of type "error", and then `complete`.
|
|
20
|
+
*
|
|
21
|
+
* This operator is useful for producing metadata of the source Observable, to
|
|
22
|
+
* be consumed as `next` emissions. Use it in conjunction with
|
|
23
|
+
* {@link dematerialize}.
|
|
24
|
+
*
|
|
25
|
+
* ## Example
|
|
26
|
+
*
|
|
27
|
+
* Convert a faulty Observable to an Observable of Notifications
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { of, materialize, map } from 'rxjs';
|
|
31
|
+
*
|
|
32
|
+
* const letters = of('a', 'b', 13, 'd');
|
|
33
|
+
* const upperCase = letters.pipe(map((x: any) => x.toUpperCase()));
|
|
34
|
+
* const materialized = upperCase.pipe(materialize());
|
|
35
|
+
*
|
|
36
|
+
* materialized.subscribe(x => console.log(x));
|
|
37
|
+
*
|
|
38
|
+
* // Results in the following:
|
|
39
|
+
* // - Notification { kind: 'N', value: 'A', error: undefined, hasValue: true }
|
|
40
|
+
* // - Notification { kind: 'N', value: 'B', error: undefined, hasValue: true }
|
|
41
|
+
* // - Notification { kind: 'E', value: undefined, error: TypeError { message: x.toUpperCase is not a function }, hasValue: false }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link Notification}
|
|
45
|
+
* @see {@link dematerialize}
|
|
46
|
+
*
|
|
47
|
+
* @return A function that returns an Observable that emits
|
|
48
|
+
* {@link Notification} objects that wrap the original emissions from the
|
|
49
|
+
* source Observable with metadata.
|
|
50
|
+
*/
|
|
51
|
+
export declare function materialize<T>(): OperatorFunction<T, Notification<T> & ObservableNotification<T>>;
|
|
52
|
+
//# sourceMappingURL=materialize.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function),
|
|
4
|
+
* and when source Observable completes it emits a single item: the item with the largest value.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* ## Examples
|
|
9
|
+
*
|
|
10
|
+
* Get the maximal value of a series of numbers
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { of, max } from 'rxjs';
|
|
14
|
+
*
|
|
15
|
+
* of(5, 4, 7, 2, 8)
|
|
16
|
+
* .pipe(max())
|
|
17
|
+
* .subscribe(x => console.log(x));
|
|
18
|
+
*
|
|
19
|
+
* // Outputs
|
|
20
|
+
* // 8
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Use a comparer function to get the maximal item
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { of, max } from 'rxjs';
|
|
27
|
+
*
|
|
28
|
+
* of(
|
|
29
|
+
* { age: 7, name: 'Foo' },
|
|
30
|
+
* { age: 5, name: 'Bar' },
|
|
31
|
+
* { age: 9, name: 'Beer' }
|
|
32
|
+
* ).pipe(
|
|
33
|
+
* max((a, b) => a.age < b.age ? -1 : 1)
|
|
34
|
+
* )
|
|
35
|
+
* .subscribe(x => console.log(x.name));
|
|
36
|
+
*
|
|
37
|
+
* // Outputs
|
|
38
|
+
* // 'Beer'
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link min}
|
|
42
|
+
*
|
|
43
|
+
* @param {Function} [comparer] - Optional comparer function that it will use instead of its default to compare the
|
|
44
|
+
* value of two items.
|
|
45
|
+
* @return A function that returns an Observable that emits item with the
|
|
46
|
+
* largest value.
|
|
47
|
+
*/
|
|
48
|
+
export declare function max<T>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction<T>;
|
|
49
|
+
//# sourceMappingURL=max.d.ts.map
|