import { Project } from "@atomist/automation-client"; import { AutoMergeMethod, AutoMergeMode } from "@atomist/automation-client/lib/operations/edit/editModes"; import { ExtensionPack, Goal, PushImpact, PushListenerInvocation, SoftwareDeliveryMachine, TransformPresentation } from "@atomist/sdm"; import { PublishFingerprints } from "../adhoc/fingerprints"; import { MessageMaker } from "../checktarget/messageMaker"; import { VirtualProjectFinder } from "../fingerprints/virtual-project/VirtualProjectFinder"; import { ApplyTargetParameters } from "../handlers/commands/applyFingerprint"; import { RebaseOptions } from "../handlers/commands/rebase"; import { Aspect, FingerprintDiffHandler, FingerprintHandler, FP } from "./Aspect"; import { FingerprintComputer } from "./runner"; export declare function forFingerprints(...s: string[]): (fp: FP) => boolean; /** * customize the out of the box strategy for monitoring when fingerprints are out * of sync with a target. * */ export interface FingerprintImpactHandlerConfig { complianceGoal?: Goal; complianceGoalFailMessage?: string; transformPresentation: TransformPresentation; messageMaker: MessageMaker; } /** * Setting up a PushImpactHandler to handle different strategies (FingerprintHandlers) involves giving them the opportunity * to configure the sdm, and they'll need all of the current active Aspects. */ export declare type RegisterFingerprintImpactHandler = (sdm: SoftwareDeliveryMachine, registrations: Aspect[]) => FingerprintHandler; export declare const DefaultTargetDiffHandler: FingerprintDiffHandler; /** * wrap a FingerprintDiffHandler to only check if the shas have changed * * @param handler the FingerprintDiffHandler to wrap */ export declare function diffOnlyHandler(handler: FingerprintDiffHandler): FingerprintDiffHandler; export declare type AspectsFactory = (p: Project, pli: PushListenerInvocation, aspects: Aspect[]) => Promise; /** * Options to configure the Fingerprint support */ export interface FingerprintOptions { /** * Optional PushImpact goal that will get configured */ pushImpactGoal?: PushImpact; /** * Aspects we are managing */ aspects: Aspect | Aspect[]; /** * Optionally add aspects based on current push */ aspectsFactory?: AspectsFactory; transformPresentation?: TransformPresentation; /** * Configure the rebasing strategy for raised PRs * Rebasing support is disabled by default. * * This is only useful when transformPresentation is returning a PullRequest editMode. */ rebase?: RebaseOptions; /** * If provided, all aspects will be automatically be wrapped to use the VirtualProjectFinder. */ virtualProjectFinder?: VirtualProjectFinder; /** * By default, fingerprints will be sent to Atomist. Set this in local mode etc * to route them differently. */ publishFingerprints?: PublishFingerprints; } export declare const DefaultTransformPresentation: TransformPresentation; /** * Options to configure the PullRequest creation */ export interface PullRequestTransformPresentationOptions { branchPrefix?: string; title?: string; body?: string; message?: string; autoMerge?: { method?: AutoMergeMethod; mode?: AutoMergeMode; }; } /** * Creates the default TransformPresentation for raising PullRequests */ export declare function createPullRequestTransformPresentation(options?: PullRequestTransformPresentationOptions): TransformPresentation; export interface FingerprintExtensionPack extends ExtensionPack { /** * Function to use to calculate fingerprints on a project */ fingerprintComputer: FingerprintComputer; } /** * Install and configure the fingerprint support in this SDM */ export declare function fingerprintSupport(options: FingerprintOptions): FingerprintExtensionPack;