export declare const ENTERPRISE_MIGRATION_PHASE_ENV = "SMARTPERFETTO_ENTERPRISE_MIGRATION_PHASE";
export declare const ENTERPRISE_MIGRATION_SNAPSHOT_DIR_ENV = "SMARTPERFETTO_ENTERPRISE_MIGRATION_SNAPSHOT_DIR";
export type EnterpriseMigrationPhase = 'legacy' | 'dual-write' | 'cutover' | 'retired';
export type EnterpriseReadAuthority = 'filesystem' | 'db';
export interface EnterpriseMigrationPlan {
    enterpriseEnabled: boolean;
    phase: EnterpriseMigrationPhase;
    readAuthority: EnterpriseReadAuthority;
    writeFilesystem: boolean;
    writeDb: boolean;
    legacyReadOnly: boolean;
    rollback: 'disable-enterprise' | 'delete-db' | 'return-to-dual-write' | 'restore-snapshots';
}
export interface MigrationFilesystemFingerprint {
    label: string;
    path: string;
    exists: boolean;
    kind: 'file' | 'directory';
    fileCount: number;
    totalBytes: number;
    sha256: string | null;
    failures: string[];
}
export interface MigrationDatabaseFingerprint {
    path: string;
    exists: boolean;
    totalRows: number;
    tableCounts: Record<string, number>;
    sha256: string | null;
    failures: string[];
}
export interface EnterpriseMigrationDryRunReport {
    generatedAt: string;
    phase: EnterpriseMigrationPhase;
    plan: EnterpriseMigrationPlan;
    filesystem: MigrationFilesystemFingerprint[];
    database: MigrationDatabaseFingerprint;
    failures: string[];
    fingerprint: string;
}
export interface EnterpriseMigrationSnapshotOptions {
    env?: NodeJS.ProcessEnv;
    now?: Date;
    snapshotRoot?: string;
    snapshotId?: string;
}
export interface EnterpriseMigrationSnapshotManifest extends EnterpriseMigrationDryRunReport {
    snapshotId: string;
    snapshotDir: string;
    filesystemSnapshots: Array<{
        label: string;
        sourcePath: string;
        snapshotPath: string;
        kind: 'file' | 'directory';
        copied: boolean;
    }>;
    databaseSnapshot: {
        sourcePath: string;
        snapshotPath: string;
        copied: boolean;
    };
}
export interface EnterpriseMigrationRestoreResult {
    snapshotId: string;
    restoredAt: string;
    restoredFilesystem: Array<{
        label: string;
        targetPath: string;
        restored: boolean;
    }>;
    restoredDatabase: {
        targetPath: string;
        restored: boolean;
    };
}
export declare function resolveEnterpriseMigrationPlan(env?: NodeJS.ProcessEnv): EnterpriseMigrationPlan;
export declare function enterpriseDbReadAuthorityEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function enterpriseDbWritesEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function legacyFilesystemReadAuthorityEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function legacyFilesystemWritesEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function buildEnterpriseMigrationDryRun(options?: EnterpriseMigrationSnapshotOptions): EnterpriseMigrationDryRunReport;
export declare function createEnterpriseMigrationSnapshot(options?: EnterpriseMigrationSnapshotOptions): Promise<EnterpriseMigrationSnapshotManifest>;
export declare function restoreEnterpriseMigrationSnapshot(snapshotDir: string, options?: {
    env?: NodeJS.ProcessEnv;
    now?: Date;
}): Promise<EnterpriseMigrationRestoreResult>;
export declare function describeEnterpriseMigrationRollback(env?: NodeJS.ProcessEnv): string;
export declare const ENTERPRISE_MIGRATION_ENV_KEYS: readonly ["SMARTPERFETTO_ENTERPRISE", "SMARTPERFETTO_ENTERPRISE_MIGRATION_PHASE", "SMARTPERFETTO_ENTERPRISE_MIGRATION_SNAPSHOT_DIR", "SMARTPERFETTO_ENTERPRISE_DB_PATH", "SMARTPERFETTO_DATA_DIR", "SMARTPERFETTO_LOGS_DIR", "PROVIDER_DATA_DIR_OVERRIDE", "UPLOAD_DIR"];
//# sourceMappingURL=enterpriseMigration.d.ts.map