/** * @file 工具函数 * @author author */ /** * 获取匹配prefix的正则表达式 * * @param {Array} prefix 匹配符 * @param {string} split 分隔符 * @return {[RegExp]} 以匹配符开头的正则表达式 */ export declare const getRegExp: (prefix: string[], split: string) => RegExp; /** * 在字符串指定位置插入要替换的字符,并在替换字符后加上空格 * todo 如果被替换字符后有空格 则插入字符后没有新增空格,这个需要优化下 * * @param {string} str 原先的字符串 * @param {number} start 要插入的起始位置 * @param {number} end 要插入的终点位置 * @param {string} newStr 要插入的字符 * @param {string} split 分隔符 * @return {[type]} 返回结果 */ export declare const insertString: (str: string, start: number, end: number, newStr: string, split: string) => string; /** * setCursorPosition 移动光标到最后的位置 * * @param {string} selector dom元素 * @param {number} pos 要移动位置 */ export declare const setCursorPosition: (selector: any, pos: number) => void; /** * getSearchWordPos 移动光标到最后的位置 * * @param {string} el dom元素 * @return {Object} 位置 */ export declare const getSearchWordPos: (el: any) => { left?: undefined; top?: undefined; height?: undefined; } | { left: number; top: number; height: number; };