@remote.it/core
Version:
Core remote.it JavasScript/TypeScript library
27 lines (20 loc) • 710 B
text/typescript
import { EventEmitter } from 'events'
import { Environment } from './Environment'
type SystemServiceMessage = 'installed' | 'uninstalled' | 'started'
export interface GenericSystemService {
on(msg: SystemServiceMessage, cb: (...args: any[]) => void): this
}
export abstract class GenericSystemService extends EventEmitter {
readonly installed: boolean = false
constructor(protected config: string = Environment.configPath) {
super()
}
get command() {
return `${Environment.remoteitPath} watch -c ${this.config}`
}
abstract install(): Promise<this>
abstract start(): Promise<this>
abstract stop(): Promise<this>
abstract uninstall(): Promise<this>
abstract exists: boolean
}