import { IIterator , iter , IterableOrArrayLike } from './iter' ; param object param start returns export function enumerate < T > ( object , start = 0 ) { return new EnumerateIterator < T > ( iter ( object ) , start ) ; } /**
 * An iterator which enumerates the source values.
 */ export class EnumerateIterator < T > implements IIterator < [ number , T ] > { param source param start constructor ( source , start ) { this . _source = source ; this . _index = start ; } returns iter ( ) { return this ; } returns clone ( ) { return new EnumerateIterator < T > ( this . _source . clone ( ) , this . _index ) ; } returns next ( ) { let value = this . _source . next ( ) ; if ( value === undefined ) { return undefined ; } return [ this . _index ++ , value ] ; } private _source : IIterator < T > ; private _index : number ; }