import { IterableX } from '../../iterable/iterablex.js'; import { ScanRightIterable } from '../../iterable/operators/scanright.js'; import { ScanOptions } from '../../iterable/operators/scanoptions.js'; /** * @ignore */ export function scanRightProto( this: IterableX, options: ScanOptions ): IterableX; export function scanRightProto( this: IterableX, accumulator: (accumulator: R, current: T, index: number) => R, seed?: R ): IterableX; export function scanRightProto( this: IterableX, optionsOrAccumulator: ScanOptions | ((accumulator: R, current: T, index: number) => R), seed?: R ): IterableX { return new ScanRightIterable( this, // eslint-disable-next-line no-nested-ternary typeof optionsOrAccumulator === 'function' ? arguments.length > 1 ? // prettier-ignore { 'callback': optionsOrAccumulator, 'seed': seed } : // prettier-ignore { 'callback': optionsOrAccumulator } : optionsOrAccumulator ); } IterableX.prototype.scanRight = scanRightProto; declare module '../../iterable/iterablex' { interface IterableX { scanRight: typeof scanRightProto; } }