import { types as T } from "@start9labs/start-sdk" import { Effects } from "../Models/Effects" import { CallbackHolder } from "../Models/CallbackHolder" import { Optional } from "ts-matches/lib/parsers/interfaces" export type Procedure = | "/packageInit" | "/packageUninit" | "/backup/create" | "/backup/restore" | `/actions/${string}/getInput` | `/actions/${string}/run` export type ExecuteResult = | { ok: unknown } | { err: { code: number; message: string } } export type System = { containerInit(effects: T.Effects): Promise start(effects: T.Effects): Promise stop(): Promise packageInit(effects: Effects, timeoutMs: number | null): Promise packageUninit( effects: Effects, nextVersion: Optional, timeoutMs: number | null, ): Promise createBackup(effects: T.Effects, timeoutMs: number | null): Promise restoreBackup(effects: T.Effects, timeoutMs: number | null): Promise runAction( effects: Effects, actionId: string, input: unknown, timeoutMs: number | null, ): Promise getActionInput( effects: Effects, actionId: string, timeoutMs: number | null, ): Promise exit(): Promise } export type RunningMain = { callbacks: CallbackHolder stop(): Promise }