import { Node } from '@tiptap/react';
import { EditorView } from '@tiptap/pm/view';
import { RichTextFileAttachmentError, RichTextFileUpload } from './types';
export declare const SAFE_ATTACHMENT_URL_REGEX: RegExp;
export declare const formatFileSize: (bytes: number) => string;
export declare const matchesAccept: (file: File, accept: string) => boolean;
/**
* Inline, non-editable chip linking to an uploaded file. Serialised as
* `{name} ({size})`
*/
export declare const FileAttachment: Node;
interface InsertAttachmentOptions {
upload: RichTextFileUpload;
accept: string;
imagesOnly?: boolean;
maxFileSize?: number;
onError?: (file: File, reason: RichTextFileAttachmentError) => void;
}
/**
* Uploads files and inserts them as attachment chips at `pos`, or over the
* selection when omitted. The target follows edits made while uploading.
* Resolves with the position after the last chip
*/
export declare const insertAttachmentFiles: (view: EditorView, files: File[], { upload, accept, imagesOnly, maxFileSize, onError }: InsertAttachmentOptions, pos?: number) => Promise;
export {};