Content.PickSelected
luastra/contentContent.PickSelected is an exported, statically checked data contract of luastra/content. Its exact declaration documents the fields or alternatives accepted at the module boundary and is erased after Luau analysis.
Before you use it
Add luastra/content to this module's dependencies in luastra.json, then import it with require("luastra/content"). Declare content.pick for browser selection and content.upload for transfer. Upload requires a server-created intent from an authenticated declared backend function. Application code must never construct a provider URL, file path, data URL, blob URL, bucket path, or upload handle.
How it fits
Content types describe checked ephemeral image references and asynchronous selection/upload results; they are erased after Luau analysis.
When to use it
Use Content.PickSelected when annotating values that cross the public luastra/content boundary or when exporting helpers built on that module. The type documents the exact checked shape and prevents unrelated tables from being substituted accidentally.
Fields or definition
| Parameter | Type / values | Description |
|---|---|---|
| status | "selected" | Checked status field of Content.PickSelected; its exact admitted type is "selected". |
| image | Image | Checked image field of Content.PickSelected; its exact admitted type is Image. |
What happens next
A type-safe dynamic image, selection, transfer, or progress annotation.
Failures and fixes
Cancellation, malformed or expired handles, unsupported media types, excessive bytes or dimensions, offline transfer, authorization denial, and decode failure remain explicit branches. Release previews, request fresh display grants after UI.Image.onError, and never persist or log upload/content handles.
Availability
Private source foundation after 0.5.0-alpha; browser PNG/JPEG selection and upload are automated, while camera and native picker certification remain later evidence gates.
Exact declaration
export type PickSelected = { status: "selected", image: Image }