diff --git a/src/operators/defaultIfEmpty.ts b/src/operators/defaultIfEmpty.ts index 4d78419359..0088ec4bae 100644 --- a/src/operators/defaultIfEmpty.ts +++ b/src/operators/defaultIfEmpty.ts @@ -1,10 +1,10 @@ import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; -import { OperatorFunction } from '../interfaces'; +import { OperatorFunction, MonoTypeOperatorFunction } from '../interfaces'; /* tslint:disable:max-line-length */ -export function defaultIfEmpty(defaultValue?: T): OperatorFunction; +export function defaultIfEmpty(defaultValue?: T): MonoTypeOperatorFunction; export function defaultIfEmpty(defaultValue?: R): OperatorFunction; /* tslint:enable:max-line-length */ diff --git a/src/operators/filter.ts b/src/operators/filter.ts index 117fcaf543..541d6622fd 100644 --- a/src/operators/filter.ts +++ b/src/operators/filter.ts @@ -2,13 +2,13 @@ import { Operator } from '../Operator'; import { Subscriber } from '../Subscriber'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; -import { OperatorFunction } from '../interfaces'; +import { OperatorFunction, MonoTypeOperatorFunction } from '../interfaces'; /* tslint:disable:max-line-length */ export function filter(predicate: (value: T, index: number) => value is S, thisArg?: any): OperatorFunction; export function filter(predicate: (value: T, index: number) => boolean, - thisArg?: any): OperatorFunction; + thisArg?: any): MonoTypeOperatorFunction; /* tslint:enable:max-line-length */ /** @@ -51,7 +51,7 @@ export function filter(predicate: (value: T, index: number) => boolean, * @owner Observable */ export function filter(predicate: (value: T, index: number) => boolean, - thisArg?: any): OperatorFunction { + thisArg?: any): MonoTypeOperatorFunction { return function filterOperatorFunction(source: Observable): Observable { return source.lift(new FilterOperator(predicate, thisArg)); }; diff --git a/src/operators/max.ts b/src/operators/max.ts index c3693fc577..0b8b9bafcd 100644 --- a/src/operators/max.ts +++ b/src/operators/max.ts @@ -1,5 +1,5 @@ import { reduce } from './reduce'; -import { OperatorFunction } from '../interfaces'; +import { MonoTypeOperatorFunction } from '../interfaces'; /** * The Max operator operates on an Observable that emits numbers (or items that can be compared with a provided function), @@ -32,7 +32,7 @@ import { OperatorFunction } from '../interfaces'; * @method max * @owner Observable */ -export function max(comparer?: (x: T, y: T) => number): OperatorFunction { +export function max(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction { const max: (x: T, y: T) => T = (typeof comparer === 'function') ? (x, y) => comparer(x, y) > 0 ? x : y : (x, y) => x > y ? x : y; diff --git a/src/operators/min.ts b/src/operators/min.ts index 75e9f58ac6..99cdf8c1b4 100644 --- a/src/operators/min.ts +++ b/src/operators/min.ts @@ -1,5 +1,5 @@ import { reduce } from './reduce'; -import { OperatorFunction } from '../interfaces'; +import { MonoTypeOperatorFunction } from '../interfaces'; /** * The Min operator operates on an Observable that emits numbers (or items that can be compared with a provided function), @@ -32,7 +32,7 @@ import { OperatorFunction } from '../interfaces'; * @method min * @owner Observable */ -export function min(comparer?: (x: T, y: T) => number): OperatorFunction { +export function min(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction { const min: (x: T, y: T) => T = (typeof comparer === 'function') ? (x, y) => comparer(x, y) < 0 ? x : y : (x, y) => x < y ? x : y; diff --git a/src/operators/reduce.ts b/src/operators/reduce.ts index bb05114d6f..04f043274e 100644 --- a/src/operators/reduce.ts +++ b/src/operators/reduce.ts @@ -2,11 +2,11 @@ import { Observable } from '../Observable'; import { scan } from './scan'; import { takeLast } from './takeLast'; import { defaultIfEmpty } from './defaultIfEmpty'; -import { OperatorFunction } from '../interfaces'; +import { OperatorFunction, MonoTypeOperatorFunction } from '../interfaces'; import { compose } from '../util/compose'; /* tslint:disable:max-line-length */ -export function reduce(accumulator: (acc: T, value: T, index: number) => T, seed?: T): OperatorFunction; +export function reduce(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction; export function reduce(accumulator: (acc: T[], value: T, index: number) => T[], seed: T[]): OperatorFunction; export function reduce(accumulator: (acc: R, value: T, index: number) => R, seed?: R): OperatorFunction; /* tslint:enable:max-line-length */ diff --git a/src/operators/scan.ts b/src/operators/scan.ts index 4dc6046a45..0e97976d37 100644 --- a/src/operators/scan.ts +++ b/src/operators/scan.ts @@ -1,10 +1,10 @@ import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; -import { OperatorFunction } from '../interfaces'; +import { OperatorFunction, MonoTypeOperatorFunction } from '../interfaces'; /* tslint:disable:max-line-length */ -export function scan(accumulator: (acc: T, value: T, index: number) => T, seed?: T): OperatorFunction; +export function scan(accumulator: (acc: T, value: T, index: number) => T, seed?: T): MonoTypeOperatorFunction; export function scan(accumulator: (acc: T[], value: T, index: number) => T[], seed?: T[]): OperatorFunction; export function scan(accumulator: (acc: R, value: T, index: number) => R, seed?: R): OperatorFunction; /* tslint:enable:max-line-length */ diff --git a/src/operators/takeLast.ts b/src/operators/takeLast.ts index e6e44d9cef..3e408b4da7 100644 --- a/src/operators/takeLast.ts +++ b/src/operators/takeLast.ts @@ -4,7 +4,7 @@ import { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError'; import { EmptyObservable } from '../observable/EmptyObservable'; import { Observable } from '../Observable'; import { TeardownLogic } from '../Subscription'; -import { OperatorFunction } from '../interfaces'; +import { MonoTypeOperatorFunction } from '../interfaces'; /** * Emits only the last `count` values emitted by the source Observable. @@ -42,7 +42,7 @@ import { OperatorFunction } from '../interfaces'; * @method takeLast * @owner Observable */ -export function takeLast(count: number): OperatorFunction { +export function takeLast(count: number): MonoTypeOperatorFunction { return function takeLastOperatorFunction(source: Observable): Observable { if (count === 0) { return new EmptyObservable();