import { AstNode } from './node'; import type { LintError } from '../base'; /** * text node * * 文本节点 */ export declare class AstText extends AstNode { #private; readonly name: undefined; readonly data: string; get type(): 'text'; /** text length / 文本长度 */ get length(): number; set length(n: number); /** @param text 包含文本 */ constructor(text: string); /** * Replace the text * * 替换字符串 * @param text new text / 替换的字符串 */ replaceData(text: string): void; /** * Split the text node into two parts * * 将文本子节点分裂为两部分 * @param offset position to be splitted at / 分裂位置 * @throws `RangeError` 错误的断开位置 * @throws `Error` 没有父节点 */ splitText(offset: number): AstText; /** * Escape `=` and `|` * * 转义 `=` 和 `|` * @since v1.1.4 * @throws `Error` 没有父节点 */ escape(): void; /** * Clone the node * * 复制 */ cloneNode(): AstText; /** * Insert text at the end * * 在后方添加字符串 * @param text text to be inserted / 添加的字符串 */ appendData(text: string): void; /** * Delete text * * 删减字符串 * @param offset start position / 起始位置 * @param count number of characters to be deleted / 删减字符数 */ deleteData(offset: number, count?: number): void; /** * Insert text * * 插入字符串 * @param offset position to be inserted at / 插入位置 * @param text text to be inserted / 待插入的字符串 */ insertData(offset: number, text: string): void; /** * Get the substring * * 提取子串 * @param offset start position / 起始位置 * @param count number of characters / 字符数 */ substringData(offset: number, count?: number): string; /** * Generate HTML * * 生成HTML * @param nowrap whether to disable line-wrapping / 是否不换行 * @since v1.10.0 */ toHtml(nowrap?: boolean): string; }