UNPKG

@wordpress/upload-media

Version:
37 lines 1.18 kB
/** * Error codes for upload operations. * * These codes categorize the different types of failures that can occur * during the upload process, enabling user-friendly error messages. */ export declare enum ErrorCode { EMPTY_FILE = "EMPTY_FILE", SIZE_ABOVE_LIMIT = "SIZE_ABOVE_LIMIT", MIME_TYPE_NOT_SUPPORTED = "MIME_TYPE_NOT_SUPPORTED", MIME_TYPE_NOT_ALLOWED_FOR_USER = "MIME_TYPE_NOT_ALLOWED_FOR_USER", HEIC_DECODE_ERROR = "HEIC_DECODE_ERROR", IMAGE_TRANSCODING_ERROR = "IMAGE_TRANSCODING_ERROR", IMAGE_ROTATION_ERROR = "IMAGE_ROTATION_ERROR", MEDIA_TRANSCODING_ERROR = "MEDIA_TRANSCODING_ERROR", GIF_TRANSCODING_ERROR = "GIF_TRANSCODING_ERROR", GENERAL = "GENERAL" } interface UploadErrorArgs { code: ErrorCode | string; message: string; file: File; cause?: Error; } /** * MediaError class. * * Small wrapper around the `Error` class * to hold an error code and a reference to a file object. */ export declare class UploadError extends Error { code: ErrorCode | string; file: File; constructor({ code, message, file, cause }: UploadErrorArgs); } export {}; //# sourceMappingURL=upload-error.d.ts.map