import { Override } from "./override.js"; import { PipelineError } from "./pipeline-error.js"; import { PipelineSource } from "./pipeline-source.js"; import type { PipelineDescription, PipelineInput, PipelineSpec, PrerequisiteView, StageView } from "./spec.js"; /** Builds an override from its YAML. It throws when the YAML is not a patch. */ type Change = () => Override; /** * One pipeline as text, opened or parsed by `Pipelines`. It never throws while * it is made: `errors()` and `isValid()` answer for any text, so an editor * checks on every keystroke. The methods that read a pipeline throw the * `PipelineError` when there is one. * * This is the `Pipeline` of `testeiya/pipeline`. The CLI's runner in * `pipeline.ts` has the same name and is not exported from the package. */ export declare class Pipeline { /** The YAML as it was given, before `$extends` and overrides. */ readonly source: string; private readonly parser; private readonly overrides; private outcome?; /** `Pipelines` makes these: call `pipelines.open(name)` or `pipelines.parse(yaml)`. */ constructor( /** The YAML as it was given, before `$extends` and overrides. */ source: string, parser: PipelineSource, overrides?: Change[]); /** Nothing stops this pipeline from running. */ isValid(): boolean; /** * What is wrong, for an editor: each error has `message`, and `line` and * `key` when the problem has a place in the text. It is empty for a valid * pipeline. It holds every problem scripted-yaml found; a check of the * runner's own, like a duplicate stage id, stops at the first. */ errors(): PipelineError[]; /** Name, description, target, stages, prerequisites and inputs in one plain object, ready for JSON. */ describe(): PipelineDescription; /** The stages in the order they run, for a stage view. */ stages(): StageView[]; /** Every variable a user can set, for a form: required first, then the ones that unlock stages, then the rest. */ inputs(): PipelineInput[]; /** The named checks, and the stages that need each. */ prerequisites(): PrerequisiteView[]; /** One self-contained YAML file, with `$extends` and overrides applied: write it to disk and run it. */ yaml(): string; /** The pipeline key for key, with every default filled in. */ spec(): PipelineSpec; /** A copy patched as `--pipeline YAML` does: `$replace`, `$add`, `$before`, `$after`, `$remove`. */ override(yaml: string): Pipeline; /** A copy with one stage patched, as `--stage ID:YAML` does. */ overrideStage(id: string, yaml: string): Pipeline; private with; private checked; private check; } export {};