export class Range { readonly end : number ; constructor ( readonly start , readonly length ) { this . end = start + length ; } public isInRange ( index ) { return this . start <= index && index < this . end ; } public static createFromIndices ( start , end ) { return new Range ( start , end - start ) ; } }