/** * Git Stash Protection Service * * Provides automatic stash/unstash functionality to protect uncommitted changes * during command execution that may inadvertently modify git state. */ export interface GitStatus { hasStagedChanges: boolean; hasUncommittedChanges: boolean; hasUnstagedChanges: boolean; hasUntrackedFiles: boolean; } export interface StashProtectionResult { error?: string; stashCreated: boolean; stashName?: string; } export interface UnstashResult { error?: string; restored: boolean; } /** * Function type for confirming stash creation with the user * Returns true if user confirms, false otherwise */ export type ConfirmStashFn = (message: string) => Promise; /** * Service to protect git working tree changes during command execution */ export declare class GitStashProtectionService { private readonly confirmFn?; private readonly logger; private stashCreated; private stashName; /** * Create a new GitStashProtectionService * * @param confirmFn - Optional function to prompt user for confirmation. * If not provided, interactive prompts will auto-confirm. */ constructor(confirmFn?: ConfirmStashFn); /** * Check if there are uncommitted changes in the working tree */ checkGitStatus(): Promise; /** * Prompt user to stash changes before command execution * * @param interactive - Whether to prompt the user or auto-stash * @returns Result indicating if stash was created */ promptAndStash(interactive?: boolean): Promise; /** * Create a stash with a recognisable message */ createStash(): Promise; /** * Restore stashed changes after command execution */ restoreStash(): Promise; /** * Check if a stash was created during this session */ hasActiveStash(): boolean; /** * Get the name of the created stash */ getStashName(): string | undefined; } export declare function getGitStashProtection(): GitStashProtectionService; /** * Create a new instance with optional confirm function * @param confirmFn - Function to prompt user for stash confirmation */ export declare function createGitStashProtection(confirmFn?: ConfirmStashFn): GitStashProtectionService; //# sourceMappingURL=git-stash-protection.service.d.ts.map