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

TxFileProvider.

Asynchronous contract for directory listings and file operations.

list is required. Vue offers optional methods; Dart implementations declare capabilities and override matching methods. Unimplemented Dart operations throw UnsupportedError. list/upload support cooperative cancellation. createDirectory/upload return an entry; rename/copy/move/remove return no value; download returns Blob (Vue) or Uint8List (Dart).

ts
interface TxFileProvider {
  list(parentId: string | null, signal?: AbortSignal): Promise<TxFileEntry[]>
  createDirectory?(parentId: string | null, name: string): Promise<TxFileEntry>
  rename?(id: string, name: string): Promise<void>
  copy?(id: string, target: string | null): Promise<void>
  move?(id: string, target: string | null): Promise<void>
  remove?(id: string): Promise<void>
  upload?(
    parentId: string | null,
    file: File,
    signal?: AbortSignal,
  ): Promise<TxFileEntry>
  download?(id: string): Promise<Blob>
}
FieldMeaning
listReturns entries in the parent directory; null reads the root.
createDirectoryCreates a directory with a valid name unique within its parent.
renameRenames a file or directory; preserves its ID and parent.
copyRecursively copies an entry to the target directory, assigning new IDs.
moveMoves an entry to the target directory; cycles are rejected.
removeRemoves the record or recursively removes a file/directory tree.
uploadUploads a file to the specified directory and returns its new entry.
downloadReturns file contents; downloading a directory fails.
ts
import type { TxFileProvider } from '@tekocloud.de/tecexpress'
const example: TxFileProvider = { list: async () => [] }
console.log(example)