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).
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>
}| Field | Meaning |
|---|---|
| list | Returns entries in the parent directory; null reads the root. |
| createDirectory | Creates a directory with a valid name unique within its parent. |
| rename | Renames a file or directory; preserves its ID and parent. |
| copy | Recursively copies an entry to the target directory, assigning new IDs. |
| move | Moves an entry to the target directory; cycles are rejected. |
| remove | Removes the record or recursively removes a file/directory tree. |
| upload | Uploads a file to the specified directory and returns its new entry. |
| download | Returns file contents; downloading a directory fails. |
import type { TxFileProvider } from '@tekocloud.de/tecexpress'
const example: TxFileProvider = { list: async () => [] }
console.log(example)