import { IterableX } from './iterablex' ; class WhileIterable < TSource > extends IterableX < TSource > { private _condition : ( ) => boolean ; private _source : Iterable < TSource > ; constructor ( condition , source ) { super ( ) ; this . _condition = condition ; this . _source = source ; } * [ Symbol . iterator ] ( ) { while ( this . _condition ( ) ) { yield * this . _source ; } } } template TSource param { Iterable < TSource > } source param { ( ( signal ? : AbortSignal ) => boolean ) } condition returns { IterableX < TSource > } export function whileDo < TSource > ( source , condition ) { return new WhileIterable < TSource > ( condition , source ) ; }