import * as internal from "./internal.js"; import { ExpressionValue } from "./expression.js"; import { type JobDefaults } from "./job.js"; import type { StepLike } from "./step.js"; import { type WriteOrLintOptions } from "./write.js"; /** An input declared by a composite action. */ export interface ActionInputDef { description: string; required?: boolean; default?: string | number | boolean; deprecationMessage?: string; } /** An output declared by a composite action. */ export interface ActionOutputDef { description: string; /** Usually a step output expression, ex. `checkStep.outputs.result`. */ value: ExpressionValue | string; } /** A composite action definition. */ export interface ActionConfig { name: string; description: string; author?: string; inputs?: ActionInputs; outputs?: Record; /** * Applied to `run` steps that do not set the field themselves. Composite * actions have no `defaults` block of their own and GitHub requires every * `run` step in one to name its `shell`, so this saves repeating it. */ defaults?: JobDefaults; steps: StepLike | StepLike[]; branding?: { icon: string; color: string; }; } /** * The inputs of a composite action. Each input is exposed as a property * holding the `inputs.` expression, so inputs can be referenced directly * in step configuration and conditions. */ export declare class ActionInputs<_K extends string> { constructor(defs: Record); /** Serializes the input definitions to their YAML form. */ [internal.toYaml](): Record; } type InputsWithExprs = ActionInputs & { readonly [P in K]: ExpressionValue; }; /** * Defines the inputs of a composite action, returning them with a typed * property per input holding that input's `inputs.` expression. */ export declare function defineInputs>(defs: T): InputsWithExprs; /** * A resolved composite action. Prefer the `action()` free function over * constructing this directly. */ export declare class Action { #private; constructor(config: ActionConfig); /** Serializes the action to its `action.yml` YAML. */ toYamlString(options?: { header?: string; }): string; /** Writes the action's YAML to a file. */ writeToFile(path: string | URL, options?: { header?: string; }): void; /** * Writes the action's YAML to `options.filePath`, or with `--lint` verifies * the file there is up to date. See {@link writeOrLintYaml}. */ writeOrLint(options: WriteOrLintOptions): void; } /** Creates a composite action from the given configuration. */ export declare function action(config: ActionConfig): Action; export {}; //# sourceMappingURL=action.d.ts.map