Package-level declarations
WidgetBridge publishes a @Serializable payload plus WidgetAssets as an atomic generation and reads it back as a ResolvedFeed. Platform wiring: androidWidgetBridge / iosWidgetBridge. Helpers: WidgetImages and AssetBudget for images, WidgetRotation for hourly rotation shared with the Swift package. The Swift reader lives in Sources/WidgetBridge.
WidgetBridge publishes a @Serializable payload plus WidgetAssets as an atomic generation and reads it back as a ResolvedFeed. Platform wiring: androidWidgetBridge / iosWidgetBridge. Helpers: WidgetImages and AssetBudget for images, WidgetRotation for hourly rotation shared with the Swift package. The Swift reader lives in Sources/WidgetBridge.
WidgetBridge publishes a @Serializable payload plus WidgetAssets as an atomic generation and reads it back as a ResolvedFeed. Platform wiring: androidWidgetBridge / iosWidgetBridge. Helpers: WidgetImages and AssetBudget for images, WidgetRotation for hourly rotation shared with the Swift package. The Swift reader lives in Sources/WidgetBridge.
Types
Generation folders under root; every promote and pointer write is an atomic rename.
Broadcasts ACTION_APPWIDGET_UPDATE to receiverClass for every placed widget. No Glance dependency.
Greedy packer: encodes AssetCandidates in order until budgetBytes is spent; failures are skipped.
Generation folders inside the App Group container so the widget extension can read them.
The generation a reader resolved: current, or the newest readable fallback.
An image (or any file) shipped inside a generation under assets/. fileName must satisfy isSafeName.
Publishes a typed payload plus assets as an atomic generation and reads it back. Construct through androidWidgetBridge / iosWidgetBridge, or directly with a custom storage.
Platform filesystem operations for the generation-versioned export. Implement it yourself for a custom location; the defaults are AndroidWidgetFeedStorage and IosWidgetFeedStorage.
One exported generation as found on disk.
Downsamples an image file for a widget. PNG keeps transparency (cutouts); JPEG for photos.
Tells the OS that a new generation is current so widgets redraw. Platform defaults exist; None for tests.
Deterministic hourly rotation shared by Kotlin and Swift readers so both platforms show the same item.
Properties
Functions
Default Android wiring: files-dir storage plus an app-widget update broadcast to receiverClass.
Default iOS wiring: App Group storage plus a NotificationCenter post. Requires WidgetBridgeConfig.iosAppGroup.
Letters, digits, -, _, .; never blank. Rejects path separators and traversal by construction.