import stream from 'node:stream';
import '@visulima/package';
interface BranchObject {
  channel?: string | false;
  name: string;
  prerelease?: boolean | string;
  range?: string;
}
type BranchSpec$1 = BranchObject | string;
type PluginSpec<T = any> = string | [string, T];
interface Options {
  [name: string]: any;
  branches?: BranchSpec$1 | ReadonlyArray<BranchSpec$1>;
  ci?: boolean;
  dryRun?: boolean;
  extends?: ReadonlyArray<string> | string;
  plugins?: ReadonlyArray<PluginSpec>;
  repositoryUrl?: string;
  tagFormat?: string;
}
interface Commit {
  author: {
    email: string;
    name: string;
    short: string;
  };
  body: string;
  commit: {
    long: string;
    short: string;
  };
  committer: {
    email: string;
    name: string;
    short: string;
  };
  committerDate: string;
  hash: string;
  message: string;
  subject: string;
  tree: {
    long: string;
    short: string;
  };
}
interface CommonContext {
  branch: BranchSpec;
  branches: BranchSpec[];
  cwd: string;
  env: "object";
  logger: {
    error: (...message: string[]) => void;
    log: (...message: string[]) => void;
    success: (...message: string[]) => void;
    warn: (...message: string[]) => void;
  };
  options: Options;
  stderr: stream.Writable;
  stdout: stream.Writable;
}
type VerifyConditionsContext = CommonContext;
type CommonContext2 = CommonContext & {
  releases: Release[];
};
type AddChannelContext = CommonContext2 & {
  commits: Commit[];
  currentRelease: Release;
  lastRelease: Release;
  nextRelease: Release;
};
type CommonContext3 = CommonContext2 & {
  commits: Commit[];
  lastRelease: Release;
};
type CommonContext4 = CommonContext3 & {
  commits: Commit[];
  nextRelease: Release;
};
type PrepareContext = CommonContext4;
type PublishContext = CommonContext4;
interface BranchSpec {
  name: string;
  tags?: Tag[];
}
interface Tag {
  channel?: string;
  gitHead?: string;
  gitTag?: string;
  version?: string;
}
interface Release {
  channel?: string | null;
  gitHead?: string;
  gitTag?: string;
  name?: string;
  type?: "build" | "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease";
  version: string;
}
interface PluginConfig {
  branches?: (string | {
    name: string;
    prerelease: boolean;
  })[];
  disableScripts?: boolean;
  npmPublish?: boolean;
  pkgRoot?: string;
  publishBranch?: string;
  tarballDir?: false | string;
}
interface ReleaseInfo {
  channel: string;
  name: string;
  url?: string;
}
declare const verifyConditions: (pluginConfig: PluginConfig, context: VerifyConditionsContext) => Promise<void>;
declare const prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
declare const publish: (pluginConfig: PluginConfig, context: PublishContext) => Promise<ReleaseInfo | false>;
declare const addChannel: (pluginConfig: PluginConfig, context: AddChannelContext) => Promise<ReleaseInfo | false>;
export { addChannel, prepare, publish, verifyConditions };
