@jameslnewell/buildkite-pipelines
Version:
Generate Buildkite pipelines from code.
26 lines (25 loc) • 1.67 kB
TypeScript
import { GroupStep, Pipeline, StepBuilder, StepSchema } from '../lib';
export interface FindStepsPredicate {
(step: StepSchema | StepBuilder, index: number, steps: Array<StepSchema | StepBuilder>): boolean;
}
export interface FindStepsNarrowPredicate<S extends StepSchema | StepBuilder> {
(step: StepSchema | StepBuilder, index: number, steps: Array<StepSchema | StepBuilder>): step is S;
}
export interface FindStepsOptions {
/**
* Whether to search recursively within GroupSteps
*/
recursive?: boolean | undefined;
}
/**
* Finds all the steps that match the predicate within a pipeline, group, or
* iterable of steps
*/
export declare function findSteps<S extends StepSchema | StepBuilder>(pipelineGroupOrSteps: Pipeline | GroupStep | Iterable<StepSchema | StepBuilder>, predicate: FindStepsNarrowPredicate<S>, options?: FindStepsOptions): ReadonlyArray<S>;
export declare function findSteps(pipelineGroupOrSteps: Pipeline | GroupStep | Iterable<StepSchema | StepBuilder>, predicate: FindStepsPredicate, options?: FindStepsOptions): ReadonlyArray<StepSchema | StepBuilder>;
/**
* Finds the first step that matches the predicate within a pipeline, group, or
* iterable of steps
*/
export declare function findFirstStep<S extends StepSchema | StepBuilder>(pipelineGroupOrSteps: Pipeline | GroupStep | Iterable<StepSchema | StepBuilder>, predicate: FindStepsNarrowPredicate<S>, options?: FindStepsOptions): S | undefined;
export declare function findFirstStep(pipelineGroupOrSteps: Pipeline | GroupStep | Iterable<StepSchema | StepBuilder>, predicate: FindStepsPredicate, options?: FindStepsOptions): StepSchema | StepBuilder | undefined;