import type { BackupData, ICloudConfig } from '@dynamic-labs-wallet/core';
import type * as CloudKitTypes from 'tsl-apple-cloudkit';
export type SavedRecord = CloudKitTypes.RecordReceived;
export type ICloudBackupRecord = {
    recordName: string;
    created: number;
    modified: number;
    backupData: BackupData;
};
export type ICloudAuthOptions = {
    pollIntervalMs?: number;
    timeoutMs?: number;
    signal?: AbortSignal;
};
export declare const loadCloudKit: () => Promise<void>;
export declare const configureCloudKit: (config?: ICloudConfig, signInButtonId?: string) => void;
export declare const resetCloudKitConfig: () => void;
/**
 * Ensures CloudKit is loaded and configured without requiring the auth flow.
 * Used for checking authentication status before showing sign-in UI.
 */
export declare const ensureCloudKitInitialized: (config?: ICloudConfig) => Promise<boolean>;
/**
 * Check if user is already authenticated using fetchCurrentUserIdentity.
 * This is more reliable than setUpAuth which sometimes returns undefined
 * even when the user has an existing session.
 */
export declare const isUserAuthenticated: (container: CloudKitTypes.Container) => Promise<boolean>;
/**
 * Check if the user is authenticated with iCloud using the default container.
 * Returns false if CloudKit is not configured or user is not authenticated.
 * Optionally accepts config to auto-initialize CloudKit before checking.
 */
export declare const isICloudAuthenticated: (config?: ICloudConfig) => Promise<boolean>;
/**
 * Cancel any ongoing authentication attempt
 */
export declare const cancelICloudAuth: () => void;
export declare const ensureICloudAuth: (onSignInRequired?: () => void, onSignInComplete?: () => void, onAuthStatusUpdate?: (status: string) => void, options?: ICloudAuthOptions) => Promise<void>;
/**
 * Save backup data to iCloud with retry logic
 * Optionally accepts config to auto-initialize CloudKit before saving.
 */
export declare const saveBackupToICloud: (backupData: unknown, retryOptions?: {
    maxAttempts?: number;
    retryInterval?: number;
}, config?: ICloudConfig) => Promise<SavedRecord>;
/**
 * List all backups from iCloud
 * Optionally accepts config to auto-initialize CloudKit before listing.
 */
export declare const listICloudBackups: (config?: ICloudConfig) => Promise<ICloudBackupRecord[]>;
/**
 * Retrieve a specific backup from iCloud by record name
 * Optionally accepts config to auto-initialize CloudKit before fetching.
 */
export declare const getICloudBackup: (recordName: string, config?: ICloudConfig) => Promise<ICloudBackupRecord | null>;
/**
 * Delete a backup from iCloud
 * Optionally accepts config to auto-initialize CloudKit before deleting.
 */
export declare const deleteICloudBackup: (recordName: string, config?: ICloudConfig) => Promise<void>;
export declare const initializeCloudKit: (config?: ICloudConfig, signInButtonId?: string, onSignInRequired?: () => void, onSignInComplete?: () => void, onAuthStatusUpdate?: (status: string) => void, authOptions?: ICloudAuthOptions) => Promise<void>;
//# sourceMappingURL=iCloud.d.ts.map