import { EventEmitter } from 'events';
export interface ApprovalComment {
    type: 'selection' | 'general';
    selectedText?: string;
    comment: string;
    timestamp: string;
    lineNumber?: number;
    characterPosition?: number;
    highlightColor?: string;
}
export interface DocumentSnapshot {
    id: string;
    approvalId: string;
    approvalTitle: string;
    version: number;
    timestamp: string;
    trigger: 'initial' | 'revision_requested' | 'approved' | 'manual';
    status: 'pending' | 'approved' | 'rejected' | 'needs-revision';
    content: string;
    fileStats: {
        size: number;
        lines: number;
        lastModified: string;
    };
    comments?: ApprovalComment[];
    annotations?: string;
}
export interface SnapshotMetadata {
    approvalId: string;
    currentVersion: number;
    snapshots: {
        version: number;
        filename: string;
        timestamp: string;
        trigger: string;
    }[];
}
export interface FileSnapshotMetadata {
    filePath: string;
    currentVersion: number;
    snapshots: {
        version: number;
        filename: string;
        timestamp: string;
        trigger: string;
        approvalId: string;
        approvalTitle: string;
    }[];
}
export interface DiffResult {
    additions: number;
    deletions: number;
    changes: number;
    chunks: DiffChunk[];
}
export interface DiffChunk {
    oldStart: number;
    oldLines: number;
    newStart: number;
    newLines: number;
    lines: DiffLine[];
}
export interface DiffLine {
    type: 'add' | 'delete' | 'normal';
    oldLineNumber?: number;
    newLineNumber?: number;
    content: string;
}
export interface ApprovalRequest {
    id: string;
    title: string;
    filePath: string;
    type: 'document' | 'action';
    status: 'pending' | 'approved' | 'rejected' | 'needs-revision';
    createdAt: string;
    respondedAt?: string;
    response?: string;
    annotations?: string;
    comments?: ApprovalComment[];
    revisionHistory?: {
        version: number;
        content: string;
        timestamp: string;
        reason?: string;
    }[];
    metadata?: Record<string, any>;
    category: 'spec' | 'steering';
    categoryName: string;
}
export declare class ApprovalStorage extends EventEmitter {
    projectPath: string;
    originalProjectPath: string;
    fileResolutionPath: string;
    private approvalsDir;
    private watcher?;
    private pendingEmit;
    private readonly DEBOUNCE_MS;
    constructor(translatedPath: string, options?: {
        originalPath?: string;
        fileResolutionPath?: string;
    });
    start(): Promise<void>;
    /**
     * Schedule a debounced approval-change event emission
     * Coalesces rapid changes to prevent event flooding
     */
    private scheduleApprovalChangeEmit;
    stop(): Promise<void>;
    /**
     * Candidate resolution order for relative approval file paths:
     * 1) Workspace/worktree base (fileResolutionPath)
     * 2) Shared workflow root (projectPath)
     */
    private getFilePathCandidates;
    private resolveExistingFilePath;
    private resolveFilePathForWrite;
    createApproval(title: string, filePath: string, category: 'spec' | 'steering', categoryName: string, type?: 'document' | 'action', metadata?: Record<string, any>): Promise<string>;
    getApproval(id: string): Promise<ApprovalRequest | null>;
    private findApprovalPath;
    updateApproval(id: string, status: 'approved' | 'rejected' | 'needs-revision', response: string, annotations?: string, comments?: ApprovalComment[]): Promise<void>;
    /**
     * Revert an approval back to pending status, clearing response and timestamp
     * Used for undo operations after batch approvals/rejections
     */
    revertToPending(id: string): Promise<void>;
    createRevision(originalId: string, newContent: string, reason?: string): Promise<string>;
    getAllPendingApprovals(): Promise<ApprovalRequest[]>;
    getAllApprovals(): Promise<ApprovalRequest[]>;
    deleteApproval(id: string): Promise<boolean>;
    cleanupOldApprovals(maxAgeDays?: number): Promise<void>;
    captureSnapshot(approvalId: string, trigger: 'initial' | 'revision_requested' | 'approved' | 'manual'): Promise<void>;
    getSnapshots(approvalId: string): Promise<DocumentSnapshot[]>;
    getSnapshot(approvalId: string, version: number): Promise<DocumentSnapshot | null>;
    getCurrentFileContent(approvalId: string): Promise<string | null>;
    compareSnapshots(approvalId: string, fromVersion: number, toVersion: number | 'current'): Promise<DiffResult>;
    private generateSnapshotId;
    private generateId;
}
//# sourceMappingURL=approval-storage.d.ts.map