import { Fragment } from 'prosemirror-model'; /** * 从 dataTransferItemList 获取文件集合 */ export declare function getFiles(itemList: DataTransferItemList | DataTransferItem[] | undefined): never[]; /** * 将字节数格式化为 kb/M 显示格式 */ export declare function byteSizeFormat(byteSize: number): string; /** * 根据 pattern 导入所有组件 */ export declare function importComponents(modules: { [propName: string]: any; }): any; /** * 下载文件 */ export declare function downloadByUrl(url: string, filename: string): void; /** * 获取首个符合选取规则的父级元素 */ export declare function getMatchParentElement(el: HTMLElement, selectorStr: string): HTMLElement | null; /** * 从 proseMirror 的 Fragment 中获取 textContent */ export declare function getTextContentByProseMirrorFragment(fragment: Fragment | undefined): string; /** * 将 hex 格式转化 arrayBuffer, 可以用于转化 rtf 中的图片 */ export declare function hexToBlob(str: string): ArrayBuffer | null; /** * Uses canvas.measureText to compute and return the width of the given text of given font in pixels. * * @param {String} text The text to be rendered. * @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana"). * * @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393 */ export declare function getTextWidth(text: string, font: string): number;