Trevixal API
    Preparing search index...

    Interface ImageOptions

    Reject anything that is not a real image before a byte leaves the browser.

    interface ImageOptions {
        accept?: readonly string[];
        compress?: false | CompressOptions;
        compressor?: (file: File, options: CompressOptions) => Promise<File>;
        deleteOnRemove?: boolean;
        maxBytes?: number;
        onError?: (message: string) => void;
        onUpload?: (status: UploadStatus) => void;
        storage: ImageStorage;
        transformer?: ImageTransformer;
    }

    Hierarchy (View Summary)

    Index
    accept?: readonly string[]

    Accepted MIME types; defaults to the common web image formats.

    compress?: false | CompressOptions

    Shrink images before they are uploaded. On by default because the common case, a photo straight off a phone, is several megabytes of pixels no document will ever show; pass false to upload the bytes untouched.

    compressor?: (file: File, options: CompressOptions) => Promise<File>

    Swap the compressor out (a worker, a WASM encoder, a stub in tests).

    deleteOnRemove?: boolean

    Delete the stored object when its image leaves the document.

    maxBytes?: number

    Bytes; defaults to 10 MB.

    onError?: (message: string) => void

    Surfaced to the user when a file is rejected or an upload fails.

    onUpload?: (status: UploadStatus) => void

    Upload lifecycle for progress UI; called on every state change.

    storage: ImageStorage

    Where the bytes go. Any ImageStorage implementation.

    transformer?: ImageTransformer

    Swap the rotate/crop rasteriser out, for the same reasons.