import { Project } from "@atomist/automation-client"; import { PushAwareParametersInvocation } from "@atomist/sdm"; import { ParamInfo, TransformRecipe } from "../../ProjectAnalysis"; import { TransformRecipeContributor } from "../../TransformRecipeContributor"; /** * Path to YAML template definitions file * @type {string} */ export declare const YamlPath = "atomist-seed.yml"; /** * Parameter based on a placeholder. * literal is what was matched (e.g. $NAME$) to allow easy replacement. */ export declare type PlaceholderParameter = { name: string; literal: string; } & ParamInfo; /** * Type for format of file at $YamlPath * Format is like this: * * parameters: * Thing: * description: This is a thing * pattern: [a-z]+ */ export interface PlaceholderParameterDefinitions { parameters: { [name: string]: PlaceholderParameter; }; } /** * Definition of a well-known parameter available to all * transforms. */ export interface WellKnownParameterDefinition { name: string; compute: (papi: PushAwareParametersInvocation) => string; } /** * Identify and replace placeholders in a seed project. * Syntax is of form $$NAME$$, and may occur in files or directories. * Also handles cookie cutter templates. */ export declare class PlaceholderTransformRecipeContributor implements TransformRecipeContributor { private readonly placeholders; readonly wellKnownParameters: WellKnownParameterDefinition[]; analyze(p: Project): Promise; /** * Create a new PlaceholderTransformRecipeContributor. * It is possible to define alternative or additional placeholder expansions * and additional well known parameters. * @param {RegExp[]} placeholders placeholder patterns. Placeholders must be specified with /g * and must define a single capture group for the actual value. * @param customParameterDefinitions definitions of additional well known parameters */ constructor(placeholders?: RegExp[], customParameterDefinitions?: WellKnownParameterDefinition[]); }