UNPKG

slate

Version:

A completely customizable framework for building rich text editors.

45 lines • 1.56 kB
import { Editor, Element, Location, Node, NodeEntry } from '../../index'; import { TextUnit } from '../../types/types'; export interface TextDeleteOptions { at?: Location; distance?: number; unit?: TextUnit; reverse?: boolean; hanging?: boolean; voids?: boolean; } export interface InsertFragmentFilterOptions { blockEntry: NodeEntry<Element>; } export type InsertFragmentFilter = (node: Node, options: InsertFragmentFilterOptions) => boolean; export interface TextInsertFragmentOptions { select?: boolean; at?: Location; hanging?: boolean; voids?: boolean; batchDirty?: boolean; filter?: InsertFragmentFilter; } export interface TextInsertTextOptions { select?: boolean; at?: Location; voids?: boolean; } export interface TextTransforms { /** * Delete content in the editor. */ delete: (editor: Editor, options?: TextDeleteOptions) => void; /** * Insert a fragment in the editor * at the specified location or (if not defined) the current selection or (if not defined) the end of the document. */ insertFragment: (editor: Editor, fragment: Node[], options?: TextInsertFragmentOptions) => void; /** * Insert a string of text in the editor * at the specified location or (if not defined) the current selection or (if not defined) the end of the document. */ insertText: (editor: Editor, text: string, options?: TextInsertTextOptions) => void; } export declare const TextTransforms: TextTransforms; //# sourceMappingURL=text.d.ts.map