UNPKG

@ledgerhq/live-common

Version:
85 lines 3.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteAppDataError = exports.DeleteAppDataEventType = exports.RestoreAppDataError = exports.RestoreAppDataEventType = exports.BackupAppDataError = exports.BackupAppDataEventType = exports.isAppStorageType = void 0; const device_core_1 = require("@ledgerhq/device-core"); const errors_1 = require("@ledgerhq/errors"); function isAppStorageType(data) { return (typeof data === "object" && data !== null && "appDataInfo" in data && (0, device_core_1.isAppStorageInfo)(data.appDataInfo) && "appData" in data && typeof data.appData === "string"); } exports.isAppStorageType = isAppStorageType; var BackupAppDataEventType; (function (BackupAppDataEventType) { /** * The progress of the ongoing backup process. */ BackupAppDataEventType["Progress"] = "progress"; /** * The application data information has been fetched. */ BackupAppDataEventType["AppDataInfoFetched"] = "appDataInfoFetched"; /** * The application data has been backed up. */ BackupAppDataEventType["AppDataBackedUp"] = "appDataBackedUp"; /** * The application data has already been backed up, no need to backup again. */ BackupAppDataEventType["AppDataAlreadyBackedUp"] = "appDataAlreadyBackedUp"; /** * There is no application data to backup. */ BackupAppDataEventType["NoAppDataToBackup"] = "noAppDataToBackup"; })(BackupAppDataEventType || (exports.BackupAppDataEventType = BackupAppDataEventType = {})); /** * An error that occurs during the backup process, the error message should be descriptive when thrown. */ exports.BackupAppDataError = (0, errors_1.createCustomErrorClass)("BackupAppDataError"); var RestoreAppDataEventType; (function (RestoreAppDataEventType) { /** * The progress of the ongoing restoring process. */ RestoreAppDataEventType["Progress"] = "progress"; /** * The application data is initialized for the restore process. */ RestoreAppDataEventType["AppDataInitialized"] = "appDataInitialized"; /** * The application data has been restored. */ RestoreAppDataEventType["AppDataRestored"] = "appDataRestored"; /** * There is no application data to restore. */ RestoreAppDataEventType["NoAppDataToRestore"] = "noAppDataToRestore"; /** * The user refused to restore the application data. */ RestoreAppDataEventType["UserRefused"] = "userRefused"; })(RestoreAppDataEventType || (exports.RestoreAppDataEventType = RestoreAppDataEventType = {})); /** * An error that occurs during the restore process, the error message should be descriptive when thrown. */ exports.RestoreAppDataError = (0, errors_1.createCustomErrorClass)("RestoreAppDataError"); var DeleteAppDataEventType; (function (DeleteAppDataEventType) { DeleteAppDataEventType["AppDataDeleteStarted"] = "appDataDeleteStarted"; /** * The application data has been deleted. */ DeleteAppDataEventType["AppDataDeleted"] = "appDataDeleted"; /** * There is no application data to delete. */ DeleteAppDataEventType["NoAppDataToDelete"] = "noAppDataToDelete"; })(DeleteAppDataEventType || (exports.DeleteAppDataEventType = DeleteAppDataEventType = {})); /** * An error that occurs during the delete process (local data), the error message should be descriptive when thrown. */ exports.DeleteAppDataError = (0, errors_1.createCustomErrorClass)("DeleteAppDataError"); //# sourceMappingURL=types.js.map