UNPKG

862 BTypeScriptView Raw
1import { AsyncIterableX } from './asynciterablex';
2export declare class RepeatValueAsyncIterable<TSource> extends AsyncIterableX<TSource> {
3 private _value;
4 private _count;
5 constructor(value: TSource, count: number);
6 [Symbol.asyncIterator](signal?: AbortSignal): AsyncGenerator<TSource, void, unknown>;
7}
8/**
9 * Repeats a given value for the specified number of times as an async-iterable.
10 *
11 * @export
12 * @template TSource The type of element to repeat.
13 * @param {TSource} value The value to repeat as an async-iterable.
14 * @param {number} [count=-1] The number of times to repeat the value, infinite if not specified.
15 * @returns {AsyncIterableX<TSource>} An async-iterable with a single item that is repeated over the specified times.
16 */
17export declare function repeatValue<TSource>(value: TSource, count?: number): AsyncIterableX<TSource>;