mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
27 lines
648 B
TypeScript
27 lines
648 B
TypeScript
import { SDKManifest } from "../manifest/ManifestTypes"
|
|
import { Dependency } from "../types"
|
|
|
|
export type ConfigDependencies<T extends SDKManifest> = {
|
|
exists(id: keyof T["dependencies"]): Dependency
|
|
running(id: keyof T["dependencies"], healthChecks: string[]): Dependency
|
|
}
|
|
|
|
export const configDependenciesSet = <
|
|
T extends SDKManifest,
|
|
>(): ConfigDependencies<T> => ({
|
|
exists(id: keyof T["dependencies"]) {
|
|
return {
|
|
id,
|
|
kind: "exists",
|
|
} as Dependency
|
|
},
|
|
|
|
running(id: keyof T["dependencies"], healthChecks: string[]) {
|
|
return {
|
|
id,
|
|
kind: "running",
|
|
healthChecks,
|
|
} as Dependency
|
|
},
|
|
})
|