bigblocks
Version:
Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React
36 lines • 1.68 kB
TypeScript
import type { BapMasterBackup, BapMemberBackup, DecryptedBackup, OneSatBackup, WifBackup } from "bitcoin-backup";
import type { BackupTypeName } from "./types.js";
/**
* Detects the type of a backup object based on its structure
* Uses the same logic as bitcoin-backup's internal validation
*/
export declare function detectBackupType(backup: unknown): BackupTypeName | null;
/**
* Type guards using bitcoin-backup types
*/
export declare function isBapMasterBackup(backup: DecryptedBackup): backup is BapMasterBackup;
export declare function isBapMemberBackup(backup: DecryptedBackup): backup is BapMemberBackup;
export declare function isOneSatBackup(backup: DecryptedBackup): backup is OneSatBackup;
export declare function isWifBackup(backup: DecryptedBackup): backup is WifBackup;
/**
* Validates if a backup type is allowed based on configuration
*/
export declare function isBackupTypeAllowed(backupType: BackupTypeName | null, allowedTypes: BackupTypeName[]): boolean;
/**
* Default backup type configuration
* Excludes BapMasterBackup by default as requested
*/
export declare const DEFAULT_ALLOWED_BACKUP_TYPES: BackupTypeName[];
/**
* Gets user-friendly name for backup type
*/
export declare function getBackupTypeDisplayName(backupType: BackupTypeName): string;
/**
* Gets description for backup type
*/
export declare function getBackupTypeDescription(backupType: BackupTypeName): string;
/**
* Creates an error message for unsupported backup types
*/
export declare function createUnsupportedBackupError(detectedType: BackupTypeName | null, allowedTypes: BackupTypeName[], customMessage?: string): string;
//# sourceMappingURL=backup-utils.d.ts.map