export function getRandom ( min , max ) { return Math . floor ( Math . random ( ) * ( max - min ) ) + min ; } export function shuffle ( array ) { for ( let i = array . length - 1 ; i > 0 ; i -- ) { let j = Math . floor ( Math . random ( ) * ( i + 1 ) ) ; let temp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = temp ; } } export function closeWindow ( ) { if ( typeof ( window as any ) . api !== "undefined" ) window . close ( ) ; } export function delay ( timeout ) { return new Promise < void > ( resolve => window . setTimeout ( resolve , timeout ) ) ; }