Beignet API reference
    Preparing search index...

    Interface ReactUploadController<Upload>

    React hook controller for one Beignet upload workflow.

    interface ReactUploadController<Upload extends UploadDef> {
        accept: string | undefined;
        constraints: UploadFileConstraints | undefined;
        error: unknown;
        files: readonly ReactUploadFileState[];
        isError: boolean;
        isIdle: boolean;
        isPending: boolean;
        isSuccess: boolean;
        isUploading: boolean;
        progress: number;
        progressFraction: number;
        result: CompleteUploadResult<InferUploadResult<Upload>> | null;
        status: ReactUploadStatus;
        abort(): void;
        reset(): void;
        upload(
            options: ReactUploadStartOptions<Upload>,
        ): Promise<CompleteUploadResult<InferUploadResult<Upload>>>;
        uploadFile(
            file: File,
            options: ReactUploadFileStartOptions<Upload>,
        ): Promise<CompleteUploadResult<InferUploadResult<Upload>>>;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    accept: string | undefined

    File input accept value derived from the upload manifest when available.

    constraints: UploadFileConstraints | undefined

    Client-safe file constraints derived from the upload manifest when available.

    error: unknown

    Latest error thrown by the upload client.

    files: readonly ReactUploadFileState[]

    Per-file progress state for the active or latest upload.

    isError: boolean

    True after the last upload failed.

    isIdle: boolean

    True while the hook has no active or completed upload.

    isPending: boolean

    True while a request is active.

    isSuccess: boolean

    True after the last upload completed successfully.

    isUploading: boolean

    True while files are being prepared, uploaded, or completed.

    progress: number

    Aggregate upload progress from 0 to 100.

    progressFraction: number

    Aggregate upload progress from 0 to 1.

    Latest successful upload result.

    Current upload lifecycle status.

    Methods

    • Abort the active upload request, when one exists.

      Returns void

    • Clear hook state without changing files already stored by the server.

      Returns void