export interface ImageKeyDeps { /** SHA-256 of a text as 64 hexadecimal digits. */ sha256Hex: (text: string) => string; /** The sanitizer of the upload API (`generateFileName`). */ sanitizeFileName: (original: string) => string; } export interface ImageKey { /** `catalog/<16 hex digits of the hash>/<16 more>`, no leading slash. */ directory: string; fileName: string; } /** * Where an image is stored (ยง 5.8). The folder comes from the URL, the file name * from the last part of its path, the extension from the content type. The same * URL gives the same key every time, so reading it again replaces the file; two * URLs with the same file name land in different folders. The folder takes 64 * bits of the hash: with 16 bits (65,536 folders) an import of a few thousand * images that are all called `main.jpg` would overwrite some of them with * another product's picture, and nothing would say so. */ export declare function imageStorageKey(url: string, contentType: string, deps: ImageKeyDeps): ImageKey;