/**
 * Simple array queue with easier operations.
 */ export class ArrayQueue < T > { private backing : T [ ] = [ ] ; public push ( value ) { this . backing . push ( value ) ; } public pop ( ) { return this . backing . pop ( ) ; } public peek ( ) { if ( this . backing . length > 0 ) { return this . backing [ 0 ] ; } return undefined ; } public delete ( value ) { const idx = this . backing . indexOf ( value ) ; this . backing . splice ( idx , 1 ) ; } public size ( ) { return this . backing . length ; } }