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[]; /** Resolved immutable image references (`name -> registry/.../image:latest@sha256:...`) for buildable services. */ images: Record; } export interface KuberResource { apiVersion?: string; kind?: string; metadata?: { name?: string; namespace?: string; labels?: Record; annotations?: Record; }; [key: string]: unknown; } 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; /** 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; }