feat: Add in the new changes for the new init system that is going to be used in the startos

This commit is contained in:
J H
2023-11-28 13:15:15 -07:00
parent 27127f58d4
commit 125c7a2ac3
3 changed files with 32 additions and 7 deletions

View File

@@ -5,6 +5,8 @@ import { PortOptions } from "./interfaces/Host"
import { UrlString } from "./util/getNetworkInterface"
import { NetworkInterfaceType } from "./util/utils"
export type Signals = "SIGINT" | "SIGTERM" | "SIGKILL" | "SIGHUP"
export type ExportedAction = (options: {
effects: Effects
input?: Record<string, unknown>
@@ -128,7 +130,7 @@ export type DaemonReceipt = {
}
export type Daemon = {
wait(): Promise<string>
term(): Promise<void>
term(options?: { signal?: Signals; timeout?: number }): Promise<void>
[DaemonProof]: never
}
@@ -148,7 +150,7 @@ export type CommandType<A extends string> =
export type DaemonReturned = {
wait(): Promise<string>
term(): Promise<void>
term(options?: { signal?: Signals; timeout?: number }): Promise<void>
}
export type ActionMetadata = {
@@ -398,6 +400,8 @@ export type Effects = {
message?: string
}): Promise<void>
setMainStatus(o: { status: "running" | "stopped" }): Promise<void>
/** Set the dependencies of what the service needs, usually ran during the set config as a best practice */
setDependencies(dependencies: Dependencies): Promise<DependenciesReceipt>
/** Exists could be useful during the runtime to know if some service exists, option dep */