import type { Fn2 } from "@thi.ng/api" ; import { isIterable } from "@thi.ng/checks/is-iterable" ; import type { Transducer } from "./api.js" ; import { comp } from "./comp.js" ; import { iterator } from "./iterator.js" ; import { map } from "./map.js" ; import { mapcat } from "./mapcat.js" ; import { normRange } from "./norm-range.js" ; import { partition } from "./partition.js" ; remarks If the optional `src` iterable is given, `interpolate` returns an
 * iterator of interpolated values. No values will be produced if the
 * number of inputs is less than given `window` size.
 *
 * Note: The *very last* input value can never be fully reached and
 * might need to be explicitly duplicated in the input, e.g. via the
 *  extendSides iterator...
 *
 * See also:
 * -  {@link (interpolateHermite:1)} * -  {@link (interpolateLinear:1)} * -  extendSides example param fn param window param n export function interpolate < T > ( fn , window , n ) ; export function interpolate < T > ( fn , window , n , src ) ; export function interpolate < T > ( fn , window , n , src ? ) { return isIterable ( src ) ? iterator ( interpolate ( fn , window , n ) , src ) : comp ( partition < T > ( window , 1 ) , mapcat ( ( chunk ) => map ( ( t ) => fn ( chunk , t ) , normRange ( n , false ) ) ) ) ; }