t×tecexpressby TeKOcloud
DEv0.7.1
API & types / VUE

TxUploadAdapter.

Asynchronous callback uploading one file; its result reaches the success callback and errors reach error handling.

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)