- Notifications
You must be signed in to change notification settings - Fork 440
/
Copy pathdaemon.ts
41 lines (39 loc) · 1.33 KB
/
daemon.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import{nls}from'@theia/core';
import{inject,injectable}from'@theia/core/shared/inversify';
import{ArduinoDaemon}from'../../common/protocol';
import{Contribution,Command,CommandRegistry}from'./contribution';
@injectable()
exportclassDaemonextendsContribution{
@inject(ArduinoDaemon)
privatereadonlydaemon: ArduinoDaemon;
overrideregisterCommands(registry: CommandRegistry): void{
registry.registerCommand(Daemon.Commands.START_DAEMON,{
execute: ()=>this.daemon.start(),
});
registry.registerCommand(Daemon.Commands.STOP_DAEMON,{
execute: ()=>this.daemon.stop(),
});
registry.registerCommand(Daemon.Commands.RESTART_DAEMON,{
execute: ()=>this.daemon.restart(),
});
}
}
exportnamespaceDaemon{
exportnamespaceCommands{
exportconstSTART_DAEMON: Command={
id: 'arduino-start-daemon',
label: nls.localize('arduino/daemon/start','Start Daemon'),
category: 'Arduino',
};
exportconstSTOP_DAEMON: Command={
id: 'arduino-stop-daemon',
label: nls.localize('arduino/daemon/stop','Stop Daemon'),
category: 'Arduino',
};
exportconstRESTART_DAEMON: Command={
id: 'arduino-restart-daemon',
label: nls.localize('arduino/daemon/restart','Restart Daemon'),
category: 'Arduino',
};
}
}