/** * borrow from https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/clipboard.ts#L212 */ import type { SerializedNode } from '../types/serialized-node'; export declare const IMAGE_MIME_TYPES: { readonly svg: "image/svg+xml"; readonly png: "image/png"; readonly jpg: "image/jpeg"; readonly gif: "image/gif"; readonly webp: "image/webp"; readonly bmp: "image/bmp"; readonly ico: "image/x-icon"; readonly avif: "image/avif"; readonly jfif: "image/jfif"; }; export declare const MIME_TYPES: { readonly svg: "image/svg+xml"; readonly png: "image/png"; readonly jpg: "image/jpeg"; readonly gif: "image/gif"; readonly webp: "image/webp"; readonly bmp: "image/bmp"; readonly ico: "image/x-icon"; readonly avif: "image/avif"; readonly jfif: "image/jfif"; readonly text: "text/plain"; readonly html: "text/html"; readonly json: "application/json"; readonly binary: "application/octet-stream"; }; export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/png" | "image/jpeg" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/gif" | "image/x-icon" | "image/avif" | "image/jfif")[]]; type AllowedPasteMimeTypes = (typeof ALLOWED_PASTE_MIME_TYPES)[number]; export declare function copyTextToClipboard(text: string, clipboardEvent?: ClipboardEvent): Promise; export interface ClipboardData { elements?: readonly SerializedNode[]; text?: string; html?: string; files?: File[]; } export type PastedMixedContent = { type: 'text' | 'imageUrl'; value: string; }[]; export declare const parseClipboard: (event: ClipboardEvent, isPlainPaste?: boolean) => Promise; export declare const createPasteEvent: ({ types, files, }: { types?: { [key in AllowedPasteMimeTypes]?: string | File; }; files?: File[]; }) => ClipboardEvent; export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean; /** * Reads OS clipboard programmatically. May not work on all browsers. * Will prompt user for permission if not granted. */ export declare const readSystemClipboard: () => Promise<{ "image/png"?: string | File; "image/jpeg"?: string | File; "image/webp"?: string | File; "image/bmp"?: string | File; "image/svg+xml"?: string | File; "text/html"?: string | File; "image/gif"?: string | File; "image/x-icon"?: string | File; "image/avif"?: string | File; "image/jfif"?: string | File; "text/plain"?: string | File; }>; export {};