OpenFilePickerEventSchema

@Serializable
@SerialName(value = "OpenFilePicker")
data class OpenFilePickerEventSchema(val id: String, val trigger: EventTrigger, val events: SerializableImmutableList<EventSchema>?, val fileType: OpenFilePickerEventSchema.FileType, val pickMode: OpenFilePickerEventSchema.PickMode, val outputType: FileOutputType = FileOutputType.PlatformFile) : EventSchema

Opens the platform file picker and emits the chosen file downstream.

fileType restricts what can be picked: images, videos, both, or arbitrary files narrowed by a list of extensions. pickMode currently only offers Single.

outputType decides the shape handed to the next events:

  • PlatformFile (default) — the platform file handle.

  • ArrayOfBytes — the file read into a ByteArray.

  • FlowOfBytes — a streaming flow of chunks, for large files.

  • MapObject — the bytes decoded as a JSON map.

  • Base64 — the bytes encoded as a Base64 String.

incomingData consumed: not used.

Triggers fired:

  • OnSuccessEventTrigger — when a file was picked and read; the content, in the shape chosen by outputType, is passed as incomingData.

  • OnCancelledEventTrigger — when the user dismisses the picker without choosing a file. No data is passed downstream.

  • OnFailureEventTrigger — when MapObject decoding fails, or when the picker throws; the Throwable is passed as incomingData.

Constructors

Link copied to clipboard
constructor(id: String, trigger: EventTrigger, events: SerializableImmutableList<EventSchema>?, fileType: OpenFilePickerEventSchema.FileType, pickMode: OpenFilePickerEventSchema.PickMode, outputType: FileOutputType = FileOutputType.PlatformFile)

Types

Link copied to clipboard
@Serializable
sealed interface FileType
Link copied to clipboard
@Serializable
sealed interface PickMode

Properties

Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?

This event's own children — each declaring, via its own trigger, which of this event's outgoing triggers runs it. null when this event declares no children.

Link copied to clipboard
@SerialName(value = "fileType")
val fileType: OpenFilePickerEventSchema.FileType
Link copied to clipboard
@SerialName(value = "id")
open override val id: String

Unique identifier — how TriggerEvent/UpdateEvents address this event by id. Defaults to a random id when omitted from the DSL.

Link copied to clipboard
@SerialName(value = "outputType")
val outputType: FileOutputType
Link copied to clipboard
@SerialName(value = "pickMode")
val pickMode: OpenFilePickerEventSchema.PickMode
Link copied to clipboard
@SerialName(value = "trigger")
open override val trigger: EventTrigger

The condition that must occur for this event to run — matched by structural equality (data class/data object equality) against whatever trigger value fired, never by any kind of subscription or listener registry.