View as Markdown

API reference: @salmonui/inputs/file-upload

FilePreloadtype

import type { FilePreload } from '@salmonui/inputs/file-upload';
type FilePreload = Partial<FileEntry> & {
    readonly name: string;
    readonly size: number;
};

A preloaded entry (defaultFiles / files): status defaults to 'uploaded'.

FilePreload members (11, 11 inherited)
NameSignatureDescription
idoptionalinheritedid?: string;
nameinheritedname: string;
sizeinheritedsize: number;
typeoptionalinheritedtype?: string;
fileoptionalinheritedfile?: File | null;

The picked or dropped file; null for preloaded entries.

pathoptionalinheritedpath?: string;

Folder-relative path for directory picks and drops, else the name.

statusoptionalinheritedstatus?: FileStatus;
progressoptionalinheritedprogress?: number;

0..1 while uploading, 1 when uploaded.

erroroptionalinheritederror?: FileErrorCode | null;
reasonoptionalinheritedreason?: unknown;

The transport's rejection reason (status error, or error remove).

resultoptionalinheritedresult?: unknown;

The transport's resolved value (status uploaded).