import { FxError } from "@microsoft/teamsfx-api"; import { Result } from "neverthrow"; import { RenderVars, TemplateFileEntry } from "../model/dataModel"; /** A resolved step parameter value. */ export type ParamValue = string | boolean | string[]; /** A step's author-supplied `with` block, or its resolved form. */ export type StepParams = Record; /** One `pipeline.steps` entry. `produces` is reserved for future cross-step data flow. */ export interface PipelineStep { step: string; comment?: string; when?: string; with?: StepParams; produces?: string[]; } /** A parsed, schema-valid `pipeline.json`. */ export interface Pipeline { pipeline: string; comment?: string; steps: PipelineStep[]; } /** The output directory plus its pre-run file snapshot. */ export interface TargetDir { path: string; existing: string[]; } /** A render-phase path skipped because it already existed. */ export interface SkippedFile { path: string; warning: string; } /** The result of a scaffold run. */ export interface ScaffoldOutcome { written: string[]; skipped: SkippedFile[]; stepsRun: string[]; stepsSkipped: string[]; } /** A resolved named orchestration. */ export interface Orchestration { name: string; } /** Minimal manifest wrapper face needed by registered steps. */ export interface ManifestWrapper { addAction(action: Record): void; } /** The capabilities the executor hands each registered step's `apply`. */ export interface StepContext { write(path: string, data: Buffer): void; manifestWrapper(kind: string): ManifestWrapper; /** Read current bytes at a target path, or `undefined` when absent. */ read(path: string): Buffer | undefined; } /** An engine-registered, whitelist-dispatched post-render step. */ export interface RegisteredStep { validateParams(resolved: StepParams): string | undefined; apply(resolved: StepParams, ctx: StepContext): Result | Promise>; } /** Narrow pipeline port; `render` is the single Mustache surface for paths and values. */ export interface PipelineRuntimePort { pipelineRegistry(pipelineName: string): Orchestration | undefined; stepRegistry(stepName: string): RegisteredStep | undefined; evalWhen(expr: string, renderVars: RenderVars): Result; render(mustache: string, renderVars: RenderVars): Result; manifestWrapper(kind: string): ManifestWrapper; write(path: string, data: Buffer): void; /** Current bytes at a path, or `undefined` when absent. */ read(path: string): Buffer | undefined; } /** `SystemError` names for engine-side pipeline breaks. */ export declare const PIPELINE_UNKNOWN_PIPELINE = "PipelineUnknownPipeline"; export declare const PIPELINE_UNKNOWN_STEP = "PipelineUnknownStep"; export declare const PIPELINE_PARAMS_VIOLATION = "PipelineParamsViolation"; export declare const PIPELINE_CROSS_STEP_REFERENCE = "PipelineCrossStepReference"; /** `UserError` name for a non-empty create target. */ export declare const REQUIRE_EMPTY_TARGET = "RequireEmptyTarget"; /** Execute one template package's pipeline against a resolved render context. */ export declare function runScaffoldPipeline(pipeline: Pipeline, content: TemplateFileEntry[], renderVars: RenderVars, targetDir: TargetDir, port: PipelineRuntimePort): Promise>; //# sourceMappingURL=runScaffoldPipeline.d.ts.map