@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,55 @@
|
|
|
1
|
+
import { Action } from './scheduler/Action';
|
|
2
|
+
import { Subscription } from './Subscription';
|
|
3
|
+
import { SchedulerLike, SchedulerAction } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* An execution context and a data structure to order tasks and schedule their
|
|
6
|
+
* execution. Provides a notion of (potentially virtual) time, through the
|
|
7
|
+
* `now()` getter method.
|
|
8
|
+
*
|
|
9
|
+
* Each unit of work in a Scheduler is called an `Action`.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* class Scheduler {
|
|
13
|
+
* now(): number;
|
|
14
|
+
* schedule(work, delay?, state?): Subscription;
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @class Scheduler
|
|
19
|
+
* @deprecated Scheduler is an internal implementation detail of RxJS, and
|
|
20
|
+
* should not be used directly. Rather, create your own class and implement
|
|
21
|
+
* {@link SchedulerLike}. Will be made internal in v8.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Scheduler implements SchedulerLike {
|
|
24
|
+
private schedulerActionCtor;
|
|
25
|
+
static now: () => number;
|
|
26
|
+
constructor(schedulerActionCtor: typeof Action, now?: () => number);
|
|
27
|
+
/**
|
|
28
|
+
* A getter method that returns a number representing the current time
|
|
29
|
+
* (at the time this function was called) according to the scheduler's own
|
|
30
|
+
* internal clock.
|
|
31
|
+
* @return {number} A number that represents the current time. May or may not
|
|
32
|
+
* have a relation to wall-clock time. May or may not refer to a time unit
|
|
33
|
+
* (e.g. milliseconds).
|
|
34
|
+
*/
|
|
35
|
+
now: () => number;
|
|
36
|
+
/**
|
|
37
|
+
* Schedules a function, `work`, for execution. May happen at some point in
|
|
38
|
+
* the future, according to the `delay` parameter, if specified. May be passed
|
|
39
|
+
* some context object, `state`, which will be passed to the `work` function.
|
|
40
|
+
*
|
|
41
|
+
* The given arguments will be processed an stored as an Action object in a
|
|
42
|
+
* queue of actions.
|
|
43
|
+
*
|
|
44
|
+
* @param {function(state: ?T): ?Subscription} work A function representing a
|
|
45
|
+
* task, or some unit of work to be executed by the Scheduler.
|
|
46
|
+
* @param {number} [delay] Time to wait before executing the work, where the
|
|
47
|
+
* time unit is implicit and defined by the Scheduler itself.
|
|
48
|
+
* @param {T} [state] Some contextual data that the `work` function uses when
|
|
49
|
+
* called by the Scheduler.
|
|
50
|
+
* @return {Subscription} A subscription in order to be able to unsubscribe
|
|
51
|
+
* the scheduled work.
|
|
52
|
+
*/
|
|
53
|
+
schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay?: number, state?: T): Subscription;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=Scheduler.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Operator } from './Operator';
|
|
2
|
+
import { Observable } from './Observable';
|
|
3
|
+
import { Observer, SubscriptionLike } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* A Subject is a special type of Observable that allows values to be
|
|
6
|
+
* multicasted to many Observers. Subjects are like EventEmitters.
|
|
7
|
+
*
|
|
8
|
+
* Every Subject is an Observable and an Observer. You can subscribe to a
|
|
9
|
+
* Subject, and you can call next to feed values as well as error and complete.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Subject<T> extends Observable<T> implements SubscriptionLike {
|
|
12
|
+
closed: boolean;
|
|
13
|
+
private currentObservers;
|
|
14
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
15
|
+
observers: Observer<T>[];
|
|
16
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
17
|
+
isStopped: boolean;
|
|
18
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
19
|
+
hasError: boolean;
|
|
20
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
21
|
+
thrownError: any;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a "subject" by basically gluing an observer to an observable.
|
|
24
|
+
*
|
|
25
|
+
* @nocollapse
|
|
26
|
+
* @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.
|
|
27
|
+
*/
|
|
28
|
+
static create: (...args: any[]) => any;
|
|
29
|
+
constructor();
|
|
30
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
31
|
+
lift<R>(operator: Operator<T, R>): Observable<R>;
|
|
32
|
+
next(value: T): void;
|
|
33
|
+
error(err: any): void;
|
|
34
|
+
complete(): void;
|
|
35
|
+
unsubscribe(): void;
|
|
36
|
+
get observed(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new Observable with this Subject as the source. You can do this
|
|
39
|
+
* to create custom Observer-side logic of the Subject and conceal it from
|
|
40
|
+
* code that uses the Observable.
|
|
41
|
+
* @return {Observable} Observable that the Subject casts to
|
|
42
|
+
*/
|
|
43
|
+
asObservable(): Observable<T>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @class AnonymousSubject<T>
|
|
47
|
+
*/
|
|
48
|
+
export declare class AnonymousSubject<T> extends Subject<T> {
|
|
49
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
50
|
+
destination?: Observer<T> | undefined;
|
|
51
|
+
constructor(
|
|
52
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
53
|
+
destination?: Observer<T> | undefined, source?: Observable<T>);
|
|
54
|
+
next(value: T): void;
|
|
55
|
+
error(err: any): void;
|
|
56
|
+
complete(): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=Subject.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Observer } from './types';
|
|
2
|
+
import { Subscription } from './Subscription';
|
|
3
|
+
/**
|
|
4
|
+
* Implements the {@link Observer} interface and extends the
|
|
5
|
+
* {@link Subscription} class. While the {@link Observer} is the public API for
|
|
6
|
+
* consuming the values of an {@link Observable}, all Observers get converted to
|
|
7
|
+
* a Subscriber, in order to provide Subscription-like capabilities such as
|
|
8
|
+
* `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
|
|
9
|
+
* implementing operators, but it is rarely used as a public API.
|
|
10
|
+
*
|
|
11
|
+
* @class Subscriber<T>
|
|
12
|
+
*/
|
|
13
|
+
export declare class Subscriber<T> extends Subscription implements Observer<T> {
|
|
14
|
+
/**
|
|
15
|
+
* A static factory for a Subscriber, given a (potentially partial) definition
|
|
16
|
+
* of an Observer.
|
|
17
|
+
* @param next The `next` callback of an Observer.
|
|
18
|
+
* @param error The `error` callback of an
|
|
19
|
+
* Observer.
|
|
20
|
+
* @param complete The `complete` callback of an
|
|
21
|
+
* Observer.
|
|
22
|
+
* @return A Subscriber wrapping the (partially defined)
|
|
23
|
+
* Observer represented by the given arguments.
|
|
24
|
+
* @nocollapse
|
|
25
|
+
* @deprecated Do not use. Will be removed in v8. There is no replacement for this
|
|
26
|
+
* method, and there is no reason to be creating instances of `Subscriber` directly.
|
|
27
|
+
* If you have a specific use case, please file an issue.
|
|
28
|
+
*/
|
|
29
|
+
static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T>;
|
|
30
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
31
|
+
protected isStopped: boolean;
|
|
32
|
+
/** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */
|
|
33
|
+
protected destination: Subscriber<any> | Observer<any>;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
|
36
|
+
* There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.
|
|
37
|
+
*/
|
|
38
|
+
constructor(destination?: Subscriber<any> | Observer<any>);
|
|
39
|
+
/**
|
|
40
|
+
* The {@link Observer} callback to receive notifications of type `next` from
|
|
41
|
+
* the Observable, with a value. The Observable may call this method 0 or more
|
|
42
|
+
* times.
|
|
43
|
+
* @param {T} [value] The `next` value.
|
|
44
|
+
* @return {void}
|
|
45
|
+
*/
|
|
46
|
+
next(value?: T): void;
|
|
47
|
+
/**
|
|
48
|
+
* The {@link Observer} callback to receive notifications of type `error` from
|
|
49
|
+
* the Observable, with an attached `Error`. Notifies the Observer that
|
|
50
|
+
* the Observable has experienced an error condition.
|
|
51
|
+
* @param {any} [err] The `error` exception.
|
|
52
|
+
* @return {void}
|
|
53
|
+
*/
|
|
54
|
+
error(err?: any): void;
|
|
55
|
+
/**
|
|
56
|
+
* The {@link Observer} callback to receive a valueless notification of type
|
|
57
|
+
* `complete` from the Observable. Notifies the Observer that the Observable
|
|
58
|
+
* has finished sending push-based notifications.
|
|
59
|
+
* @return {void}
|
|
60
|
+
*/
|
|
61
|
+
complete(): void;
|
|
62
|
+
unsubscribe(): void;
|
|
63
|
+
protected _next(value: T): void;
|
|
64
|
+
protected _error(err: any): void;
|
|
65
|
+
protected _complete(): void;
|
|
66
|
+
}
|
|
67
|
+
export declare class SafeSubscriber<T> extends Subscriber<T> {
|
|
68
|
+
constructor(observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null, error?: ((e?: any) => void) | null, complete?: (() => void) | null);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The observer used as a stub for subscriptions where the user did not
|
|
72
|
+
* pass any arguments to `subscribe`. Comes with the default error handling
|
|
73
|
+
* behavior.
|
|
74
|
+
*/
|
|
75
|
+
export declare const EMPTY_OBSERVER: Readonly<Observer<any>> & {
|
|
76
|
+
closed: true;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=Subscriber.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { SubscriptionLike, TeardownLogic } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a disposable resource, such as the execution of an Observable. A
|
|
4
|
+
* Subscription has one important method, `unsubscribe`, that takes no argument
|
|
5
|
+
* and just disposes the resource held by the subscription.
|
|
6
|
+
*
|
|
7
|
+
* Additionally, subscriptions may be grouped together through the `add()`
|
|
8
|
+
* method, which will attach a child Subscription to the current Subscription.
|
|
9
|
+
* When a Subscription is unsubscribed, all its children (and its grandchildren)
|
|
10
|
+
* will be unsubscribed as well.
|
|
11
|
+
*
|
|
12
|
+
* @class Subscription
|
|
13
|
+
*/
|
|
14
|
+
export declare class Subscription implements SubscriptionLike {
|
|
15
|
+
private initialTeardown?;
|
|
16
|
+
/** @nocollapse */
|
|
17
|
+
static EMPTY: Subscription;
|
|
18
|
+
/**
|
|
19
|
+
* A flag to indicate whether this Subscription has already been unsubscribed.
|
|
20
|
+
*/
|
|
21
|
+
closed: boolean;
|
|
22
|
+
private _parentage;
|
|
23
|
+
/**
|
|
24
|
+
* The list of registered finalizers to execute upon unsubscription. Adding and removing from this
|
|
25
|
+
* list occurs in the {@link #add} and {@link #remove} methods.
|
|
26
|
+
*/
|
|
27
|
+
private _finalizers;
|
|
28
|
+
/**
|
|
29
|
+
* @param initialTeardown A function executed first as part of the finalization
|
|
30
|
+
* process that is kicked off when {@link #unsubscribe} is called.
|
|
31
|
+
*/
|
|
32
|
+
constructor(initialTeardown?: (() => void) | undefined);
|
|
33
|
+
/**
|
|
34
|
+
* Disposes the resources held by the subscription. May, for instance, cancel
|
|
35
|
+
* an ongoing Observable execution or cancel any other type of work that
|
|
36
|
+
* started when the Subscription was created.
|
|
37
|
+
* @return {void}
|
|
38
|
+
*/
|
|
39
|
+
unsubscribe(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Adds a finalizer to this subscription, so that finalization will be unsubscribed/called
|
|
42
|
+
* when this subscription is unsubscribed. If this subscription is already {@link #closed},
|
|
43
|
+
* because it has already been unsubscribed, then whatever finalizer is passed to it
|
|
44
|
+
* will automatically be executed (unless the finalizer itself is also a closed subscription).
|
|
45
|
+
*
|
|
46
|
+
* Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed
|
|
47
|
+
* subscription to a any subscription will result in no operation. (A noop).
|
|
48
|
+
*
|
|
49
|
+
* Adding a subscription to itself, or adding `null` or `undefined` will not perform any
|
|
50
|
+
* operation at all. (A noop).
|
|
51
|
+
*
|
|
52
|
+
* `Subscription` instances that are added to this instance will automatically remove themselves
|
|
53
|
+
* if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove
|
|
54
|
+
* will need to be removed manually with {@link #remove}
|
|
55
|
+
*
|
|
56
|
+
* @param teardown The finalization logic to add to this subscription.
|
|
57
|
+
*/
|
|
58
|
+
add(teardown: TeardownLogic): void;
|
|
59
|
+
/**
|
|
60
|
+
* Checks to see if a this subscription already has a particular parent.
|
|
61
|
+
* This will signal that this subscription has already been added to the parent in question.
|
|
62
|
+
* @param parent the parent to check for
|
|
63
|
+
*/
|
|
64
|
+
private _hasParent;
|
|
65
|
+
/**
|
|
66
|
+
* Adds a parent to this subscription so it can be removed from the parent if it
|
|
67
|
+
* unsubscribes on it's own.
|
|
68
|
+
*
|
|
69
|
+
* NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.
|
|
70
|
+
* @param parent The parent subscription to add
|
|
71
|
+
*/
|
|
72
|
+
private _addParent;
|
|
73
|
+
/**
|
|
74
|
+
* Called on a child when it is removed via {@link #remove}.
|
|
75
|
+
* @param parent The parent to remove
|
|
76
|
+
*/
|
|
77
|
+
private _removeParent;
|
|
78
|
+
/**
|
|
79
|
+
* Removes a finalizer from this subscription that was previously added with the {@link #add} method.
|
|
80
|
+
*
|
|
81
|
+
* Note that `Subscription` instances, when unsubscribed, will automatically remove themselves
|
|
82
|
+
* from every other `Subscription` they have been added to. This means that using the `remove` method
|
|
83
|
+
* is not a common thing and should be used thoughtfully.
|
|
84
|
+
*
|
|
85
|
+
* If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance
|
|
86
|
+
* more than once, you will need to call `remove` the same number of times to remove all instances.
|
|
87
|
+
*
|
|
88
|
+
* All finalizer instances are removed to free up memory upon unsubscription.
|
|
89
|
+
*
|
|
90
|
+
* @param teardown The finalizer to remove from this subscription
|
|
91
|
+
*/
|
|
92
|
+
remove(teardown: Exclude<TeardownLogic, void>): void;
|
|
93
|
+
}
|
|
94
|
+
export declare const EMPTY_SUBSCRIPTION: Subscription;
|
|
95
|
+
export declare function isSubscription(value: any): value is Subscription;
|
|
96
|
+
//# sourceMappingURL=Subscription.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Subscriber } from './Subscriber';
|
|
2
|
+
import { ObservableNotification } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The {@link GlobalConfig} object for RxJS. It is used to configure things
|
|
5
|
+
* like how to react on unhandled errors.
|
|
6
|
+
*/
|
|
7
|
+
export declare const config: GlobalConfig;
|
|
8
|
+
/**
|
|
9
|
+
* The global configuration object for RxJS, used to configure things
|
|
10
|
+
* like how to react on unhandled errors. Accessible via {@link config}
|
|
11
|
+
* object.
|
|
12
|
+
*/
|
|
13
|
+
export interface GlobalConfig {
|
|
14
|
+
/**
|
|
15
|
+
* A registration point for unhandled errors from RxJS. These are errors that
|
|
16
|
+
* cannot were not handled by consuming code in the usual subscription path. For
|
|
17
|
+
* example, if you have this configured, and you subscribe to an observable without
|
|
18
|
+
* providing an error handler, errors from that subscription will end up here. This
|
|
19
|
+
* will _always_ be called asynchronously on another job in the runtime. This is because
|
|
20
|
+
* we do not want errors thrown in this user-configured handler to interfere with the
|
|
21
|
+
* behavior of the library.
|
|
22
|
+
*/
|
|
23
|
+
onUnhandledError: ((err: any) => void) | null;
|
|
24
|
+
/**
|
|
25
|
+
* A registration point for notifications that cannot be sent to subscribers because they
|
|
26
|
+
* have completed, errored or have been explicitly unsubscribed. By default, next, complete
|
|
27
|
+
* and error notifications sent to stopped subscribers are noops. However, sometimes callers
|
|
28
|
+
* might want a different behavior. For example, with sources that attempt to report errors
|
|
29
|
+
* to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.
|
|
30
|
+
* This will _always_ be called asynchronously on another job in the runtime. This is because
|
|
31
|
+
* we do not want errors thrown in this user-configured handler to interfere with the
|
|
32
|
+
* behavior of the library.
|
|
33
|
+
*/
|
|
34
|
+
onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;
|
|
35
|
+
/**
|
|
36
|
+
* The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}
|
|
37
|
+
* methods.
|
|
38
|
+
*
|
|
39
|
+
* @deprecated As of version 8, RxJS will no longer support this sort of injection of a
|
|
40
|
+
* Promise constructor. If you need a Promise implementation other than native promises,
|
|
41
|
+
* please polyfill/patch Promise as you see appropriate. Will be removed in v8.
|
|
42
|
+
*/
|
|
43
|
+
Promise?: PromiseConstructorLike;
|
|
44
|
+
/**
|
|
45
|
+
* If true, turns on synchronous error rethrowing, which is a deprecated behavior
|
|
46
|
+
* in v6 and higher. This behavior enables bad patterns like wrapping a subscribe
|
|
47
|
+
* call in a try/catch block. It also enables producer interference, a nasty bug
|
|
48
|
+
* where a multicast can be broken for all observers by a downstream consumer with
|
|
49
|
+
* an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME
|
|
50
|
+
* FOR MIGRATION REASONS.
|
|
51
|
+
*
|
|
52
|
+
* @deprecated As of version 8, RxJS will no longer support synchronous throwing
|
|
53
|
+
* of unhandled errors. All errors will be thrown on a separate call stack to prevent bad
|
|
54
|
+
* behaviors described above. Will be removed in v8.
|
|
55
|
+
*/
|
|
56
|
+
useDeprecatedSynchronousErrorHandling: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* If true, enables an as-of-yet undocumented feature from v5: The ability to access
|
|
59
|
+
* `unsubscribe()` via `this` context in `next` functions created in observers passed
|
|
60
|
+
* to `subscribe`.
|
|
61
|
+
*
|
|
62
|
+
* This is being removed because the performance was severely problematic, and it could also cause
|
|
63
|
+
* issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have
|
|
64
|
+
* their `this` context overwritten.
|
|
65
|
+
*
|
|
66
|
+
* @deprecated As of version 8, RxJS will no longer support altering the
|
|
67
|
+
* context of next functions provided as part of an observer to Subscribe. Instead,
|
|
68
|
+
* you will have access to a subscription or a signal or token that will allow you to do things like
|
|
69
|
+
* unsubscribe and test closed status. Will be removed in v8.
|
|
70
|
+
*/
|
|
71
|
+
useDeprecatedNextContext: boolean;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Observable } from './Observable';
|
|
2
|
+
export interface FirstValueFromConfig<T> {
|
|
3
|
+
defaultValue: T;
|
|
4
|
+
}
|
|
5
|
+
export declare function firstValueFrom<T, D>(source: Observable<T>, config: FirstValueFromConfig<D>): Promise<T | D>;
|
|
6
|
+
export declare function firstValueFrom<T>(source: Observable<T>): Promise<T>;
|
|
7
|
+
//# sourceMappingURL=firstValueFrom.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Observable } from './Observable';
|
|
2
|
+
export interface LastValueFromConfig<T> {
|
|
3
|
+
defaultValue: T;
|
|
4
|
+
}
|
|
5
|
+
export declare function lastValueFrom<T, D>(source: Observable<T>, config: LastValueFromConfig<D>): Promise<T | D>;
|
|
6
|
+
export declare function lastValueFrom<T>(source: Observable<T>): Promise<T>;
|
|
7
|
+
//# sourceMappingURL=lastValueFrom.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Subject } from '../Subject';
|
|
2
|
+
import { Observable } from '../Observable';
|
|
3
|
+
import { Subscription } from '../Subscription';
|
|
4
|
+
/**
|
|
5
|
+
* @class ConnectableObservable<T>
|
|
6
|
+
* @deprecated Will be removed in v8. Use {@link connectable} to create a connectable observable.
|
|
7
|
+
* If you are using the `refCount` method of `ConnectableObservable`, use the {@link share} operator
|
|
8
|
+
* instead.
|
|
9
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
10
|
+
*/
|
|
11
|
+
export declare class ConnectableObservable<T> extends Observable<T> {
|
|
12
|
+
source: Observable<T>;
|
|
13
|
+
protected subjectFactory: () => Subject<T>;
|
|
14
|
+
protected _subject: Subject<T> | null;
|
|
15
|
+
protected _refCount: number;
|
|
16
|
+
protected _connection: Subscription | null;
|
|
17
|
+
/**
|
|
18
|
+
* @param source The source observable
|
|
19
|
+
* @param subjectFactory The factory that creates the subject used internally.
|
|
20
|
+
* @deprecated Will be removed in v8. Use {@link connectable} to create a connectable observable.
|
|
21
|
+
* `new ConnectableObservable(source, factory)` is equivalent to
|
|
22
|
+
* `connectable(source, { connector: factory })`.
|
|
23
|
+
* When the `refCount()` method is needed, the {@link share} operator should be used instead:
|
|
24
|
+
* `new ConnectableObservable(source, factory).refCount()` is equivalent to
|
|
25
|
+
* `source.pipe(share({ connector: factory }))`.
|
|
26
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
27
|
+
*/
|
|
28
|
+
constructor(source: Observable<T>, subjectFactory: () => Subject<T>);
|
|
29
|
+
protected getSubject(): Subject<T>;
|
|
30
|
+
protected _teardown(): void;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated {@link ConnectableObservable} will be removed in v8. Use {@link connectable} instead.
|
|
33
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
34
|
+
*/
|
|
35
|
+
connect(): Subscription;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated {@link ConnectableObservable} will be removed in v8. Use the {@link share} operator instead.
|
|
38
|
+
* Details: https://rxjs.dev/deprecations/multicasting
|
|
39
|
+
*/
|
|
40
|
+
refCount(): Observable<T>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=ConnectableObservable.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SchedulerLike } from '../types';
|
|
2
|
+
import { Observable } from '../Observable';
|
|
3
|
+
export declare function bindCallback(callbackFunc: (...args: any[]) => void, resultSelector: (...args: any[]) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;
|
|
4
|
+
export declare function bindCallback<A extends readonly unknown[], R extends readonly unknown[]>(callbackFunc: (...args: [...A, (...res: R) => void]) => void, schedulerLike?: SchedulerLike): (...arg: A) => Observable<R extends [] ? void : R extends [any] ? R[0] : R>;
|
|
5
|
+
//# sourceMappingURL=bindCallback.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { SchedulerLike } from '../types';
|
|
3
|
+
export declare function bindNodeCallback(callbackFunc: (...args: any[]) => void, resultSelector: (...args: any[]) => any, scheduler?: SchedulerLike): (...args: any[]) => Observable<any>;
|
|
4
|
+
export declare function bindNodeCallback<A extends readonly unknown[], R extends readonly unknown[]>(callbackFunc: (...args: [...A, (err: any, ...res: R) => void]) => void, schedulerLike?: SchedulerLike): (...arg: A) => Observable<R extends [] ? void : R extends [any] ? R[0] : R>;
|
|
5
|
+
//# sourceMappingURL=bindNodeCallback.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { ObservableInput, SchedulerLike, ObservedValueOf, ObservableInputTuple } from '../types';
|
|
3
|
+
import { Subscriber } from '../Subscriber';
|
|
4
|
+
import { AnyCatcher } from '../AnyCatcher';
|
|
5
|
+
/**
|
|
6
|
+
* You have passed `any` here, we can't figure out if it is
|
|
7
|
+
* an array or an object, so you're getting `unknown`. Use better types.
|
|
8
|
+
* @param arg Something typed as `any`
|
|
9
|
+
*/
|
|
10
|
+
export declare function combineLatest<T extends AnyCatcher>(arg: T): Observable<unknown>;
|
|
11
|
+
export declare function combineLatest(sources: []): Observable<never>;
|
|
12
|
+
export declare function combineLatest<A extends readonly unknown[]>(sources: readonly [...ObservableInputTuple<A>]): Observable<A>;
|
|
13
|
+
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `combineLatestAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
14
|
+
export declare function combineLatest<A extends readonly unknown[], R>(sources: readonly [...ObservableInputTuple<A>], resultSelector: (...values: A) => R, scheduler: SchedulerLike): Observable<R>;
|
|
15
|
+
export declare function combineLatest<A extends readonly unknown[], R>(sources: readonly [...ObservableInputTuple<A>], resultSelector: (...values: A) => R): Observable<R>;
|
|
16
|
+
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `combineLatestAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
17
|
+
export declare function combineLatest<A extends readonly unknown[]>(sources: readonly [...ObservableInputTuple<A>], scheduler: SchedulerLike): Observable<A>;
|
|
18
|
+
/** @deprecated Pass an array of sources instead. The rest-parameters signature will be removed in v8. Details: https://rxjs.dev/deprecations/array-argument */
|
|
19
|
+
export declare function combineLatest<A extends readonly unknown[]>(...sources: [...ObservableInputTuple<A>]): Observable<A>;
|
|
20
|
+
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `combineLatestAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
21
|
+
export declare function combineLatest<A extends readonly unknown[], R>(...sourcesAndResultSelectorAndScheduler: [...ObservableInputTuple<A>, (...values: A) => R, SchedulerLike]): Observable<R>;
|
|
22
|
+
/** @deprecated Pass an array of sources instead. The rest-parameters signature will be removed in v8. Details: https://rxjs.dev/deprecations/array-argument */
|
|
23
|
+
export declare function combineLatest<A extends readonly unknown[], R>(...sourcesAndResultSelector: [...ObservableInputTuple<A>, (...values: A) => R]): Observable<R>;
|
|
24
|
+
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `combineLatestAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
|
25
|
+
export declare function combineLatest<A extends readonly unknown[]>(...sourcesAndScheduler: [...ObservableInputTuple<A>, SchedulerLike]): Observable<A>;
|
|
26
|
+
export declare function combineLatest(sourcesObject: {
|
|
27
|
+
[K in any]: never;
|
|
28
|
+
}): Observable<never>;
|
|
29
|
+
export declare function combineLatest<T extends Record<string, ObservableInput<any>>>(sourcesObject: T): Observable<{
|
|
30
|
+
[K in keyof T]: ObservedValueOf<T[K]>;
|
|
31
|
+
}>;
|
|
32
|
+
export declare function combineLatestInit(observables: ObservableInput<any>[], scheduler?: SchedulerLike, valueTransform?: (values: any[]) => any): (subscriber: Subscriber<any>) => void;
|
|
33
|
+
//# sourceMappingURL=combineLatest.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { ObservableInputTuple, SchedulerLike } from '../types';
|
|
3
|
+
export declare function concat<T extends readonly unknown[]>(...inputs: [...ObservableInputTuple<T>]): Observable<T[number]>;
|
|
4
|
+
export declare function concat<T extends readonly unknown[]>(...inputsAndScheduler: [...ObservableInputTuple<T>, SchedulerLike]): Observable<T[number]>;
|
|
5
|
+
//# sourceMappingURL=concat.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Connectable, ObservableInput, SubjectLike } from '../types';
|
|
2
|
+
export interface ConnectableConfig<T> {
|
|
3
|
+
/**
|
|
4
|
+
* A factory function used to create the Subject through which the source
|
|
5
|
+
* is multicast. By default this creates a {@link Subject}.
|
|
6
|
+
*/
|
|
7
|
+
connector: () => SubjectLike<T>;
|
|
8
|
+
/**
|
|
9
|
+
* If true, the resulting observable will reset internal state upon disconnection
|
|
10
|
+
* and return to a "cold" state. This allows the resulting observable to be
|
|
11
|
+
* reconnected.
|
|
12
|
+
* If false, upon disconnection, the connecting subject will remain the
|
|
13
|
+
* connecting subject, meaning the resulting observable will not go "cold" again,
|
|
14
|
+
* and subsequent repeats or resubscriptions will resubscribe to that same subject.
|
|
15
|
+
*/
|
|
16
|
+
resetOnDisconnect?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates an observable that multicasts once `connect()` is called on it.
|
|
20
|
+
*
|
|
21
|
+
* @param source The observable source to make connectable.
|
|
22
|
+
* @param config The configuration object for `connectable`.
|
|
23
|
+
* @returns A "connectable" observable, that has a `connect()` method, that you must call to
|
|
24
|
+
* connect the source to all consumers through the subject provided as the connector.
|
|
25
|
+
*/
|
|
26
|
+
export declare function connectable<T>(source: ObservableInput<T>, config?: ConnectableConfig<T>): Connectable<T>;
|
|
27
|
+
//# sourceMappingURL=connectable.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Observable } from '../Observable';
|
|
2
|
+
import { ObservedValueOf, ObservableInput } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an Observable that, on subscribe, calls an Observable factory to
|
|
5
|
+
* make an Observable for each new Observer.
|
|
6
|
+
*
|
|
7
|
+
* <span class="informal">Creates the Observable lazily, that is, only when it
|
|
8
|
+
* is subscribed.
|
|
9
|
+
* </span>
|
|
10
|
+
*
|
|
11
|
+
* 
|
|
12
|
+
*
|
|
13
|
+
* `defer` allows you to create an Observable only when the Observer
|
|
14
|
+
* subscribes. It waits until an Observer subscribes to it, calls the given
|
|
15
|
+
* factory function to get an Observable -- where a factory function typically
|
|
16
|
+
* generates a new Observable -- and subscribes the Observer to this Observable.
|
|
17
|
+
* In case the factory function returns a falsy value, then EMPTY is used as
|
|
18
|
+
* Observable instead. Last but not least, an exception during the factory
|
|
19
|
+
* function call is transferred to the Observer by calling `error`.
|
|
20
|
+
*
|
|
21
|
+
* ## Example
|
|
22
|
+
*
|
|
23
|
+
* Subscribe to either an Observable of clicks or an Observable of interval, at random
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { defer, fromEvent, interval } from 'rxjs';
|
|
27
|
+
*
|
|
28
|
+
* const clicksOrInterval = defer(() => {
|
|
29
|
+
* return Math.random() > 0.5
|
|
30
|
+
* ? fromEvent(document, 'click')
|
|
31
|
+
* : interval(1000);
|
|
32
|
+
* });
|
|
33
|
+
* clicksOrInterval.subscribe(x => console.log(x));
|
|
34
|
+
*
|
|
35
|
+
* // Results in the following behavior:
|
|
36
|
+
* // If the result of Math.random() is greater than 0.5 it will listen
|
|
37
|
+
* // for clicks anywhere on the "document"; when document is clicked it
|
|
38
|
+
* // will log a MouseEvent object to the console. If the result is less
|
|
39
|
+
* // than 0.5 it will emit ascending numbers, one every second(1000ms).
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see {@link Observable}
|
|
43
|
+
*
|
|
44
|
+
* @param {function(): ObservableInput} observableFactory The Observable
|
|
45
|
+
* factory function to invoke for each Observer that subscribes to the output
|
|
46
|
+
* Observable. May also return a Promise, which will be converted on the fly
|
|
47
|
+
* to an Observable.
|
|
48
|
+
* @return {Observable} An Observable whose Observers' subscriptions trigger
|
|
49
|
+
* an invocation of the given Observable factory function.
|
|
50
|
+
*/
|
|
51
|
+
export declare function defer<R extends ObservableInput<any>>(observableFactory: () => R): Observable<ObservedValueOf<R>>;
|
|
52
|
+
//# sourceMappingURL=defer.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Observable } from '../../Observable';
|
|
2
|
+
import { TimestampProvider } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* An observable of animation frames
|
|
5
|
+
*
|
|
6
|
+
* Emits the amount of time elapsed since subscription and the timestamp on each animation frame.
|
|
7
|
+
* Defaults to milliseconds provided to the requestAnimationFrame's callback. Does not end on its own.
|
|
8
|
+
*
|
|
9
|
+
* Every subscription will start a separate animation loop. Since animation frames are always scheduled
|
|
10
|
+
* by the browser to occur directly before a repaint, scheduling more than one animation frame synchronously
|
|
11
|
+
* should not be much different or have more overhead than looping over an array of events during
|
|
12
|
+
* a single animation frame. However, if for some reason the developer would like to ensure the
|
|
13
|
+
* execution of animation-related handlers are all executed during the same task by the engine,
|
|
14
|
+
* the `share` operator can be used.
|
|
15
|
+
*
|
|
16
|
+
* This is useful for setting up animations with RxJS.
|
|
17
|
+
*
|
|
18
|
+
* ## Examples
|
|
19
|
+
*
|
|
20
|
+
* Tweening a div to move it on the screen
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { animationFrames, map, takeWhile, endWith } from 'rxjs';
|
|
24
|
+
*
|
|
25
|
+
* function tween(start: number, end: number, duration: number) {
|
|
26
|
+
* const diff = end - start;
|
|
27
|
+
* return animationFrames().pipe(
|
|
28
|
+
* // Figure out what percentage of time has passed
|
|
29
|
+
* map(({ elapsed }) => elapsed / duration),
|
|
30
|
+
* // Take the vector while less than 100%
|
|
31
|
+
* takeWhile(v => v < 1),
|
|
32
|
+
* // Finish with 100%
|
|
33
|
+
* endWith(1),
|
|
34
|
+
* // Calculate the distance traveled between start and end
|
|
35
|
+
* map(v => v * diff + start)
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* // Setup a div for us to move around
|
|
40
|
+
* const div = document.createElement('div');
|
|
41
|
+
* document.body.appendChild(div);
|
|
42
|
+
* div.style.position = 'absolute';
|
|
43
|
+
* div.style.width = '40px';
|
|
44
|
+
* div.style.height = '40px';
|
|
45
|
+
* div.style.backgroundColor = 'lime';
|
|
46
|
+
* div.style.transform = 'translate3d(10px, 0, 0)';
|
|
47
|
+
*
|
|
48
|
+
* tween(10, 200, 4000).subscribe(x => {
|
|
49
|
+
* div.style.transform = `translate3d(${ x }px, 0, 0)`;
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* Providing a custom timestamp provider
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { animationFrames, TimestampProvider } from 'rxjs';
|
|
57
|
+
*
|
|
58
|
+
* // A custom timestamp provider
|
|
59
|
+
* let now = 0;
|
|
60
|
+
* const customTSProvider: TimestampProvider = {
|
|
61
|
+
* now() { return now++; }
|
|
62
|
+
* };
|
|
63
|
+
*
|
|
64
|
+
* const source$ = animationFrames(customTSProvider);
|
|
65
|
+
*
|
|
66
|
+
* // Log increasing numbers 0...1...2... on every animation frame.
|
|
67
|
+
* source$.subscribe(({ elapsed }) => console.log(elapsed));
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @param timestampProvider An object with a `now` method that provides a numeric timestamp
|
|
71
|
+
*/
|
|
72
|
+
export declare function animationFrames(timestampProvider?: TimestampProvider): Observable<{
|
|
73
|
+
timestamp: number;
|
|
74
|
+
elapsed: number;
|
|
75
|
+
}>;
|
|
76
|
+
//# sourceMappingURL=animationFrames.d.ts.map
|