uploadv2 / types.ts
Twan07's picture
Upload 3 files
ca60b56 verified
raw
history blame
632 Bytes
export type RepoType = 'model' | 'dataset' | 'space';
export interface HFConfig {
token: string;
repo: string;
repoType: RepoType;
}
export enum UploadStatus {
IDLE = 'IDLE',
UPLOADING = 'UPLOADING',
SUCCESS = 'SUCCESS',
ERROR = 'ERROR',
}
export interface FileItem {
id: string;
file: File;
status: UploadStatus;
path: string; // Destination path in repo
error?: string;
url?: string; // URL to the file after upload
}
export interface RemoteFile {
path: string;
size: number;
url: string;
}
export type UploadCallback = (id: string, status: UploadStatus, error?: string, url?: string) => void;