2017-04-05 03:23:46 +02:00
|
|
|
class SwPlatform {
|
2018-04-16 17:29:43 +02:00
|
|
|
/**
|
|
|
|
* Reloads the platform
|
|
|
|
*/
|
2017-04-05 03:23:46 +02:00
|
|
|
reload () {
|
2018-04-16 17:29:43 +02:00
|
|
|
// TODO: you can't actually do this
|
|
|
|
/** @type {any} */ (global).location.reload()
|
2017-04-05 03:23:46 +02:00
|
|
|
}
|
|
|
|
|
2018-04-16 17:29:43 +02:00
|
|
|
/**
|
|
|
|
* Opens a window
|
|
|
|
* @param {{url: string}} opts - The window options
|
|
|
|
*/
|
|
|
|
openWindow (opts) {
|
|
|
|
// TODO: this doesn't actually work
|
|
|
|
/** @type {any} */ (global).open(opts.url, '_blank')
|
2017-04-05 03:23:46 +02:00
|
|
|
}
|
|
|
|
|
2018-04-16 17:29:43 +02:00
|
|
|
/**
|
|
|
|
* Returns the platform version
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
2017-04-05 03:23:46 +02:00
|
|
|
getVersion () {
|
|
|
|
return '<unable to read version>'
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export default SwPlatform
|