import { ComponentStudioStateService } from './component-studio-state.service';
import * as i0 from "@angular/core";
/**
 * Represents a single entry in the version history for a component artifact.
 */
export interface VersionHistoryEntry {
    ID: string;
    VersionNumber: number;
    Timestamp: Date;
    Comment: string;
    AuthorName?: string;
}
/**
 * Service that handles explicit, user-triggered versioning for Component Studio.
 * Follows a git-commit style model where each save creates a new immutable version.
 */
export declare class ComponentVersionService {
    private stateService;
    private _currentArtifactID;
    private _currentVersionNumber;
    private _versionHistory;
    private _componentArtifactTypeID;
    private _cachedConversationID;
    private metadata;
    get CurrentArtifactID(): string | null;
    set CurrentArtifactID(value: string | null);
    get CurrentVersionNumber(): number;
    get VersionHistory(): VersionHistoryEntry[];
    constructor(stateService: ComponentStudioStateService);
    /**
     * Save current working state as a new version.
     * Creates the ConversationArtifact if one does not yet exist for this component.
     * @param comment - optional user comment describing the version
     * @returns true if the version was saved successfully
     */
    SaveVersion(comment?: string): Promise<boolean>;
    /**
     * Update the current (latest) version in place instead of creating a new one.
     * @param comment - optional updated comment
     * @returns true if the version was updated successfully
     */
    UpdateCurrentVersion(comment?: string): Promise<boolean>;
    /**
     * Load all versions for a given artifact, ordered by version number descending.
     * @param artifactId - the ConversationArtifact ID to load history for
     * @returns array of version history entries, newest first
     */
    LoadVersionHistory(artifactId: string): Promise<VersionHistoryEntry[]>;
    /**
     * Restore a previous version by creating a NEW version with the old content.
     * This preserves the full history chain rather than overwriting.
     * @param versionId - the ConversationArtifactVersion ID to restore
     * @returns true if the version was restored successfully
     */
    RestoreVersion(versionId: string): Promise<boolean>;
    /**
     * Load two versions and return their content for diffing.
     * @param versionId1 - the first version ID (typically the older one)
     * @param versionId2 - the second version ID (typically the newer one)
     * @returns an object with the before and after content strings
     */
    GetVersionDiff(versionId1: string, versionId2: string): Promise<{
        before: string;
        after: string;
    }>;
    /**
     * Reset the service state, typically when switching components.
     */
    Reset(): void;
    /**
     * Ensures a ConversationArtifact record exists for the current component.
     * If CurrentArtifactID is already set, returns that. Otherwise creates a new one.
     */
    private ensureArtifactExists;
    /**
     * Creates a new ConversationArtifact for the given component spec.
     */
    private createArtifact;
    /**
     * Looks up the artifact type ID for "Component" from MJ: Artifact Types.
     * Caches the result to avoid repeated lookups.
     */
    private resolveComponentArtifactTypeID;
    /**
     * Resolves or creates a Conversation record for Component Studio artifacts.
     * Caches the result for subsequent saves within the same session.
     */
    private resolveConversationID;
    /**
     * Determines the next version number for the given artifact.
     */
    private resolveNextVersionNumber;
    /**
     * Creates and saves a new ConversationArtifactVersion record.
     */
    private createVersion;
    /**
     * Loads a single ConversationArtifactVersion entity by ID.
     */
    private loadVersionEntity;
    /**
     * Finds the latest version entity for the given artifact.
     */
    private findLatestVersionEntity;
    /**
     * Parses the Content field of a version entity back into a ComponentSpec.
     */
    private parseVersionContent;
    /**
     * Fetches the full version history for an artifact, ordered newest-first.
     */
    private fetchVersionHistory;
    /**
     * Maps a MJConversationArtifactVersionEntity to a VersionHistoryEntry.
     */
    private mapVersionToHistoryEntry;
    static ɵfac: i0.ɵɵFactoryDeclaration<ComponentVersionService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ComponentVersionService>;
}
//# sourceMappingURL=component-version.service.d.ts.map