Lightcord/src/autoStart/index.ts

24 lines
585 B
TypeScript
Raw Permalink Normal View History

2020-06-13 13:49:36 +02:00
import autoLaunch from "auto-launch"
const autoStart = new autoLaunch({
name: "Lightcord"
})
export default {
2020-08-11 23:42:11 +02:00
install(callback:(err?:Error|void) => void){
2020-06-13 13:49:36 +02:00
autoStart.enable()
.then(callback, callback)
},
2020-08-11 23:42:11 +02:00
isInstalled(callback:(isInstalled:boolean)=>void){
2020-06-13 13:49:36 +02:00
autoStart.isEnabled()
.then(callback)
},
2020-08-11 23:42:11 +02:00
uninstall(callback:(err?:Error|void) => void){
2020-06-13 13:49:36 +02:00
autoStart.disable()
.then(callback, callback)
},
2020-08-11 23:42:11 +02:00
update(callback:(err?:Error|void) => void){
2020-06-13 13:49:36 +02:00
autoStart.enable()
.then(callback, callback)
}
2020-08-11 23:42:11 +02:00
}