@dypai-ai/client-sdk - v1.12.0
    Preparing search index...

    Interface UseUploadReturn

    Return type of the useUpload hook.

    interface UseUploadReturn {
        data: any;
        error: DypaiError | null;
        isUploading: boolean;
        progress: number;
        reset: () => void;
        upload: (
            file: File,
            params?: Record<string, any>,
        ) => Promise<{ data: any; error: DypaiError | null }>;
    }
    Index

    Properties

    data: any

    Data from last successful upload

    error: DypaiError | null

    Error from last upload

    isUploading: boolean

    Whether upload is in progress

    progress: number

    Upload progress (0-100)

    reset: () => void

    Reset state

    upload: (
        file: File,
        params?: Record<string, any>,
    ) => Promise<{ data: any; error: DypaiError | null }>

    Upload a file to the endpoint