import type { ComposeSpecification } from "./schema/docker.js"; export type { ComposeSpecification } from "./schema/docker.js"; export type MaybePromise = T | Promise; export interface KuberHookContext { cwd: string; project: string; composeFile: string; configFile?: string; } export interface KuberBuildResult { built: string[]; changed: string[]; } export interface KuberResource { apiVersion?: string; kind?: string; metadata?: { name?: string; namespace?: string; labels?: Record; annotations?: Record; }; [key: string]: unknown; } export interface KuberBuildersConfig { amd64?: string; arm64?: string; remoteRoot?: string; } export interface KuberConfig { /** Kubernetes namespace/project name. Overrides the Compose name and working directory. */ project?: string; /** Compose file path, resolved relative to the working directory. */ composeFile?: string; /** Container registry hostname or path, without a trailing slash. */ registry?: string; builders?: KuberBuildersConfig; /** Maximum time to wait for each deployment rollout. */ rolloutTimeoutMs?: number; /** Runs once after the Compose file is parsed and validated. */ compose?( compose: ComposeSpecification, context: KuberHookContext, ): MaybePromise; /** Runs before build eligibility is evaluated when builds are enabled. */ preBuild?( compose: ComposeSpecification, context: KuberHookContext, ): MaybePromise; postBuild?( result: KuberBuildResult, context: KuberHookContext, ): MaybePromise; /** Runs after manifest rendering and before reconciliation planning. */ postRender?( resources: KuberResource[], context: KuberHookContext, ): MaybePromise; /** Runs after all desired resources have been applied. */ postApply?( resources: KuberResource[], context: KuberHookContext, ): MaybePromise; }