import { PartialObserver } from './Observer'; import { Operator } from './Operator'; import { Scheduler } from './Scheduler'; import { Subscriber } from './Subscriber'; import { Subscription } from './Subscription'; import { CoreOperators } from './CoreOperators'; import { GroupedObservable } from './operator/groupBy'; import { ConnectableObservable } from './observable/ConnectableObservable'; import { Subject } from './Subject'; import { Notification } from './Notification'; import { combineLatestStatic } from './operator/combineLatest'; import { concatStatic } from './operator/concat'; import { mergeStatic } from './operator/merge'; import { zipStatic } from './operator/zip'; import { BoundCallbackObservable } from './observable/BoundCallbackObservable'; import { BoundNodeCallbackObservable } from './observable/BoundNodeCallbackObservable'; import { DeferObservable } from './observable/DeferObservable'; import { EmptyObservable } from './observable/EmptyObservable'; import { ForkJoinObservable } from './observable/ForkJoinObservable'; import { FromObservable } from './observable/FromObservable'; import { ArrayObservable } from './observable/ArrayObservable'; import { FromEventObservable } from './observable/FromEventObservable'; import { FromEventPatternObservable } from './observable/FromEventPatternObservable'; import { PromiseObservable } from './observable/PromiseObservable'; import { IntervalObservable } from './observable/IntervalObservable'; import { TimerObservable } from './observable/TimerObservable'; import { raceStatic } from './operator/race'; import { RangeObservable } from './observable/RangeObservable'; import { NeverObservable } from './observable/NeverObservable'; import { ErrorObservable } from './observable/ErrorObservable'; import { AjaxCreationMethod } from './observable/dom/AjaxObservable'; import { WebSocketSubject } from './observable/dom/WebSocketSubject'; import { CombineLatestSignature } from './operator/combineLatest'; import { WithLatestFromSignature } from './operator/withLatestFrom'; import { ZipSignature } from './operator/zip'; import { BufferSignature } from './operator/buffer'; import { BufferCountSignature } from './operator/bufferCount'; import { BufferTimeSignature } from './operator/bufferTime'; import { BufferToggleSignature } from './operator/bufferToggle'; import { BufferWhenSignature } from './operator/bufferWhen'; import { WindowSignature } from './operator/window'; import { WindowCountSignature } from './operator/windowCount'; import { WindowTimeSignature } from './operator/windowTime'; import { WindowToggleSignature } from './operator/windowToggle'; import { WindowWhenSignature } from './operator/windowWhen'; export declare type ObservableOrPromise = Observable | Promise; export declare type ArrayOrIterator = Iterator | ArrayLike; export declare type ObservableInput = ObservableOrPromise | ArrayOrIterator; /** * A representation of any set of values over any amount of time. This the most basic building block * of RxJS. * * @class Observable */ export declare class Observable implements CoreOperators { _isScalar: boolean; protected source: Observable; protected operator: Operator; /** * @constructor * @param {Function} subscribe the function that is * called when the Observable is initially subscribed to. This function is given a Subscriber, to which new values * can be `next`ed, or an `error` method can be called to raise an error, or `complete` can be called to notify * of a successful completion. */ constructor(subscribe?: (subscriber: Subscriber) => Subscription | Function | void); /** * @static * @method create * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor * @returns {Observable} a new cold observable * @description creates a new cold Observable by calling the Observable constructor */ static create: Function; /** * @method lift * @param {Operator} operator the operator defining the operation to take on the observable * @returns {Observable} a new observable with the Operator applied * @description creates a new Observable, with this Observable as the source, and the passed * operator defined as the new observable's operator. */ lift(operator: Operator): Observable; /** * @method subscribe * @param {PartialObserver|Function} observerOrNext (optional) either an observer defining all functions to be called, * or the first of three possible handlers, which is the handler for each value emitted from the observable. * @param {Function} error (optional) a handler for a terminal event resulting from an error. If no error handler is provided, * the error will be thrown as unhandled * @param {Function} complete (optional) a handler for a terminal event resulting from successful completion. * @returns {Subscription} a subscription reference to the registered handlers * @description registers handlers for handling emitted values, error and completions from the observable, and * executes the observable's subscriber function, which will take action to set up the underlying data stream */ subscribe(observerOrNext?: PartialObserver | ((value: T) => void), error?: (error: any) => void, complete?: () => void): Subscription; /** * @method forEach * @param {Function} next a handler for each value emitted by the observable * @param {any} [thisArg] a `this` context for the `next` handler function * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise * @returns {Promise} a promise that either resolves on observable completion or * rejects with the handled error */ forEach(next: (value: T) => void, thisArg: any, PromiseCtor?: typeof Promise): Promise; protected _subscribe(subscriber: Subscriber): Subscription | Function | void; static ajax: AjaxCreationMethod; static bindCallback: typeof BoundCallbackObservable.create; static bindNodeCallback: typeof BoundNodeCallbackObservable.create; static combineLatest: typeof combineLatestStatic; static concat: typeof concatStatic; static defer: typeof DeferObservable.create; static empty: typeof EmptyObservable.create; static forkJoin: typeof ForkJoinObservable.create; static from: typeof FromObservable.create; static fromArray: typeof ArrayObservable.create; static fromEvent: typeof FromEventObservable.create; static fromEventPattern: typeof FromEventPatternObservable.create; static fromPromise: typeof PromiseObservable.create; static interval: typeof IntervalObservable.create; static merge: typeof mergeStatic; static never: typeof NeverObservable.create; static of: typeof ArrayObservable.of; static race: typeof raceStatic; static range: typeof RangeObservable.create; static throw: typeof ErrorObservable.create; static timer: typeof TimerObservable.create; static webSocket: typeof WebSocketSubject.create; static zip: typeof zipStatic; buffer: BufferSignature; bufferCount: BufferCountSignature; bufferTime: BufferTimeSignature; bufferToggle: BufferToggleSignature; bufferWhen: BufferWhenSignature; cache: (bufferSize?: number, windowTime?: number, scheduler?: Scheduler) => Observable; catch: (selector: (err: any, source: Observable, caught: Observable) => Observable) => Observable; combineAll: (project?: (...values: Array) => R) => Observable; combineLatest: CombineLatestSignature; concat: (...observables: (Observable | Scheduler)[]) => Observable; concatAll: () => Observable; concatMap: (project: ((x: T, ix: number) => Observable), projectResult?: (x: T, y: any, ix: number, iy: number) => R) => Observable; concatMapTo: (observable: Observable, projectResult?: (x: T, y: any, ix: number, iy: number) => R) => Observable; count: (predicate?: (value: T, index: number, source: Observable) => boolean) => Observable; dematerialize: () => Observable; debounce: (durationSelector: (value: T) => Observable | Promise) => Observable; debounceTime: (dueTime: number, scheduler?: Scheduler) => Observable; defaultIfEmpty: (defaultValue?: T | R) => Observable | Observable; delay: (delay: number, scheduler?: Scheduler) => Observable; delayWhen: (delayDurationSelector: (value: T) => Observable, subscriptionDelay?: Observable) => Observable; distinctUntilChanged: (compare?: (x: T, y: T) => boolean) => Observable; do: (next?: (x: T) => void, error?: (e: any) => void, complete?: () => void) => Observable; expand: (project: (x: T, ix: number) => Observable, concurrent: number, scheduler: Scheduler) => Observable; filter: (predicate: (x: T) => boolean, ix?: number, thisArg?: any) => Observable; finally: (finallySelector: () => void) => Observable; first: (predicate?: (value: T, index: number, source: Observable) => boolean, resultSelector?: (value: T, index: number) => R, defaultValue?: any) => Observable | Observable; flatMap: (project: ((x: T, ix: number) => Observable), projectResult?: (x: T, y: any, ix: number, iy: number) => R, concurrent?: number) => Observable; flatMapTo: (observable: Observable, projectResult?: (x: T, y: any, ix: number, iy: number) => R, concurrent?: number) => Observable; groupBy: (keySelector: (value: T) => K, elementSelector?: (value: T) => R, durationSelector?: (group: GroupedObservable) => Observable) => Observable>; ignoreElements: () => Observable; inspect: (durationSelector: (value: T) => Observable | Promise) => Observable; inspectTime: (delay: number, scheduler?: Scheduler) => Observable; last: (predicate?: (value: T, index: number) => boolean, resultSelector?: (value: T, index: number) => R, defaultValue?: any) => Observable | Observable; let: (func: (selector: Observable) => Observable) => Observable; letBind: (func: (selector: Observable) => Observable) => Observable; every: (predicate: (value: T, index: number) => boolean, thisArg?: any) => Observable; map: (project: (x: T, ix?: number) => R, thisArg?: any) => Observable; mapTo: (value: R) => Observable; materialize: () => Observable>; merge: (...observables: any[]) => Observable; mergeAll: (concurrent?: any) => Observable; mergeMap: (project: ((x: T, ix: number) => Observable), projectResult?: (x: T, y: any, ix: number, iy: number) => R, concurrent?: number) => Observable; mergeMapTo: (observable: Observable, projectResult?: (x: T, y: any, ix: number, iy: number) => R, concurrent?: number) => Observable; multicast: (subjectOrSubjectFactory: Subject | (() => Subject)) => ConnectableObservable; observeOn: (scheduler: Scheduler, delay?: number) => Observable; partition: (predicate: (x: T) => boolean) => Observable[]; pluck: (...properties: string[]) => Observable; publish: () => ConnectableObservable; publishBehavior: (value: any) => ConnectableObservable; publishReplay: (bufferSize?: number, windowTime?: number, scheduler?: Scheduler) => ConnectableObservable; publishLast: () => ConnectableObservable; race: (...observables: Array>) => Observable; reduce: (project: (acc: R, x: T) => R, seed?: R) => Observable; repeat: (count?: number) => Observable; retry: (count?: number) => Observable; retryWhen: (notifier: (errors: Observable) => Observable) => Observable; sample: (notifier: Observable) => Observable; sampleTime: (delay: number, scheduler?: Scheduler) => Observable; scan: (accumulator: (acc: R, x: T) => R, seed?: T | R) => Observable; share: () => Observable; single: (predicate?: (value: T, index: number) => boolean) => Observable; skip: (count: number) => Observable; skipUntil: (notifier: Observable) => Observable; skipWhile: (predicate: (x: T, index: number) => boolean) => Observable; startWith: (x: T) => Observable; subscribeOn: (scheduler: Scheduler, delay?: number) => Observable; switch: () => Observable; switchMap: (project: ((x: T, ix: number) => Observable), projectResult?: (x: T, y: any, ix: number, iy: number) => R) => Observable; switchMapTo: (observable: Observable, projectResult?: (x: T, y: any, ix: number, iy: number) => R) => Observable; take: (count: number) => Observable; takeLast: (count: number) => Observable; takeUntil: (notifier: Observable) => Observable; takeWhile: (predicate: (value: T, index: number) => boolean) => Observable; throttle: (durationSelector: (value: T) => Observable | Promise) => Observable; throttleTime: (delay: number, scheduler?: Scheduler) => Observable; timeout: (due: number | Date, errorToSend?: any, scheduler?: Scheduler) => Observable; timeoutWith: (due: number | Date, withObservable: Observable, scheduler?: Scheduler) => Observable | Observable; toArray: () => Observable; toPromise: (PromiseCtor?: typeof Promise) => Promise; window: WindowSignature; windowCount: WindowCountSignature; windowTime: WindowTimeSignature; windowToggle: WindowToggleSignature; windowWhen: WindowWhenSignature; withLatestFrom: WithLatestFromSignature; zip: ZipSignature; zipAll: (project?: (...values: Array) => R) => Observable; }