import { Connection } from '@salesforce/core'; export type AddStageBranchParams = { connection: Connection; pipelineId: string; stageId: string; branchName: string; createVcsBranch: boolean; }; export type ExistingStageBranch = { branchId: string; branchName?: string; }; /** * Returns the branch currently associated with a pipeline stage, if any. * * A stage references its branch via DevopsPipelineStage.SourceCodeRepositoryBranchId. Adding a new * branch re-points that lookup, so callers must check for an existing branch first to avoid * orphaning the old SourceCodeRepositoryBranch record. */ export declare function getStageBranch(connection: Connection, stageId: string): Promise; /** * Deletes a SourceCodeRepositoryBranch record only when no pipeline stage still references it. * Returns true when the record was deleted, false when it is still referenced (left intact). * * Used to clean up the branch a stage was re-pointed away from during a --force replace, so the old * record isn't orphaned in the org. The reference check keeps a branch shared by another stage safe. */ export declare function deleteOrphanedBranch(connection: Connection, branchId: string): Promise; export type AddStageBranchResult = { success: boolean; stageId: string; branchName?: string; branchCreated?: boolean; repoBranchId?: string; pipelineId?: string; error?: string; }; /** * Associates a branch with a pipeline stage via the Connect API. * PATCH /services/data/v{version}/connect/devops/pipelines/{pipelineId}/stages/{stageId} */ export declare function addStageBranch(params: AddStageBranchParams): Promise;