@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,7 @@
|
|
|
1
|
+
import { OperatorFunction, SchedulerLike, ValueFromArray } from '../types';
|
|
2
|
+
export declare function startWith<T>(value: null): OperatorFunction<T, T | null>;
|
|
3
|
+
export declare function startWith<T>(value: undefined): OperatorFunction<T, T | undefined>;
|
|
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 startWith<T, A extends readonly unknown[] = T[]>(...valuesAndScheduler: [...A, SchedulerLike]): OperatorFunction<T, T | ValueFromArray<A>>;
|
|
6
|
+
export declare function startWith<T, A extends readonly unknown[] = T[]>(...values: A): OperatorFunction<T, T | ValueFromArray<A>>;
|
|
7
|
+
//# sourceMappingURL=startWith.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Asynchronously subscribes Observers to this Observable on the specified {@link SchedulerLike}.
|
|
4
|
+
*
|
|
5
|
+
* With `subscribeOn` you can decide what type of scheduler a specific Observable will be using when it is subscribed to.
|
|
6
|
+
*
|
|
7
|
+
* Schedulers control the speed and order of emissions to observers from an Observable stream.
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* ## Example
|
|
12
|
+
*
|
|
13
|
+
* Given the following code:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { of, merge } from 'rxjs';
|
|
17
|
+
*
|
|
18
|
+
* const a = of(1, 2, 3);
|
|
19
|
+
* const b = of(4, 5, 6);
|
|
20
|
+
*
|
|
21
|
+
* merge(a, b).subscribe(console.log);
|
|
22
|
+
*
|
|
23
|
+
* // Outputs
|
|
24
|
+
* // 1
|
|
25
|
+
* // 2
|
|
26
|
+
* // 3
|
|
27
|
+
* // 4
|
|
28
|
+
* // 5
|
|
29
|
+
* // 6
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* Both Observable `a` and `b` will emit their values directly and synchronously once they are subscribed to.
|
|
33
|
+
*
|
|
34
|
+
* If we instead use the `subscribeOn` operator declaring that we want to use the {@link asyncScheduler} for values emitted by Observable `a`:
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { of, subscribeOn, asyncScheduler, merge } from 'rxjs';
|
|
38
|
+
*
|
|
39
|
+
* const a = of(1, 2, 3).pipe(subscribeOn(asyncScheduler));
|
|
40
|
+
* const b = of(4, 5, 6);
|
|
41
|
+
*
|
|
42
|
+
* merge(a, b).subscribe(console.log);
|
|
43
|
+
*
|
|
44
|
+
* // Outputs
|
|
45
|
+
* // 4
|
|
46
|
+
* // 5
|
|
47
|
+
* // 6
|
|
48
|
+
* // 1
|
|
49
|
+
* // 2
|
|
50
|
+
* // 3
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* The reason for this is that Observable `b` emits its values directly and synchronously like before
|
|
54
|
+
* but the emissions from `a` are scheduled on the event loop because we are now using the {@link asyncScheduler} for that specific Observable.
|
|
55
|
+
*
|
|
56
|
+
* @param scheduler The {@link SchedulerLike} to perform subscription actions on.
|
|
57
|
+
* @param delay A delay to pass to the scheduler to delay subscriptions
|
|
58
|
+
* @return A function that returns an Observable modified so that its
|
|
59
|
+
* subscriptions happen on the specified {@link SchedulerLike}.
|
|
60
|
+
*/
|
|
61
|
+
export declare function subscribeOn<T>(scheduler: SchedulerLike, delay?: number): MonoTypeOperatorFunction<T>;
|
|
62
|
+
//# sourceMappingURL=subscribeOn.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { OperatorFunction, ObservableInput, ObservedValueOf } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a higher-order Observable into a first-order Observable
|
|
4
|
+
* producing values only from the most recent observable sequence
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Flattens an Observable-of-Observables.</span>
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* `switchAll` subscribes to a source that is an observable of observables, also known as a
|
|
11
|
+
* "higher-order observable" (or `Observable<Observable<T>>`). It subscribes to the most recently
|
|
12
|
+
* provided "inner observable" emitted by the source, unsubscribing from any previously subscribed
|
|
13
|
+
* to inner observable, such that only the most recent inner observable may be subscribed to at
|
|
14
|
+
* any point in time. The resulting observable returned by `switchAll` will only complete if the
|
|
15
|
+
* source observable completes, *and* any currently subscribed to inner observable also has completed,
|
|
16
|
+
* if there are any.
|
|
17
|
+
*
|
|
18
|
+
* ## Examples
|
|
19
|
+
*
|
|
20
|
+
* Spawn a new interval observable for each click event, but for every new
|
|
21
|
+
* click, cancel the previous interval and subscribe to the new one
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { fromEvent, tap, map, interval, switchAll } from 'rxjs';
|
|
25
|
+
*
|
|
26
|
+
* const clicks = fromEvent(document, 'click').pipe(tap(() => console.log('click')));
|
|
27
|
+
* const source = clicks.pipe(map(() => interval(1000)));
|
|
28
|
+
*
|
|
29
|
+
* source
|
|
30
|
+
* .pipe(switchAll())
|
|
31
|
+
* .subscribe(x => console.log(x));
|
|
32
|
+
*
|
|
33
|
+
* // Output
|
|
34
|
+
* // click
|
|
35
|
+
* // 0
|
|
36
|
+
* // 1
|
|
37
|
+
* // 2
|
|
38
|
+
* // 3
|
|
39
|
+
* // ...
|
|
40
|
+
* // click
|
|
41
|
+
* // 0
|
|
42
|
+
* // 1
|
|
43
|
+
* // 2
|
|
44
|
+
* // ...
|
|
45
|
+
* // click
|
|
46
|
+
* // ...
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link combineLatestAll}
|
|
50
|
+
* @see {@link concatAll}
|
|
51
|
+
* @see {@link exhaustAll}
|
|
52
|
+
* @see {@link switchMap}
|
|
53
|
+
* @see {@link switchMapTo}
|
|
54
|
+
* @see {@link mergeAll}
|
|
55
|
+
*
|
|
56
|
+
* @return A function that returns an Observable that converts a higher-order
|
|
57
|
+
* Observable into a first-order Observable producing values only from the most
|
|
58
|
+
* recent Observable sequence.
|
|
59
|
+
*/
|
|
60
|
+
export declare function switchAll<O extends ObservableInput<any>>(): OperatorFunction<O, ObservedValueOf<O>>;
|
|
61
|
+
//# sourceMappingURL=switchAll.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
2
|
+
export declare function switchMap<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 switchMap<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 switchMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;
|
|
7
|
+
//# sourceMappingURL=switchMap.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';
|
|
2
|
+
/** @deprecated Will be removed in v9. Use {@link switchMap} instead: `switchMap(() => result)` */
|
|
3
|
+
export declare function switchMapTo<O extends ObservableInput<unknown>>(observable: O): OperatorFunction<unknown, ObservedValueOf<O>>;
|
|
4
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
5
|
+
export declare function switchMapTo<O extends ObservableInput<unknown>>(observable: O, resultSelector: undefined): OperatorFunction<unknown, ObservedValueOf<O>>;
|
|
6
|
+
/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */
|
|
7
|
+
export declare function switchMapTo<T, R, O extends ObservableInput<unknown>>(observable: O, resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>;
|
|
8
|
+
//# sourceMappingURL=switchMapTo.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ObservableInput, ObservedValueOf, OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Applies an accumulator function over the source Observable where the
|
|
4
|
+
* accumulator function itself returns an Observable, emitting values
|
|
5
|
+
* only from the most recently returned Observable.
|
|
6
|
+
*
|
|
7
|
+
* <span class="informal">It's like {@link mergeScan}, but only the most recent
|
|
8
|
+
* Observable returned by the accumulator is merged into the outer Observable.</span>
|
|
9
|
+
*
|
|
10
|
+
* @see {@link scan}
|
|
11
|
+
* @see {@link mergeScan}
|
|
12
|
+
* @see {@link switchMap}
|
|
13
|
+
*
|
|
14
|
+
* @param accumulator
|
|
15
|
+
* The accumulator function called on each source value.
|
|
16
|
+
* @param seed The initial accumulation value.
|
|
17
|
+
* @return A function that returns an observable of the accumulated values.
|
|
18
|
+
*/
|
|
19
|
+
export declare function switchScan<T, R, O extends ObservableInput<any>>(accumulator: (acc: R, value: T, index: number) => O, seed: R): OperatorFunction<T, ObservedValueOf<O>>;
|
|
20
|
+
//# sourceMappingURL=switchScan.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits only the first `count` values emitted by the source Observable.
|
|
4
|
+
*
|
|
5
|
+
* <span class="informal">Takes the first `count` values from the source, then
|
|
6
|
+
* completes.</span>
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* `take` returns an Observable that emits only the first `count` values emitted
|
|
11
|
+
* by the source Observable. If the source emits fewer than `count` values then
|
|
12
|
+
* all of its values are emitted. After that, it completes, regardless if the
|
|
13
|
+
* source completes.
|
|
14
|
+
*
|
|
15
|
+
* ## Example
|
|
16
|
+
*
|
|
17
|
+
* Take the first 5 seconds of an infinite 1-second interval Observable
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { interval, take } from 'rxjs';
|
|
21
|
+
*
|
|
22
|
+
* const intervalCount = interval(1000);
|
|
23
|
+
* const takeFive = intervalCount.pipe(take(5));
|
|
24
|
+
* takeFive.subscribe(x => console.log(x));
|
|
25
|
+
*
|
|
26
|
+
* // Logs:
|
|
27
|
+
* // 0
|
|
28
|
+
* // 1
|
|
29
|
+
* // 2
|
|
30
|
+
* // 3
|
|
31
|
+
* // 4
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @see {@link takeLast}
|
|
35
|
+
* @see {@link takeUntil}
|
|
36
|
+
* @see {@link takeWhile}
|
|
37
|
+
* @see {@link skip}
|
|
38
|
+
*
|
|
39
|
+
* @param count The maximum number of `next` values to emit.
|
|
40
|
+
* @return A function that returns an Observable that emits only the first
|
|
41
|
+
* `count` values emitted by the source Observable, or all of the values from
|
|
42
|
+
* the source if the source emits fewer than `count` values.
|
|
43
|
+
*/
|
|
44
|
+
export declare function take<T>(count: number): MonoTypeOperatorFunction<T>;
|
|
45
|
+
//# sourceMappingURL=take.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Waits for the source to complete, then emits the last N values from the source,
|
|
4
|
+
* as specified by the `count` argument.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* `takeLast` results in an observable that will hold values up to `count` values in memory,
|
|
9
|
+
* until the source completes. It then pushes all values in memory to the consumer, in the
|
|
10
|
+
* order they were received from the source, then notifies the consumer that it is
|
|
11
|
+
* complete.
|
|
12
|
+
*
|
|
13
|
+
* If for some reason the source completes before the `count` supplied to `takeLast` is reached,
|
|
14
|
+
* all values received until that point are emitted, and then completion is notified.
|
|
15
|
+
*
|
|
16
|
+
* **Warning**: Using `takeLast` with an observable that never completes will result
|
|
17
|
+
* in an observable that never emits a value.
|
|
18
|
+
*
|
|
19
|
+
* ## Example
|
|
20
|
+
*
|
|
21
|
+
* Take the last 3 values of an Observable with many values
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { range, takeLast } from 'rxjs';
|
|
25
|
+
*
|
|
26
|
+
* const many = range(1, 100);
|
|
27
|
+
* const lastThree = many.pipe(takeLast(3));
|
|
28
|
+
* lastThree.subscribe(x => console.log(x));
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see {@link take}
|
|
32
|
+
* @see {@link takeUntil}
|
|
33
|
+
* @see {@link takeWhile}
|
|
34
|
+
* @see {@link skip}
|
|
35
|
+
*
|
|
36
|
+
* @param count The maximum number of values to emit from the end of
|
|
37
|
+
* the sequence of values emitted by the source Observable.
|
|
38
|
+
* @return A function that returns an Observable that emits at most the last
|
|
39
|
+
* `count` values emitted by the source Observable.
|
|
40
|
+
*/
|
|
41
|
+
export declare function takeLast<T>(count: number): MonoTypeOperatorFunction<T>;
|
|
42
|
+
//# sourceMappingURL=takeLast.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits the values emitted by the source Observable until a `notifier`
|
|
4
|
+
* Observable emits a value.
|
|
5
|
+
*
|
|
6
|
+
* <span class="informal">Lets values pass until a second Observable,
|
|
7
|
+
* `notifier`, emits a value. Then, it completes.</span>
|
|
8
|
+
*
|
|
9
|
+
* 
|
|
10
|
+
*
|
|
11
|
+
* `takeUntil` subscribes and begins mirroring the source Observable. It also
|
|
12
|
+
* monitors a second Observable, `notifier` that you provide. If the `notifier`
|
|
13
|
+
* emits a value, the output Observable stops mirroring the source Observable
|
|
14
|
+
* and completes. If the `notifier` doesn't emit any value and completes
|
|
15
|
+
* then `takeUntil` will pass all values.
|
|
16
|
+
*
|
|
17
|
+
* ## Example
|
|
18
|
+
*
|
|
19
|
+
* Tick every second until the first click happens
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { interval, fromEvent, takeUntil } from 'rxjs';
|
|
23
|
+
*
|
|
24
|
+
* const source = interval(1000);
|
|
25
|
+
* const clicks = fromEvent(document, 'click');
|
|
26
|
+
* const result = source.pipe(takeUntil(clicks));
|
|
27
|
+
* result.subscribe(x => console.log(x));
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @see {@link take}
|
|
31
|
+
* @see {@link takeLast}
|
|
32
|
+
* @see {@link takeWhile}
|
|
33
|
+
* @see {@link skip}
|
|
34
|
+
*
|
|
35
|
+
* @param {Observable} notifier The Observable whose first emitted value will
|
|
36
|
+
* cause the output Observable of `takeUntil` to stop emitting values from the
|
|
37
|
+
* source Observable.
|
|
38
|
+
* @return A function that returns an Observable that emits the values from the
|
|
39
|
+
* source Observable until `notifier` emits its first value.
|
|
40
|
+
*/
|
|
41
|
+
export declare function takeUntil<T>(notifier: ObservableInput<any>): MonoTypeOperatorFunction<T>;
|
|
42
|
+
//# sourceMappingURL=takeUntil.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OperatorFunction, MonoTypeOperatorFunction, TruthyTypesOf } from '../types';
|
|
2
|
+
export declare function takeWhile<T>(predicate: BooleanConstructor, inclusive: true): MonoTypeOperatorFunction<T>;
|
|
3
|
+
export declare function takeWhile<T>(predicate: BooleanConstructor, inclusive: false): OperatorFunction<T, TruthyTypesOf<T>>;
|
|
4
|
+
export declare function takeWhile<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
|
|
5
|
+
export declare function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;
|
|
6
|
+
export declare function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S, inclusive: false): OperatorFunction<T, S>;
|
|
7
|
+
export declare function takeWhile<T>(predicate: (value: T, index: number) => boolean, inclusive?: boolean): MonoTypeOperatorFunction<T>;
|
|
8
|
+
//# sourceMappingURL=takeWhile.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, Observer } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* An extension to the {@link Observer} interface used only by the {@link tap} operator.
|
|
4
|
+
*
|
|
5
|
+
* It provides a useful set of callbacks a user can register to do side-effects in
|
|
6
|
+
* cases other than what the usual {@link Observer} callbacks are
|
|
7
|
+
* ({@link guide/glossary-and-semantics#next next},
|
|
8
|
+
* {@link guide/glossary-and-semantics#error error} and/or
|
|
9
|
+
* {@link guide/glossary-and-semantics#complete complete}).
|
|
10
|
+
*
|
|
11
|
+
* ## Example
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { fromEvent, switchMap, tap, interval, take } from 'rxjs';
|
|
15
|
+
*
|
|
16
|
+
* const source$ = fromEvent(document, 'click');
|
|
17
|
+
* const result$ = source$.pipe(
|
|
18
|
+
* switchMap((_, i) => i % 2 === 0
|
|
19
|
+
* ? fromEvent(document, 'mousemove').pipe(
|
|
20
|
+
* tap({
|
|
21
|
+
* subscribe: () => console.log('Subscribed to the mouse move events after click #' + i),
|
|
22
|
+
* unsubscribe: () => console.log('Mouse move events #' + i + ' unsubscribed'),
|
|
23
|
+
* finalize: () => console.log('Mouse move events #' + i + ' finalized')
|
|
24
|
+
* })
|
|
25
|
+
* )
|
|
26
|
+
* : interval(1_000).pipe(
|
|
27
|
+
* take(5),
|
|
28
|
+
* tap({
|
|
29
|
+
* subscribe: () => console.log('Subscribed to the 1-second interval events after click #' + i),
|
|
30
|
+
* unsubscribe: () => console.log('1-second interval events #' + i + ' unsubscribed'),
|
|
31
|
+
* finalize: () => console.log('1-second interval events #' + i + ' finalized')
|
|
32
|
+
* })
|
|
33
|
+
* )
|
|
34
|
+
* )
|
|
35
|
+
* );
|
|
36
|
+
*
|
|
37
|
+
* const subscription = result$.subscribe({
|
|
38
|
+
* next: console.log
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* setTimeout(() => {
|
|
42
|
+
* console.log('Unsubscribe after 60 seconds');
|
|
43
|
+
* subscription.unsubscribe();
|
|
44
|
+
* }, 60_000);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export interface TapObserver<T> extends Observer<T> {
|
|
48
|
+
/**
|
|
49
|
+
* The callback that `tap` operator invokes at the moment when the source Observable
|
|
50
|
+
* gets subscribed to.
|
|
51
|
+
*/
|
|
52
|
+
subscribe: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* The callback that `tap` operator invokes when an explicit
|
|
55
|
+
* {@link guide/glossary-and-semantics#unsubscription unsubscribe} happens. It won't get invoked on
|
|
56
|
+
* `error` or `complete` events.
|
|
57
|
+
*/
|
|
58
|
+
unsubscribe: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* The callback that `tap` operator invokes when any kind of
|
|
61
|
+
* {@link guide/glossary-and-semantics#finalization finalization} happens - either when
|
|
62
|
+
* the source Observable `error`s or `complete`s or when it gets explicitly unsubscribed
|
|
63
|
+
* by the user. There is no difference in using this callback or the {@link finalize}
|
|
64
|
+
* operator, but if you're already using `tap` operator, you can use this callback
|
|
65
|
+
* instead. You'd get the same result in either case.
|
|
66
|
+
*/
|
|
67
|
+
finalize: () => void;
|
|
68
|
+
}
|
|
69
|
+
export declare function tap<T>(observerOrNext?: Partial<TapObserver<T>> | ((value: T) => void)): MonoTypeOperatorFunction<T>;
|
|
70
|
+
/** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */
|
|
71
|
+
export declare function tap<T>(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): MonoTypeOperatorFunction<T>;
|
|
72
|
+
//# sourceMappingURL=tap.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction, ObservableInput } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* An object interface used by {@link throttle} or {@link throttleTime} that ensure
|
|
4
|
+
* configuration options of these operators.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link throttle}
|
|
7
|
+
* @see {@link throttleTime}
|
|
8
|
+
*/
|
|
9
|
+
export interface ThrottleConfig {
|
|
10
|
+
/**
|
|
11
|
+
* If `true`, the resulting Observable will emit the first value from the source
|
|
12
|
+
* Observable at the **start** of the "throttling" process (when starting an
|
|
13
|
+
* internal timer that prevents other emissions from the source to pass through).
|
|
14
|
+
* If `false`, it will not emit the first value from the source Observable at the
|
|
15
|
+
* start of the "throttling" process.
|
|
16
|
+
*
|
|
17
|
+
* If not provided, defaults to: `true`.
|
|
18
|
+
*/
|
|
19
|
+
leading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If `true`, the resulting Observable will emit the last value from the source
|
|
22
|
+
* Observable at the **end** of the "throttling" process (when ending an internal
|
|
23
|
+
* timer that prevents other emissions from the source to pass through).
|
|
24
|
+
* If `false`, it will not emit the last value from the source Observable at the
|
|
25
|
+
* end of the "throttling" process.
|
|
26
|
+
*
|
|
27
|
+
* If not provided, defaults to: `false`.
|
|
28
|
+
*/
|
|
29
|
+
trailing?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Emits a value from the source Observable, then ignores subsequent source
|
|
33
|
+
* values for a duration determined by another Observable, then repeats this
|
|
34
|
+
* process.
|
|
35
|
+
*
|
|
36
|
+
* <span class="informal">It's like {@link throttleTime}, but the silencing
|
|
37
|
+
* duration is determined by a second Observable.</span>
|
|
38
|
+
*
|
|
39
|
+
* 
|
|
40
|
+
*
|
|
41
|
+
* `throttle` emits the source Observable values on the output Observable
|
|
42
|
+
* when its internal timer is disabled, and ignores source values when the timer
|
|
43
|
+
* is enabled. Initially, the timer is disabled. As soon as the first source
|
|
44
|
+
* value arrives, it is forwarded to the output Observable, and then the timer
|
|
45
|
+
* is enabled by calling the `durationSelector` function with the source value,
|
|
46
|
+
* which returns the "duration" Observable. When the duration Observable emits a
|
|
47
|
+
* value, the timer is disabled, and this process repeats for the
|
|
48
|
+
* next source value.
|
|
49
|
+
*
|
|
50
|
+
* ## Example
|
|
51
|
+
*
|
|
52
|
+
* Emit clicks at a rate of at most one click per second
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { fromEvent, throttle, interval } from 'rxjs';
|
|
56
|
+
*
|
|
57
|
+
* const clicks = fromEvent(document, 'click');
|
|
58
|
+
* const result = clicks.pipe(throttle(() => interval(1000)));
|
|
59
|
+
*
|
|
60
|
+
* result.subscribe(x => console.log(x));
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see {@link audit}
|
|
64
|
+
* @see {@link debounce}
|
|
65
|
+
* @see {@link delayWhen}
|
|
66
|
+
* @see {@link sample}
|
|
67
|
+
* @see {@link throttleTime}
|
|
68
|
+
*
|
|
69
|
+
* @param durationSelector A function that receives a value from the source
|
|
70
|
+
* Observable, for computing the silencing duration for each source value,
|
|
71
|
+
* returned as an `ObservableInput`.
|
|
72
|
+
* @param config A configuration object to define `leading` and `trailing`
|
|
73
|
+
* behavior. Defaults to `{ leading: true, trailing: false }`.
|
|
74
|
+
* @return A function that returns an Observable that performs the throttle
|
|
75
|
+
* operation to limit the rate of emissions from the source.
|
|
76
|
+
*/
|
|
77
|
+
export declare function throttle<T>(durationSelector: (value: T) => ObservableInput<any>, config?: ThrottleConfig): MonoTypeOperatorFunction<T>;
|
|
78
|
+
//# sourceMappingURL=throttle.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ThrottleConfig } from './throttle';
|
|
2
|
+
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Emits a value from the source Observable, then ignores subsequent source
|
|
5
|
+
* values for `duration` milliseconds, then repeats this process.
|
|
6
|
+
*
|
|
7
|
+
* <span class="informal">Lets a value pass, then ignores source values for the
|
|
8
|
+
* next `duration` milliseconds.</span>
|
|
9
|
+
*
|
|
10
|
+
* 
|
|
11
|
+
*
|
|
12
|
+
* `throttleTime` emits the source Observable values on the output Observable
|
|
13
|
+
* when its internal timer is disabled, and ignores source values when the timer
|
|
14
|
+
* is enabled. Initially, the timer is disabled. As soon as the first source
|
|
15
|
+
* value arrives, it is forwarded to the output Observable, and then the timer
|
|
16
|
+
* is enabled. After `duration` milliseconds (or the time unit determined
|
|
17
|
+
* internally by the optional `scheduler`) has passed, the timer is disabled,
|
|
18
|
+
* and this process repeats for the next source value. Optionally takes a
|
|
19
|
+
* {@link SchedulerLike} for managing timers.
|
|
20
|
+
*
|
|
21
|
+
* ## Examples
|
|
22
|
+
*
|
|
23
|
+
* ### Limit click rate
|
|
24
|
+
*
|
|
25
|
+
* Emit clicks at a rate of at most one click per second
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { fromEvent, throttleTime } from 'rxjs';
|
|
29
|
+
*
|
|
30
|
+
* const clicks = fromEvent(document, 'click');
|
|
31
|
+
* const result = clicks.pipe(throttleTime(1000));
|
|
32
|
+
*
|
|
33
|
+
* result.subscribe(x => console.log(x));
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see {@link auditTime}
|
|
37
|
+
* @see {@link debounceTime}
|
|
38
|
+
* @see {@link delay}
|
|
39
|
+
* @see {@link sampleTime}
|
|
40
|
+
* @see {@link throttle}
|
|
41
|
+
*
|
|
42
|
+
* @param duration Time to wait before emitting another value after
|
|
43
|
+
* emitting the last value, measured in milliseconds or the time unit determined
|
|
44
|
+
* internally by the optional `scheduler`.
|
|
45
|
+
* @param scheduler The {@link SchedulerLike} to use for
|
|
46
|
+
* managing the timers that handle the throttling. Defaults to {@link asyncScheduler}.
|
|
47
|
+
* @param config A configuration object to define `leading` and
|
|
48
|
+
* `trailing` behavior. Defaults to `{ leading: true, trailing: false }`.
|
|
49
|
+
* @return A function that returns an Observable that performs the throttle
|
|
50
|
+
* operation to limit the rate of emissions from the source.
|
|
51
|
+
*/
|
|
52
|
+
export declare function throttleTime<T>(duration: number, scheduler?: SchedulerLike, config?: ThrottleConfig): MonoTypeOperatorFunction<T>;
|
|
53
|
+
//# sourceMappingURL=throttleTime.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { MonoTypeOperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* If the source observable completes without emitting a value, it will emit
|
|
4
|
+
* an error. The error will be created at that time by the optional
|
|
5
|
+
* `errorFactory` argument, otherwise, the error will be {@link EmptyError}.
|
|
6
|
+
*
|
|
7
|
+
* 
|
|
8
|
+
*
|
|
9
|
+
* ## Example
|
|
10
|
+
*
|
|
11
|
+
* Throw an error if the document wasn't clicked within 1 second
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { fromEvent, takeUntil, timer, throwIfEmpty } from 'rxjs';
|
|
15
|
+
*
|
|
16
|
+
* const click$ = fromEvent(document, 'click');
|
|
17
|
+
*
|
|
18
|
+
* click$.pipe(
|
|
19
|
+
* takeUntil(timer(1000)),
|
|
20
|
+
* throwIfEmpty(() => new Error('The document was not clicked within 1 second'))
|
|
21
|
+
* )
|
|
22
|
+
* .subscribe({
|
|
23
|
+
* next() {
|
|
24
|
+
* console.log('The document was clicked');
|
|
25
|
+
* },
|
|
26
|
+
* error(err) {
|
|
27
|
+
* console.error(err.message);
|
|
28
|
+
* }
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param errorFactory A factory function called to produce the
|
|
33
|
+
* error to be thrown when the source observable completes without emitting a
|
|
34
|
+
* value.
|
|
35
|
+
* @return A function that returns an Observable that throws an error if the
|
|
36
|
+
* source Observable completed without emitting.
|
|
37
|
+
*/
|
|
38
|
+
export declare function throwIfEmpty<T>(errorFactory?: () => any): MonoTypeOperatorFunction<T>;
|
|
39
|
+
//# sourceMappingURL=throwIfEmpty.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SchedulerLike, OperatorFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Emits an object containing the current value, and the time that has
|
|
4
|
+
* passed between emitting the current value and the previous value, which is
|
|
5
|
+
* calculated by using the provided `scheduler`'s `now()` method to retrieve
|
|
6
|
+
* the current time at each emission, then calculating the difference. The `scheduler`
|
|
7
|
+
* defaults to {@link asyncScheduler}, so by default, the `interval` will be in
|
|
8
|
+
* milliseconds.
|
|
9
|
+
*
|
|
10
|
+
* <span class="informal">Convert an Observable that emits items into one that
|
|
11
|
+
* emits indications of the amount of time elapsed between those emissions.</span>
|
|
12
|
+
*
|
|
13
|
+
* 
|
|
14
|
+
*
|
|
15
|
+
* ## Example
|
|
16
|
+
*
|
|
17
|
+
* Emit interval between current value with the last value
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { interval, timeInterval } from 'rxjs';
|
|
21
|
+
*
|
|
22
|
+
* const seconds = interval(1000);
|
|
23
|
+
*
|
|
24
|
+
* seconds
|
|
25
|
+
* .pipe(timeInterval())
|
|
26
|
+
* .subscribe(value => console.log(value));
|
|
27
|
+
*
|
|
28
|
+
* // NOTE: The values will never be this precise,
|
|
29
|
+
* // intervals created with `interval` or `setInterval`
|
|
30
|
+
* // are non-deterministic.
|
|
31
|
+
*
|
|
32
|
+
* // { value: 0, interval: 1000 }
|
|
33
|
+
* // { value: 1, interval: 1000 }
|
|
34
|
+
* // { value: 2, interval: 1000 }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @param {SchedulerLike} [scheduler] Scheduler used to get the current time.
|
|
38
|
+
* @return A function that returns an Observable that emits information about
|
|
39
|
+
* value and interval.
|
|
40
|
+
*/
|
|
41
|
+
export declare function timeInterval<T>(scheduler?: SchedulerLike): OperatorFunction<T, TimeInterval<T>>;
|
|
42
|
+
export declare class TimeInterval<T> {
|
|
43
|
+
value: T;
|
|
44
|
+
interval: number;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Internal implementation detail, do not construct directly. Will be made an interface in v8.
|
|
47
|
+
*/
|
|
48
|
+
constructor(value: T, interval: number);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=timeInterval.d.ts.map
|