mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
19 lines
478 B
TypeScript
19 lines
478 B
TypeScript
import { Effects } from '../Effects'
|
|
import { Host, HostId, PackageId } from '../osBindings'
|
|
import { Watchable } from './Watchable'
|
|
|
|
export class GetHostInfo extends Watchable<Host | null> {
|
|
protected readonly label = 'GetHostInfo'
|
|
|
|
constructor(
|
|
effects: Effects,
|
|
readonly opts: { hostId: HostId; packageId?: PackageId },
|
|
) {
|
|
super(effects)
|
|
}
|
|
|
|
protected fetch(callback?: () => void) {
|
|
return this.effects.getHostInfo({ ...this.opts, callback })
|
|
}
|
|
}
|