/** * A distinct name for a file that arrived on the clipboard. * * Every pasted image is called `image.png` — the browser has no other name to * give it — and the server's `generateFileName` only sanitises, it does not * de-duplicate. Two pastes would therefore land on the same key and the second * would overwrite the first, with nothing to show for it. The stamp and the * index make each one its own file. * * A file pasted from a file manager DOES carry a real name, and that is kept: * renaming `quarterly-report.pdf` to `pasted-20260930120000.pdf` would be * losing information the user gave us. * * @param name the browser-supplied name, often `image.png` or empty * @param type the media type, used for the extension when the name has none * @param stamp caller-supplied so a batch pasted together shares one stamp * @param index position within that batch, or undefined when pasting one file */ /** * A usable base name from the URL an image was copied from. * * Copying an image out of a web page puts the pixels on the clipboard with no * name — but usually also the `` markup, and the source URL in it carries * the name the site gave the file. `chocolate-cake.jpg` beats * `pasted-20260930142233.png` for anyone who later has to find it. * * The extension is deliberately DROPPED here and taken from the real media * type instead: a browser re-encodes a copied image (a JPEG on the page * arrives as PNG bytes), so the URL's extension would describe something the * file is not. * * Returns '' when the URL yields nothing worth using, which includes the cases * that matter: a `data:` URI, a path ending in a slash, and a name that is * nothing but separators once the server has sanitised it. */ export declare function baseNameFromUrl(url: string | undefined): string; export declare function pastedFileName(name: string, type: string | undefined, stamp: string, index?: number, /** The URL the image was copied from, when the clipboard carried one. */ sourceUrl?: string): string; /** `20260930T142233Z` collapsed to `20260930142233` — sortable, name-safe. */ export declare function clipboardStamp(now?: Date): string;