123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- declare module Rx {
- export interface Subscription {
-
- equals(other: Subscription): boolean;
-
- toString(): string;
- }
- interface SubscriptionStatic {
-
- new (subscribeAt: number, unsubscribeAt?: number): Subscription;
- }
- export var Subscription: SubscriptionStatic;
- export interface Recorded {
-
- equals(other: Recorded): boolean;
-
- toString(): string;
- time: number;
- value: any;
- }
- interface RecordedStatic {
-
- new (time: number, value: any, equalityComparer?: _Comparer<any, boolean>): Recorded;
- }
- export var Recorded: RecordedStatic;
- export var ReactiveTest: {
-
- created: number;
-
- subscribed: number;
-
- disposed: number;
-
- onNext(ticks: number, value: any): Recorded;
-
- onNext(ticks: number, predicate: (value: any) => boolean): Recorded;
-
- onError(ticks: number, exception: any): Recorded;
-
- onError(ticks: number, predicate: (exception: any) => boolean): Recorded;
-
- onCompleted(ticks: number): Recorded;
-
- subscribe(subscribeAt: number, unsubscribeAt?: number): Subscription;
- }
- export interface MockObserver<T> extends Observer<T> {
- messages: Recorded[];
- }
- interface MockObserverStatic extends ObserverStatic {
- new <T>(scheduler: IScheduler): MockObserver<T>;
- }
- export var MockObserver: MockObserverStatic;
- export interface TestScheduler extends VirtualTimeScheduler<number, number> {
-
- createColdObservable<T>(...records: Recorded[]): Observable<T>;
-
- createHotObservable<T>(...records: Recorded[]): Observable<T>;
-
- createObserver<T>(): MockObserver<T>;
-
- createResolvedPromise<T>(ticks: number, value: T): IPromise<T>;
-
- createRejectedPromise<T>(ticks: number, value: T): IPromise<T>;
-
- startWithTiming<T>(create: () => Observable<T>, createdAt: number, subscribedAt: number, disposedAt: number): MockObserver<T>;
- /**
- * Starts the test scheduler and uses the specified virtual time to dispose the subscription to the sequence obtained through the factory function.
- * Default virtual times are used for factory invocation and sequence subscription.
- *
- * @param create Factory method to create an observable sequence.
- * @param disposed Virtual time at which to dispose the subscription.
- * @return Observer with timestamped recordings of notification messages that were received during the virtual time window when the subscription to the source sequence was active.
- */
- startWithDispose<T>(create: () => Observable<T>, disposedAt: number): MockObserver<T>;
- /**
- * Starts the test scheduler and uses default virtual times to invoke the factory function, to subscribe to the resulting sequence, and to dispose the subscription.
- *
- * @param create Factory method to create an observable sequence.
- * @return Observer with timestamped recordings of notification messages that were received during the virtual time window when the subscription to the source sequence was active.
- */
- startWithCreate<T>(create: () => Observable<T>): MockObserver<T>;
- }
- export var TestScheduler: {
- new (): TestScheduler;
- }
- }
- declare module "rx.testing" { export = Rx; }
|