( window as any ) . trustCertificate = ( fingerprint ) => { console . log ( `Requested to trust certificate with fingerprint ${ fingerprint }` ) ; } ; ( window as any ) . openImage = ( basename ) => { window . open ( `./images/${ basename })` ) ; } ; ( window as any ) . onUpdateDownloaded = ( callback ) => { console . info ( `Requested registration of callbak for update download` ) ; } ; ( window as any ) . runDigitalOceanOauth = ( ) => { let isCancelled = false ; const rejectWrapper = { reject : ( error ) => { } } ; const result = new Promise ( ( resolve , reject ) => { rejectWrapper . reject = reject ; window . open ( 'https://cloud.digitalocean.com/account/api/tokens/new' , 'noopener,noreferrer' ) ; const apiToken = window . prompt ( 'Please enter your DigitalOcean API token' ) ; if ( apiToken ) { resolve ( apiToken ) ; } else { reject ( new Error ( 'No api token entered' ) ) ; } } ) ; return { result , isCancelled ( ) { return isCancelled ; } , cancel ( ) { console . log ( 'Session cancelled' ) ; isCancelled = true ; rejectWrapper . reject ( new Error ( 'Authentication cancelled' ) ) ; } } ; } ; ( window as any ) . bringToFront = ( ) => { console . info ( `Requested bringToFront` ) ; } ; import './main' ;