t×tecexpressby TeKOcloud
ENv0.7.1
API & Datentypen / VUE

TxUploadAdapter.

Asynchroner Callback für den Upload einer Datei; Ergebnis geht an den Erfolgs-Callback, Fehler an die Fehlerbehandlung.

ts
type TxUploadAdapter = (
  file: File,
  context: TxUploadContext,
) => Promise<unknown>
ts
import type { TxUploadAdapter } from '@tekocloud.de/tecexpress'
const example: TxUploadAdapter = async (file, context) => { context.signal.throwIfAborted(); context.onProgress(file.size, file.size); return file.name }
console.log(example)