import { DiffSelection } from './diff'; /** The porcelain status for an ordinary changed entry */ export declare type OrdinaryEntry = { readonly kind: 'ordinary'; /** how we should represent the file in the application */ readonly type: 'added' | 'modified' | 'deleted'; /** the status of the index for this entry (if known) */ readonly index?: GitStatusEntry; /** the status of the working tree for this entry (if known) */ readonly workingTree?: GitStatusEntry; }; /** The porcelain status for a renamed or copied entry */ export declare type RenamedOrCopiedEntry = { readonly kind: 'renamed' | 'copied'; /** the status of the index for this entry (if known) */ readonly index?: GitStatusEntry; /** the status of the working tree for this entry (if known) */ readonly workingTree?: GitStatusEntry; }; /** The porcelain status for an unmerged entry */ export declare type UnmergedEntry = { readonly kind: 'conflicted'; /** the first character of the short code ("ours") */ readonly us: GitStatusEntry; /** the second character of the short code ("theirs") */ readonly them: GitStatusEntry; }; /** The porcelain status for an unmerged entry */ export declare type UntrackedEntry = { readonly kind: 'untracked'; }; /** The union of possible entries from the git status */ export declare type FileEntry = OrdinaryEntry | RenamedOrCopiedEntry | UnmergedEntry | UntrackedEntry; /** * The status entry code as reported by Git. */ export declare enum GitStatusEntry { Modified = 0, Added = 1, Deleted = 2, Renamed = 3, Copied = 4, Unchanged = 5, Untracked = 6, Ignored = 7, UpdatedButUnmerged = 8 } /** The file status as represented in GitHub Desktop. */ export declare enum AppFileStatus { New = 0, Modified = 1, Deleted = 2, Copied = 3, Renamed = 4, Conflicted = 5 } /** * The encapsulation of the result from `git status`. */ export interface IStatusResult { readonly currentBranch?: string; readonly currentUpstreamBranch?: string; readonly currentTip?: string; readonly branchAheadBehind?: IAheadBehind; /** * `true` if the repository exists at the given location. */ readonly exists: boolean; /** * The absolute path to the repository's working directory. */ readonly workingDirectory: WorkingDirectoryStatus; /** * `true` if a limit was specified and reached during get `git status`, so this result is not complete. Otherwise, (including `undefined`) is complete. */ readonly incomplete?: boolean; } /** * The number of commits a revision range is ahead/behind. */ export interface IAheadBehind { readonly ahead: number; readonly behind: number; } /** * The state of the changed file in the working directory. */ export declare enum FileStatus { 'New' = 0, 'Modified' = 1, 'Deleted' = 2, 'Renamed' = 3, 'Conflicted' = 4, 'Copied' = 5 } /** * Represents a file change in the working directory. */ export declare class FileChange { readonly path: string; readonly status: AppFileStatus; readonly oldPath?: string | undefined; readonly staged: boolean; /** * Creates a new file change instance. * * @param path The relative path to the file in the repository. * @param status The original path in the case of a renamed file. * @param oldPath The status of the change to the file. */ constructor(path: string, status: AppFileStatus, oldPath?: string | undefined, staged?: boolean); /** An ID for the file change. */ get id(): string; } /** encapsulate the changes to a file in the working directory */ export declare class WorkingDirectoryFileChange extends FileChange { readonly selection: DiffSelection; /** * Creates a new working directory file change instance. * @param path The relative path to the file in the repository. * @param status The original path in the case of a renamed file. * @param selection contains the selection details for this file - all, nothing or partial. * @param oldPath The status of the change to the file. */ constructor(path: string, status: AppFileStatus, selection: DiffSelection, oldPath?: string, staged?: boolean); /** * Create a new WorkingDirectoryFileChange with the given includedness. */ withIncludeAll(include: boolean): WorkingDirectoryFileChange; /** * Create a new `WorkingDirectoryFileChange` instance with the given diff selection. * @param selection the diff selection. */ withSelection(selection: DiffSelection): WorkingDirectoryFileChange; } /** * The state of the working directory for a repository. */ export declare class WorkingDirectoryStatus { readonly files: ReadonlyArray; readonly includeAll: boolean; /** * Creates a new instance that represents the working directory status. * * @param files The list of changes in the repository's working directory. * @param includeAll Update the include checkbox state of the form. */ constructor(files: ReadonlyArray, includeAll?: boolean); /** * Update the include state of all files in the working directory */ withIncludeAllFiles(includeAll: boolean): WorkingDirectoryStatus; /** * Update by replacing the file with the same ID with a new file. * * @param file updates the argument after replacing all files then returns with a new instance. */ byReplacingFile(file: WorkingDirectoryFileChange): WorkingDirectoryStatus; /** * Find the file with the given ID. * * @param id the internal unique ID of the file. */ findFileWithID(id: string): WorkingDirectoryFileChange | undefined; }