import type { ComputedRef, Ref } from 'vue'; import type { EponymeMediaItem, EponymeMediaMeta } from '../types/storage.js'; export interface EponymeStorageSettings { /** Whether `eponyme.storage.ts` exists, which is what turns every upload path on. */ enabled: boolean; accept: string[]; maxSize: number; } export declare function useEponymeStorageSettings(): EponymeStorageSettings; export declare function matchesEponymeAccept(accept: string[], contentType: string): boolean; export declare function formatEponymeBytes(bytes: number): string; /** * Refused here as well as on the server, and for a different reason: the server has to refuse it, this only * spares the editor sending 200 MB before being told no. */ export declare function checkEponymeFile(file: File, limits: { accept?: string[]; maxSize?: number; }): string; /** * Width and height of a picture the browser can decode, read before it is sent so the library can record * them: a provider stores bytes, and a presigned upload never passes through the server to be measured. */ export declare function readEponymeImageSize(file: Blob): Promise<{ width: number; height: number; } | undefined>; export interface UseEponymeMedia { items: Ref; pending: Ref; error: Ref; hasMore: ComputedRef; refresh: () => Promise; loadMore: () => Promise; upload: (file: File, onProgress?: (ratio: number) => void) => Promise; remove: (key: string) => Promise; /** Replaces what the library remembers about an image: its alternative, caption, size and focal point. */ describe: (key: string, meta: EponymeMediaMeta) => Promise; /** What the library remembers about an object, read from the item when the listing carried it. */ meta: (item: EponymeMediaItem) => Promise; } /** The media library: what it holds, and the two things an editor does to it. */ export declare function useEponymeMedia(): UseEponymeMedia;