@thi.ng/dsp
Version:
Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils
26 lines • 918 B
TypeScript
import type { IGen } from "./api.js";
/**
* Wraps given ES6 iterable to provide full {@link IGen} implementation.
*
* @remarks
* Calling `.next()` on this wrapped instance will always succeed, even if the
* original iterable already is exhausted (in which case the last valid value
* will be repeated ad infinitum).
*
* The `initial` value is required to satisfy `.deref()` and the case where the
* iterable doesn't provide a single value.
*
* @param src -
* @param initial -
*/
export declare const iterable: <T>(src: Iterable<T>, initial: T) => $Iterable<T>;
export declare class $Iterable<T> implements IGen<T> {
protected _iter: Iterator<T> | null;
protected _val: T;
constructor(src: Iterable<T>, initial: T);
deref(): T;
[Symbol.iterator](): Generator<T, void, unknown>;
next(): T;
take(num: number, out?: T[], idx?: number): T[];
}
//# sourceMappingURL=iterable.d.ts.map