import { ReleasePullRequest } from './release-pull-request'; import { Release } from './release'; import { PullRequest } from './pull-request'; import { Commit } from './commit'; import { VersioningStrategy } from './versioning-strategy'; import { ChangelogNotes } from './changelog-notes'; import { Version } from './version'; /** * A strategy is responsible for determining which files are * necessary to update in a release pull request. */ export interface Strategy { readonly changelogNotes: ChangelogNotes; readonly path: string; readonly versioningStrategy: VersioningStrategy; /** * Builds a candidate release pull request * @param {Commit[]} commits Raw commits to consider for this release. * @param {Release} latestRelease Optional. The last release for this * component if available. * @param {boolean} draft Optional. Whether or not to create the pull * request as a draft. Defaults to `false`. * @returns {ReleasePullRequest | undefined} The release pull request to * open for this path/component. Returns undefined if we should not * open a pull request. */ buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise; /** * Given a merged pull request, build the candidate release. * @param {PullRequest} mergedPullRequest The merged release pull request. * @returns {Release} The candidate release. */ buildRelease(mergedPullRequest: PullRequest): Promise; /** * Return the component for this strategy. This may be a computed field. * @returns {string} */ getComponent(): Promise; /** * Return the component for this strategy used in the branch name. * This may be a computed field. * @returns {string} */ getBranchComponent(): Promise; /** * Validate whether version is a valid release. * @param version Released version. * @returns true of release is valid, false if it should be skipped. */ isPublishedVersion?(version: Version): boolean; }