import { NicePresentationDocument } from '../types/presentationTypes';

/** Version entry in history. */
export interface PresentationVersion {
    /** Unique version ID. */
    versionId: string;
    /** Sequential version number. */
    versionNumber: number;
    /** Full presentation snapshot. */
    snapshot: NicePresentationDocument;
    /** Timestamp of save. */
    createdAt: string;
    /** User who made the change. */
    createdBy: VersionAuthor;
    /** Version label (optional). */
    label?: string;
    /** Description of changes. */
    description?: string;
    /** Tags for categorization. */
    tags?: string[];
    /** Is this an auto-save? */
    isAutoSave: boolean;
    /** Parent version ID (for branching). */
    parentVersionId?: string;
    /** Branch name (if branched). */
    branchName?: string;
    /** Calculated diff from previous version. */
    diff?: PresentationDiff;
}
/** Author information. */
export interface VersionAuthor {
    id: string;
    name: string;
    email?: string;
    avatarUrl?: string;
}
/** Diff between two versions. */
export interface PresentationDiff {
    /** Summary of changes. */
    summary: DiffSummary;
    /** Detailed slide changes. */
    slideChanges: SlideChange[];
    /** Metadata changes. */
    metadataChanges: MetadataChange[];
}
/** Summary of changes. */
export interface DiffSummary {
    slidesAdded: number;
    slidesRemoved: number;
    slidesModified: number;
    elementsAdded: number;
    elementsRemoved: number;
    elementsModified: number;
    totalChanges: number;
}
/** Change to a single slide. */
export interface SlideChange {
    slideId: string;
    slideIndex: number;
    changeType: 'added' | 'removed' | 'modified' | 'reordered';
    slideTitle?: string;
    /** Element-level changes for modified slides. */
    elementChanges?: ElementChange[];
    /** Previous index (for reordered). */
    previousIndex?: number;
}
/** Change to a single element. */
export interface ElementChange {
    elementId: string;
    elementType: string;
    changeType: 'added' | 'removed' | 'modified';
    propertyChanges?: PropertyChange[];
}
/** Property-level change. */
export interface PropertyChange {
    property: string;
    oldValue: unknown;
    newValue: unknown;
}
/** Metadata change. */
export interface MetadataChange {
    property: string;
    oldValue: unknown;
    newValue: unknown;
}
/** Version history configuration. */
export interface VersionHistoryConfig {
    /** Maximum versions to retain. */
    maxVersions?: number;
    /** Auto-save interval (ms). Set to 0 to disable. */
    autoSaveInterval?: number;
    /** Minimum time between auto-saves (ms). */
    autoSaveDebounce?: number;
    /** Keep all labeled versions regardless of maxVersions. */
    preserveLabeledVersions?: boolean;
    /** Enable branching. */
    enableBranching?: boolean;
    /** Current user for author info. */
    currentUser: VersionAuthor;
}
/** Branch information. */
export interface VersionBranch {
    name: string;
    headVersionId: string;
    createdAt: string;
    createdBy: VersionAuthor;
    description?: string;
}
/**
 * Manages presentation version history.
 */
export declare class PresentationVersionManager {
    private versions;
    private branches;
    private presentationId;
    private currentVersionId;
    private currentBranch;
    private config;
    private autoSaveTimer;
    private lastAutoSaveTime;
    private onChange?;
    constructor(presentationId: string, config: VersionHistoryConfig, onChange?: (version: PresentationVersion) => void);
    /**
     * Get all versions in order.
     */
    getVersionHistory(): PresentationVersion[];
    /**
     * Get a specific version.
     */
    getVersion(versionId: string): PresentationVersion | undefined;
    /**
     * Get current version.
     */
    getCurrentVersion(): PresentationVersion | undefined;
    /**
     * Save a new version.
     */
    saveVersion(presentation: NicePresentationDocument, options?: {
        label?: string;
        description?: string;
        tags?: string[];
        isAutoSave?: boolean;
    }): PresentationVersion;
    /**
     * Schedule auto-save.
     */
    scheduleAutoSave(presentation: NicePresentationDocument): void;
    /**
     * Cancel pending auto-save.
     */
    cancelAutoSave(): void;
    /**
     * Restore to a previous version.
     */
    restoreVersion(versionId: string): NicePresentationDocument | null;
    /**
     * Preview a version without restoring.
     */
    previewVersion(versionId: string): NicePresentationDocument | null;
    /**
     * Label a version (add or update label).
     */
    labelVersion(versionId: string, label: string): boolean;
    /**
     * Add tags to a version.
     */
    tagVersion(versionId: string, tags: string[]): boolean;
    /**
     * Create a branch from current version.
     */
    createBranch(branchName: string, description?: string): VersionBranch | null;
    /**
     * Switch to a branch.
     */
    switchBranch(branchName: string): boolean;
    /**
     * Get all branches.
     */
    getBranches(): VersionBranch[];
    /**
     * Get current branch name.
     */
    getCurrentBranch(): string;
    /**
     * Compare two versions.
     */
    compareVersions(versionIdA: string, versionIdB: string): PresentationDiff | null;
    /**
     * Calculate diff between two presentations.
     */
    private calculateDiff;
    /**
     * Calculate element-level changes between slides.
     */
    private calculateElementChanges;
    /**
     * Calculate property-level changes between elements.
     */
    private calculatePropertyChanges;
    /**
     * Get slide title for display.
     */
    private getSlideTitle;
    /**
     * Generate auto description from diff.
     */
    private generateAutoDescription;
    /**
     * Deep clone a presentation.
     */
    private clonePresentation;
    /**
     * Generate a unique version ID.
     */
    private generateVersionId;
    /**
     * Prune old versions to stay within limit.
     */
    private pruneVersions;
    /**
     * Export version history to JSON.
     */
    exportHistory(): string;
    /**
     * Import version history from JSON.
     */
    importHistory(json: string): void;
    /**
     * Cleanup resources.
     */
    dispose(): void;
}
export default PresentationVersionManager;
//# sourceMappingURL=versionHistory.d.ts.map