import type { Range } from '../rga/Range';
import type { ViewRange } from '../editor/types';
import type { Peritext } from '../Peritext';
import type { PeritextMlElement, PeritextMlNode } from '../block/types';
import type { JsonMlNode } from 'very-small-parser/lib/html/json-ml/types';
import type { THtmlToken } from 'very-small-parser/lib/html/types';
import type { IRoot } from 'very-small-parser/lib/markdown/block/types';
import type { Fragment } from '../block/Fragment';
export type PeritextDataTransferHtmlExportTools = typeof import('./export-html');
export type PeritextDataTransferHtmlImportTools = typeof import('./import-html');
export type PeritextDataTransferMarkdownExportTools = typeof import('./export-markdown');
export type PeritextDataTransferMarkdownImportTools = typeof import('./import-markdown');
export interface PeritextDataTransferOpts {
    htmlExport?: PeritextDataTransferHtmlExportTools;
    htmlImport?: PeritextDataTransferHtmlImportTools;
    mdExport?: PeritextDataTransferMarkdownExportTools;
    mdImport?: PeritextDataTransferMarkdownImportTools;
}
export interface ClipboardExport {
    'text/plain': string;
    'text/html': string;
}
export interface ClipboardImport {
    text?: string;
    html?: string;
}
/**
 * This class provides methods for transferring data between Peritext and other
 * formats, such as JSON, HTML, Markdown, etc. A Peritext {@link Fragment} can
 * be converted to a JSON object, which can be converted to HTML, Markdown, etc.
 * The reverse is also possible.
 */
export declare class PeritextDataTransfer<T = string> {
    readonly txt: Peritext<T>;
    readonly opts: PeritextDataTransferOpts;
    constructor(txt: Peritext<T>, opts: PeritextDataTransferOpts);
    toView(range: Range<T>): ViewRange;
    toFragment(range: Range<T>): Fragment<T>;
    toJson(range: Range<T>): PeritextMlElement;
    protected htmlE(): PeritextDataTransferHtmlExportTools;
    toJsonMl(range: Range<T>): JsonMlNode;
    toHast(range: Range<T>): THtmlToken;
    toHtml(range?: Range<T>, tab?: string, indent?: string): string;
    protected mdE(): PeritextDataTransferMarkdownExportTools;
    toMdast(range: Range<T>): IRoot;
    toMarkdown(range: Range<T>): string;
    toClipboard(range: Range<T>): ClipboardExport;
    toFormat(range: Range<T>): Pick<ClipboardExport, 'text/html'>;
    fromView(pos: number, view: ViewRange): number;
    fromJson(pos: number, json: PeritextMlElement | PeritextMlNode): number;
    private _imp;
    protected htmlI(): PeritextDataTransferHtmlImportTools;
    fromJsonMl(pos: number, jsonml: JsonMlNode): number;
    fromHast(pos: number, hast: THtmlToken): number;
    fromHtml(pos: number, html: string): number;
    protected mdI(): PeritextDataTransferMarkdownImportTools;
    fromMdast(pos: number, mdast: IRoot): number;
    fromMarkdown(pos: number, markdown: string): number;
    textFromHtml(html: string): string;
    /**
     * Inserts data from the clipboard at a given position. Returns the number
     * of characters inserted, this can be used by the caller to move the cursor
     * to the end of the inserted data.
     *
     * @param pos View position to insert the data at.
     * @param data Clipboard data to attempt to insert.
     * @returns The number of characters inserted.
     */
    fromClipboard(range: Range<T>, data: ClipboardImport): number;
    fromStyle(range: Range<T>, html: string): void;
}
