UNPKG

@uiw/react-md-editor

Version:

A markdown editor with preview, implemented with React.js and TypeScript.

18 lines (17 loc) 896 B
import { TextRange } from '../commands'; export interface TextSection { text: string; selection: TextRange; } export declare function selectWord({ text, selection }: TextSection): TextRange; /** * Gets the number of line-breaks that would have to be inserted before the given 'startPosition' * to make sure there's an empty line between 'startPosition' and the previous text */ export declare function getBreaksNeededForEmptyLineBefore(text: string | undefined, startPosition: number): number; /** * Gets the number of line-breaks that would have to be inserted after the given 'startPosition' * to make sure there's an empty line between 'startPosition' and the next text */ export declare function getBreaksNeededForEmptyLineAfter(text: string | undefined, startPosition: number): number; export declare function getSurroundingWord(text: string, position: number): TextRange;