import { GitOptions } from "../../types/git.js";
import { LongCommitSha } from "../schema-utils/git.js";
import "../schema-utils/index.js";
import { PlatformCommitOptions } from "../../config/types.js";
import { StatusResult } from "simple-git";
//#region lib/util/git/types.d.ts
type GitNoVerifyOption = 'commit' | 'push';
/**
 * Represents a virtual branch tracked as `refs/remotes/origin/<name>`.
 * Used by platforms like Gerrit where changes are represented as refs
 * (e.g., refs/changes/34/1234/1) instead of regular branches.
 */
interface VirtualBranch {
  /** The ref this virtual branch is fetched from (e.g., 'refs/changes/34/1234/1') */
  ref: string;
  /** The commit SHA this virtual branch points to */
  sha: LongCommitSha;
}
interface StorageConfig {
  currentBranch?: string;
  defaultBranch?: string;
  url: string;
  upstreamUrl?: string | undefined;
  extraCloneOpts?: GitOptions;
  cloneSubmodules?: boolean;
  cloneSubmodulesFilter?: string[];
  fullClone?: boolean;
  /**
   * Virtual branches to initialize from non-standard refs (e.g., Gerrit change refs).
   * Each virtual branch is fetched and stored as refs/remotes/origin/<name>.
   * Keyed by branch name.
   */
  virtualBranches?: Record<string, VirtualBranch>;
}
interface FileAddition {
  /**
   * Addition creates new file or modifies existing one
   */
  type: 'addition';
  /**
   * Relative file path
   */
  path: string;
  /**
   * File contents
   */
  contents: string | Buffer | null;
  /**
   * The executable bit
   */
  isExecutable?: boolean;
  isSymlink?: boolean;
}
interface FileDeletion {
  /**
   * Deletion removes the file
   */
  type: 'deletion';
  /**
   * Relative file path
   */
  path: string;
}
type FileChange = FileAddition | FileDeletion;
interface CommitFilesConfig {
  baseBranch?: string;
  branchName: string;
  files: FileChange[];
  message: string | string[];
  /** Structured git trailers (`Key: value` lines) to add in the final block of the commit message */
  trailers?: string[];
  force?: boolean;
  platformCommit?: PlatformCommitOptions;
  /** Only needed by Gerrit platform */
  prTitle?: string;
  /** Only needed by Gerrit platform */
  autoApprove?: boolean;
}
interface PushFilesConfig {
  sourceRef: string;
  targetRef?: string;
  files: FileChange[];
  pushOptions?: string[];
}
interface CommitResult {
  parentCommitSha: LongCommitSha;
  commitSha: LongCommitSha;
  files: FileChange[];
}
type GitObjectType = 'blob' | 'tree' | 'commit';
interface DiffTreeItem {
  path: string;
  mode: string;
  type: GitObjectType;
  sha: LongCommitSha | null;
}
type GitOperationType =
/**
 * The `git clone` sub-command.
 */
'clone' |
/**
 * The `git reset` sub-command.
 */
'reset' |
/**
 * The `git checkout` sub-command.
 */
'checkout' |
/**
 * The `git fetch` sub-command.
 */
'fetch' |
/**
 * The `git pull` sub-command.
 */
'pull' |
/**
 * The `git push` sub-command.
 */
'push' |
/**
 * The `git clean` sub-command.
 */
'clean' |
/**
 * The `git merge` sub-command.
 */
'merge' |
/**
 * The `git submodule` sub-command.
 */
'submodule' |
/**
 * The `git commit` sub-command.
 */
'commit' |
/**
 * The `git branch` sub-command.
 */
'branch' |
/**
 * Any internal "plumbing" commands
 *
 * - `git update-index`
 *
 * See also: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
 */
'plumbing' |
/**
 * Any other operations i.e.
 *
 * - `git add`
 * - `git branch`
 * - `git config`
 * - `git diff`
 * - `git log`
 * - `git ls-remote`
 * - `git remote`
 * - `git rev-parse`
 * - `git status`
 *
 * See also: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain
 */
'other';
//#endregion
export { CommitFilesConfig, CommitResult, DiffTreeItem, FileAddition, FileChange, FileDeletion, GitNoVerifyOption, GitObjectType, GitOperationType, PushFilesConfig, type StatusResult, StorageConfig, VirtualBranch };
//# sourceMappingURL=types.d.ts.map