RiValT_TimerBackup
struct RiValT_TimerBackup : Codable
The file format for a portable snapshot of the timer setup.
-
Failures specific to validating or restoring a timer backup.
See moreDeclaration
Swift
enum BackupError : Error -
App-wide behavior preferences saved alongside the timer groups.
See moreDeclaration
Swift
struct Preferences : Codable, Equatable -
The version field read before decoding the version-specific payload.
See moreDeclaration
Swift
private struct Header : Decodable -
The portable representation of a timer group and its presentation settings.
See moreDeclaration
Swift
private struct Group : Codable -
A timer’s configured durations without its runtime countdown state.
See moreDeclaration
Swift
private struct Preset : Codable -
The identifier registered for timer backup documents.
Declaration
Swift
static let typeIdentifier: String -
The filename extension for exported backup files.
Declaration
Swift
static let fileExtension: String -
The schema version written and accepted by this build.
Declaration
Swift
private static let currentVersion: Int -
The schema version stored in this backup.
Declaration
Swift
private let version: Int -
The date and time the backup was created.
Declaration
Swift
let exportedAt: Date -
The app-wide behavior preferences recorded at export.
Declaration
Swift
let preferences: Preferences -
The selected preset’s identifier, if a timer was selected.
Declaration
Swift
private let selectedTimerID: UUID? -
The backed-up groups in their original order.
Declaration
Swift
private let groups: [Group] -
The number of timer groups in the backup.
Declaration
Swift
var groupCount: Int { get } -
The total number of presets across all groups.
Declaration
Swift
var timerCount: Int { get } -
Captures the ordered timer groups and selection along with the supplied preferences.
Declaration
Swift
init(model: TimerModel, preferences: Preferences) -
Validates the backup and encodes it as legible JSON with ISO 8601 dates.
Declaration
Swift
func encoded() throws -> Data -
Reads the schema version first, then decodes and validates the backup.
Declaration
Swift
static func decode(_ data: Data) throws -> RiValT_TimerBackup -
Converts the groups and presets to the app’s persisted timer model format.
Declaration
Swift
var persistentTimerModel: [[[String : any Hashable]]] { get } -
Rejects invalid groups, duplicate IDs, and a selected timer ID that is absent from the backup.
Declaration
Swift
private func validate() throws
View on GitHub
Install in Dash