SettingsBackupManager

class SettingsBackupManager<T>(dataStore: DataStore<Preferences>, schema: SettingsSchema<T>, appId: String, schemaVersion: Int, deviceInfoProvider: () -> DeviceInfo? = null)

Constructors

Link copied to clipboard
constructor(dataStore: DataStore<Preferences>, schema: SettingsSchema<T>, appId: String, schemaVersion: Int, deviceInfoProvider: () -> DeviceInfo? = null)

Functions

Link copied to clipboard
suspend fun export(): ExportResult

Export all settings from DataStore. Reads raw preferences to avoid serialization issues with complex types.

Link copied to clipboard
suspend fun exportFields(fieldNames: Collection<String>): ExportResult

Export settings for specific fields only.

Link copied to clipboard
suspend fun import(jsonString: String, options: ImportOptions = ImportOptions()): ImportResult

Import settings from a JSON backup.

Link copied to clipboard
fun validate(jsonString: String): ValidationResult

Validate a backup without importing.