import { Options } from "execa";

//#region lib/util/exec/types.d.ts
/**
 * A `tool` that Containerbase supports.
 *
 * TODO #41849 replace with upstream types
 */
declare const toolNames: readonly ["bazelisk", "bun", "bundler", "cocoapods", "composer", "conan", "copier", "corepack", "devbox", "dotnet", "erlang", "elixir", "flux", "gleam", "golang", "gradle", "hashin", "helm", "helmfile", "java", "java-maven", "jb", "kustomize", "maven", "nix", "node", "npm", "pdm", "php", "pip-tools", "pipenv", "pnpm", "pixi", "poetry", "python", "ruby", "rust", "uv", "yarn", "yarn-slim", "dart", "flutter", "vendir"];
type ToolName = (typeof toolNames)[number];
declare function isToolName(value: unknown): value is ToolName;
/**
 * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.
 */
declare const additionalConstraintNames: readonly ["go", "gomodMod", "jenkins", "pipTools"];
/**
 * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.
 */
type AdditionalConstraintName = (typeof additionalConstraintNames)[number];
declare function isAdditionalConstraintName(value: unknown): value is AdditionalConstraintName;
/**
 * A name usable as a key in a `constraints` record, which may be tools that Containerbase supports.
 */
type ConstraintName = ToolName | AdditionalConstraintName;
declare function isConstraintName(value: unknown): value is ConstraintName;
interface ToolConstraint {
  toolName: ToolName;
  constraint?: string | null;
}
interface ToolConfig {
  datasource: string;
  extractVersion?: string;
  packageName: string;
  versioning: string;
}
type Opt<T> = T | null | undefined;
type VolumesPair = [string, string];
type VolumeOption = Opt<string | VolumesPair>;
interface DockerOptions {
  volumes?: Opt<VolumeOption[]>;
  envVars?: Opt<Opt<string>[]>;
  cwd?: Opt<string>;
}
type DataListener = (chunk: any) => void;
interface OutputListeners {
  stdout?: DataListener[];
  stderr?: DataListener[];
}
interface RawExecOptions extends Options {
  maxBuffer?: number | undefined;
  cwd?: string;
  outputListeners?: OutputListeners;
}
interface ExecResult {
  stdout: string;
  stderr: string;
  /**
   * The process' exit code in the case of a failure.
   *
   * This is only set if using `ignoreFailure` when executing a command
   *
   */
  exitCode?: number;
}
type ExtraEnv<T = unknown> = Record<string, T>;
interface ExecOptions {
  cwd?: string;
  cwdFile?: string;
  env?: Opt<ExtraEnv>;
  extraEnv?: Opt<ExtraEnv>;
  docker?: Opt<DockerOptions>;
  toolConstraints?: Opt<ToolConstraint[]>;
  preCommands?: Opt<string[]>;
  ignoreStdout?: boolean;
  maxBuffer?: number | undefined;
  timeout?: number | undefined;
  shell?: boolean | string | undefined;
}
/**
 * configuration that can be configured on a per-command basis, that doesn't make sense to be on the `RawExecOptions`
 */
interface CommandWithOptions {
  command: string[];
  /** do not throw errors when a command fails, but do log that an error occurred */
  ignoreFailure?: boolean;
  /**
   * Execute the `command` within a shell
   *
   * WARNING this can result in security issues if this includes user-controlled commands
   * **/
  shell?: boolean | string;
}
//#endregion
export { AdditionalConstraintName, CommandWithOptions, ConstraintName, DataListener, DockerOptions, ExecOptions, ExecResult, ExtraEnv, Opt, OutputListeners, RawExecOptions, ToolConfig, ToolConstraint, ToolName, VolumeOption, VolumesPair, isAdditionalConstraintName, isConstraintName, isToolName };
//# sourceMappingURL=types.d.ts.map