import { PgAdapterAsync } from "./remote-storage.js";
export declare const STORAGE_TABLES: readonly ["secrets", "vault_items", "audit_log", "users", "feedback"];
export declare const SECRETS_STORAGE_TABLES: readonly ["secrets", "vault_items", "audit_log", "users", "feedback"];
export declare const SECRETS_STORAGE_ENV: {
    readonly databaseUrl: "HASNA_SECRETS_DATABASE_URL";
    readonly mode: "HASNA_SECRETS_STORAGE_MODE";
};
export declare const SECRETS_STORAGE_FALLBACK_ENV: {
    readonly databaseUrl: "SECRETS_DATABASE_URL";
    readonly mode: "SECRETS_STORAGE_MODE";
};
type StorageTable = (typeof STORAGE_TABLES)[number];
export type StorageMode = "local" | "remote" | "hybrid";
export interface StorageSyncResult {
    table: string;
    rowsRead: number;
    rowsWritten: number;
    errors: string[];
}
export interface StorageSyncMeta {
    table_name: string;
    last_synced_at: string | null;
    direction: "push" | "pull";
}
export type SyncResult = StorageSyncResult;
export type SyncMeta = StorageSyncMeta;
export declare const STORAGE_DATABASE_ENV: readonly ["HASNA_SECRETS_DATABASE_URL", "SECRETS_DATABASE_URL"];
export declare const STORAGE_MODE_ENV: readonly ["HASNA_SECRETS_STORAGE_MODE", "SECRETS_STORAGE_MODE"];
export declare const CANONICAL_SECRETS_RDS_CLUSTER = "hasna-xyz-infra-apps-prod-postgres";
export declare const CANONICAL_SECRETS_RDS_DATABASE = "secrets";
export declare const CANONICAL_SECRETS_RDS_SECRET_PATH = "hasna/xyz/opensource/secrets/prod/rds";
export interface CanonicalSecretsRdsConfig {
    cluster: typeof CANONICAL_SECRETS_RDS_CLUSTER;
    database: typeof CANONICAL_SECRETS_RDS_DATABASE;
    runtimeSecretPath: typeof CANONICAL_SECRETS_RDS_SECRET_PATH;
    primaryEnv: typeof SECRETS_STORAGE_ENV.databaseUrl;
    fallbackEnv: typeof SECRETS_STORAGE_FALLBACK_ENV.databaseUrl;
}
export declare function getCanonicalSecretsRdsConfig(): CanonicalSecretsRdsConfig;
export interface StorageEnv {
    name: string;
    deprecated: boolean;
}
export interface StorageEnvStatus {
    name: string;
    active_name: string;
    configured: boolean;
}
export interface NativeStorageStatus {
    ok: boolean;
    service: "secrets";
    mode: StorageMode;
    local_default: boolean;
    remote_enabled: boolean;
    database: {
        configured: boolean;
        redacted_url: string | null;
    };
    canonical: CanonicalSecretsRdsConfig;
    tables: readonly StorageTable[];
    env: {
        databaseUrl: StorageEnvStatus;
        mode: StorageEnvStatus;
    };
    issues: string[];
    warnings: string[];
    no_network: true;
}
export declare function getStorageDatabaseEnv(): StorageEnv | null;
export declare function getStorageDatabaseEnvName(): string;
export declare function getStorageDatabaseUrl(): string | null;
export declare function getStorageMode(): StorageMode;
export declare function getStoragePg(): Promise<PgAdapterAsync>;
export declare function runStorageMigrations(remote: PgAdapterAsync): Promise<void>;
export declare function storagePush(options?: {
    tables?: string[];
}): Promise<StorageSyncResult[]>;
export declare function storagePull(options?: {
    tables?: string[];
}): Promise<StorageSyncResult[]>;
export declare function storageSync(options?: {
    tables?: string[];
}): Promise<{
    push: StorageSyncResult[];
    pull: StorageSyncResult[];
}>;
export declare function getStorageSyncMetaAll(): StorageSyncMeta[];
export declare function getSyncMetaAll(): StorageSyncMeta[];
export declare function resolveTables(tables?: string[]): StorageTable[];
export declare function getStorageStatus(): NativeStorageStatus;
export declare const getSecretsStorageStatus: typeof getStorageStatus;
export {};
//# sourceMappingURL=storage-sync.d.ts.map