import { ExtendedVersion, types as T, VersionRange, } from "@start9labs/start-sdk" import { Effects } from "../Models/Effects" import { CallbackHolder } from "../Models/CallbackHolder" export type Procedure = | "/backup/create" | `/actions/${string}/getInput` | `/actions/${string}/run` export type ExecuteResult = | { ok: unknown } | { err: { code: number; message: string } } export type System = { init( effects: T.Effects, kind: "install" | "update" | "restore" | null, ): Promise start(effects: T.Effects): Promise stop(): Promise createBackup(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( effects: Effects, target: ExtendedVersion | VersionRange | null, ): Promise } export type RunningMain = { callbacks: CallbackHolder stop(): Promise }