Package-level declarations

Functions

Link copied to clipboard

Reads the whole file into memory and delivers it as a ByteArray.

Link copied to clipboard

Reads the whole file into memory and delivers it as a base64-encoded String.

Link copied to clipboard
fun EventSchemaBuilderScope.DeleteFile(id: String = randomId(), trigger: EventTrigger, fileName: String, events: EventSchemaBuilderScope.() -> Unit = {})

Deletes the file stored under fileName in the client's own file storage. Does not consume incomingData. Dispatches onSuccess (no data) when the deletion completed; onFailure (carrying the Throwable, logged) when it failed.

Link copied to clipboard

Allows the user to pick files matching the given MIME types or extensions.

Link copied to clipboard

Delivers a chunked Flow<ByteArray>, without ever holding the full file in memory.

Link copied to clipboard
fun EventSchemaBuilderScope.GetFile(id: String = randomId(), trigger: EventTrigger, events: EventSchemaBuilderScope.() -> Unit = {}, fileName: String, outputType: FileOutputType = arrayOfBytes())

Reads the file stored under fileName from the client's own file storage and emits its content downstream, shaped by outputType. Does not consume incomingData. Dispatches onSuccess (carrying the content, shaped by outputType) when the file was read; onFailure (carrying the Throwable, logged) when the read failed, no file exists under fileName, or mapObject() decoding fails.

Link copied to clipboard

Allows the user to pick images or videos.

Link copied to clipboard

Allows the user to pick image files only.

Link copied to clipboard

Reads the file, decodes it as JSON, and delivers it as Map<String, AnySerializable?>.

Link copied to clipboard
fun EventSchemaBuilderScope.OpenFilePicker(id: String = randomId(), trigger: EventTrigger, fileType: OpenFilePickerEventSchema.FileType, pickMode: OpenFilePickerEventSchema.PickMode = singlePickMode(), events: EventSchemaBuilderScope.() -> Unit = {}, outputType: FileOutputType = platformFile())

Opens the platform file picker and emits the chosen file downstream, shaped by outputType. fileType restricts what can be picked; pickMode currently only offers a single selection. Does not consume incomingData. Dispatches onSuccess (carrying the content, shaped by outputType) when a file was picked and read; onCancelled (no data) when the user dismisses the picker without choosing a file; onFailure (carrying the thrown exception) when mapObject() decoding fails or the picker itself throws.

Link copied to clipboard

Delivers a reference to the file (PlatformFile) without reading its contents.

Link copied to clipboard
fun EventSchemaBuilderScope.SaveFile(id: String = randomId(), trigger: EventTrigger, events: EventSchemaBuilderScope.() -> Unit = {}, fileName: String, overrideIfExists: Boolean)

Writes incomingData — required, and must be a ByteArray — to fileName in the client's own file storage. When overrideIfExists is false, the runner first checks fileName and refuses to write if something is already there. Dispatches onSuccess (no data) when the file was written; onFailure (carrying the thrown exception, logged) when incomingData is missing or not a ByteArray, when overrideIfExists is false and the file already exists, or when the write itself fails.

Link copied to clipboard

The user can select a single file.

Link copied to clipboard

Allows the user to pick video files only.