diff --git a/api_guard/dist/types/operators/index.d.ts b/api_guard/dist/types/operators/index.d.ts index 96fb7cc2f8..dfdd8396da 100644 --- a/api_guard/dist/types/operators/index.d.ts +++ b/api_guard/dist/types/operators/index.d.ts @@ -88,8 +88,7 @@ export declare function distinctUntilChanged(comparator: (previous: K, cur export declare function distinctUntilKeyChanged(key: keyof T): MonoTypeOperatorFunction; export declare function distinctUntilKeyChanged(key: K, compare: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction; -export declare function elementAt(index: number): MonoTypeOperatorFunction; -export declare function elementAt(index: number, defaultValue: D): OperatorFunction; +export declare function elementAt(index: number, defaultValue?: D): OperatorFunction; export declare function endWith(scheduler: SchedulerLike): MonoTypeOperatorFunction; export declare function endWith(v1: A, scheduler: SchedulerLike): OperatorFunction; diff --git a/src/internal/operators/elementAt.ts b/src/internal/operators/elementAt.ts index 5b373f910e..464149ad6a 100644 --- a/src/internal/operators/elementAt.ts +++ b/src/internal/operators/elementAt.ts @@ -1,14 +1,11 @@ import { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError'; import { Observable } from '../Observable'; -import { MonoTypeOperatorFunction, OperatorFunction } from '../types'; +import { OperatorFunction } from '../types'; import { filter } from './filter'; import { throwIfEmpty } from './throwIfEmpty'; import { defaultIfEmpty } from './defaultIfEmpty'; import { take } from './take'; -export function elementAt(index: number): MonoTypeOperatorFunction; -export function elementAt(index: number, defaultValue: D): OperatorFunction; - /** * Emits the single value at the specified `index` in a sequence of emissions * from the source Observable. @@ -55,7 +52,7 @@ export function elementAt(index: number, defaultValue: D): OperatorFunctio * @return {Observable} An Observable that emits a single item, if it is found. * Otherwise, will emit the default value if given. If not, then emits an error. */ -export function elementAt(index: number, defaultValue?: D): OperatorFunction { +export function elementAt(index: number, defaultValue?: D): OperatorFunction { if (index < 0) { throw new ArgumentOutOfRangeError(); }