import { MarkdownEditorCalloutType, MarkdownEditorHighlightColor, MarkdownEditorSelection, MarkdownTextChange } from './types'; /** * Toolbar commands and editing shortcuts as source edits. * * Every surface, the history and the collaboration transport work in Markdown * offsets, so a command is computed once from the document and the selection * and then applied wherever the user is: the rich surface re-renders the * blocks it touched, the source editor dispatches it, and a peer receives the * same change set. */ export interface MarkdownEdit { changes: MarkdownTextChange[]; selection: MarkdownEditorSelection; } export type MarkdownInlineFormat = 'bold' | 'italic' | 'strike' | 'code'; export type MarkdownLineFormat = 'quote' | 'bulletList' | 'orderedList' | 'taskList'; export type MarkdownFormatAction = { type: MarkdownInlineFormat; } /** * Highlights the selection in `color`; null takes the highlight off. With * `toggle`, a selection that is highlighted all through loses it instead. */ | { type: 'highlight'; color: MarkdownEditorHighlightColor | null; toggle?: boolean; } | { type: MarkdownLineFormat; } /** The selected lines as a callout; in a quote, the quote becomes one. */ | { type: 'callout'; callout: MarkdownEditorCalloutType; } /** Without `level`, toggles a level-2 heading. 0 turns headings back into paragraphs. */ | { type: 'heading'; level?: number; } /** An empty `href` removes the link around the selection. */ | { type: 'link'; href: string; } | { type: 'image'; src: string; alt?: string; title?: string; } | { type: 'table'; columns?: number; rows?: number; header?: string; } | { type: 'codeBlock'; language?: string; } | { type: 'math'; tex?: string; display?: boolean; } | { type: 'divider'; } | { type: 'insert'; text: string; block?: boolean; }; /** Tab and Shift+Tab on list items: nests under the item above, or moves up a level. */ export declare function indentMarkdownList(doc: string, selection: MarkdownEditorSelection, direction: 1 | -1): MarkdownEdit | null; /** * Enter in a list item or a quote: the next item, numbered and boxed like this * one. An empty item ends the list instead, one level at a time. */ export declare function continueMarkdownList(doc: string, selection: MarkdownEditorSelection): MarkdownEdit | null; /** The destination of the link whose label holds the selection, for editing it; null outside a link. */ export declare function markdownLinkAt(doc: string, selection: MarkdownEditorSelection): string | null; /** One toolbar or shortcut command against the source; null when it does not apply. */ export declare function formatMarkdown(doc: string, selection: MarkdownEditorSelection, action: MarkdownFormatAction): MarkdownEdit | null;