import { Node } from '@tiptap/core'; import { GeneralOptions } from '../../types'; declare module "@tiptap/core" { interface Commands { attachment: { /** * Insert a fully-resolved attachment node. * All attrs (id, fileName, fileSize, fileType, fileExt) must be provided * — the node is never inserted in an "empty / pending" state any more. */ setAttachment: (attrs: { id: string; fileName: string; fileSize: number; fileType: string; fileExt: string; }) => ReturnType; }; } } export interface AttachmentOptions extends GeneralOptions { /** * Called when the user picks a file inside the attachment dialog. * Must resolve to the UUID / primary key your backend assigned to the * uploaded asset. This id is the only value stored on the node. */ upload?: (file: File) => Promise; /** * Called when the user clicks the download button on an attachment. * Receives the node's metadata so your app can fetch a signed / * authenticated download URL on demand and open it. * * This callback is REQUIRED for downloads to work — there is no URL stored * on the node, so no automatic browser fallback is possible. */ onDownload?: (attrs: { /** The UUID / primary key returned by your upload endpoint. */ id: string; fileName: string; fileExt: string; fileType: string; fileSize: number; }) => void; } export * from './components/RichTextAttachment'; export declare const Attachment: Node;