diff --git a/spec/ajax/index-spec.ts b/spec/ajax/index-spec.ts index ee99d273b7..7827a82fa7 100644 --- a/spec/ajax/index-spec.ts +++ b/spec/ajax/index-spec.ts @@ -5,4 +5,12 @@ describe('index', () => { it('should export static ajax observable creator functions', () => { expect(index.ajax).to.exist; }); + + it('should export Ajax data classes', () => { + expect(index.AjaxResponse).to.exist; + expect(index.AjaxError).to.exist; + expect(index.AjaxTimeoutError).to.exist; + // Interfaces can be checked by creating a variable of that type + let ajaxRequest: index.AjaxRequest; + }); }); diff --git a/spec/index-spec.ts b/spec/index-spec.ts index da21298443..6644d22b23 100644 --- a/spec/index-spec.ts +++ b/spec/index-spec.ts @@ -4,12 +4,16 @@ import { expect } from 'chai'; describe('index', () => { it('should export Observable', () => { expect(index.Observable).to.exist; + expect(index.ConnectableObservable).to.exist; + // Interfaces can be checked by creating a variable of that type + let operator: index.Operator; }); it('should export the Subject types', () => { expect(index.Subject).to.exist; expect(index.BehaviorSubject).to.exist; expect(index.ReplaySubject).to.exist; + expect(index.AsyncSubject).to.exist; }); it('should export the schedulers', () => { @@ -17,10 +21,13 @@ describe('index', () => { expect(index.asyncScheduler).to.exist; expect(index.queueScheduler).to.exist; expect(index.animationFrameScheduler).to.exist; + expect(index.VirtualTimeScheduler).to.exist; + expect(index.VirtualAction).to.exist; }); it('should export Subscription', () => { expect(index.Subscription).to.exist; + expect(index.Subscriber).to.exist; }); it('should export Notification', () => { @@ -38,6 +45,7 @@ describe('index', () => { expect(index.EmptyError).to.exist; expect(index.ObjectUnsubscribedError).to.exist; expect(index.UnsubscriptionError).to.exist; + expect(index.TimeoutError).to.exist; }); it('should export constants', () => { diff --git a/src/ajax/index.ts b/src/ajax/index.ts index 9b68b40fbf..73cb0cc8b0 100644 --- a/src/ajax/index.ts +++ b/src/ajax/index.ts @@ -1 +1,2 @@ export { ajax } from '../internal/observable/dom/ajax'; +export { AjaxRequest, AjaxResponse, AjaxError, AjaxTimeoutError } from '../internal/observable/dom/AjaxObservable'; diff --git a/src/index.ts b/src/index.ts index b8a8d1efdb..4c827c06b0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,24 @@ /* Observable */ export { Observable } from './internal/Observable'; +export { ConnectableObservable } from './internal/observable/ConnectableObservable'; +export { Operator } from './internal/Operator'; /* Subjects */ export { Subject } from './internal/Subject'; export { BehaviorSubject } from './internal/BehaviorSubject'; export { ReplaySubject } from './internal/ReplaySubject'; +export { AsyncSubject } from './internal/AsyncSubject'; /* Schedulers */ export { asap as asapScheduler } from './internal/scheduler/asap'; export { async as asyncScheduler } from './internal/scheduler/async'; export { queue as queueScheduler } from './internal/scheduler/queue'; export { animationFrame as animationFrameScheduler } from './internal/scheduler/animationFrame'; +export { VirtualTimeScheduler, VirtualAction } from './internal/scheduler/VirtualTimeScheduler'; /* Subscription */ export { Subscription } from './internal/Subscription'; +export { Subscriber } from './internal/Subscriber'; /* Notification */ export { Notification } from './internal/Notification'; @@ -28,6 +33,7 @@ export { ArgumentOutOfRangeError } from './internal/util/ArgumentOutOfRangeError export { EmptyError } from './internal/util/EmptyError'; export { ObjectUnsubscribedError } from './internal/util/ObjectUnsubscribedError'; export { UnsubscriptionError } from './internal/util/UnsubscriptionError'; +export { TimeoutError } from './internal/util/TimeoutError'; /* Static observable creation exports */ export { bindCallback } from './internal/observable/bindCallback'; diff --git a/src/internal/operators/timeInterval.ts b/src/internal/operators/timeInterval.ts index 891f2851a9..d770c55baf 100644 --- a/src/internal/operators/timeInterval.ts +++ b/src/internal/operators/timeInterval.ts @@ -3,13 +3,13 @@ import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { IScheduler } from '../Scheduler'; import { async } from '../scheduler/async'; -import { OperatorFunction } from '../types'; +import { OperatorFunction, TimeInterval as TimeIntervalInterface } from '../types'; export function timeInterval(scheduler: IScheduler = async): OperatorFunction> { return (source: Observable) => source.lift(new TimeIntervalOperator(scheduler)); } -export class TimeInterval { +export class TimeInterval implements TimeIntervalInterface { constructor(public value: T, public interval: number) { } diff --git a/src/internal/operators/timestamp.ts b/src/internal/operators/timestamp.ts index f8c83f729a..dddf653e18 100644 --- a/src/internal/operators/timestamp.ts +++ b/src/internal/operators/timestamp.ts @@ -1,7 +1,7 @@ import { IScheduler } from '../Scheduler'; import { async } from '../scheduler/async'; -import { OperatorFunction } from '../types'; +import { OperatorFunction, Timestamp as TimestampInterface } from '../types'; import { map } from './map'; /** @@ -15,7 +15,7 @@ export function timestamp(scheduler: IScheduler = async): OperatorFunction) => source.lift(new TimestampOperator(scheduler)); } -export class Timestamp { +export class Timestamp implements TimestampInterface { constructor(public value: T, public timestamp: number) { } } diff --git a/src/internal/types.ts b/src/internal/types.ts index d36f765d4f..ea9993e02a 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -10,6 +10,16 @@ export type FactoryOrValue = T | (() => T); export interface MonoTypeOperatorFunction extends OperatorFunction {} +export interface Timestamp { + value: T; + timestamp: number; +} + +export interface TimeInterval { + value: T; + interval: number; +} + /** SUBSCRIPTION INTERFACES */ export interface Unsubscribable {