react-terminal-viewer
Version:
<h1 align="center"> react-terminal-viewer </h1>
37 lines (36 loc) • 1.05 kB
TypeScript
declare class Mark {
private dom;
private options;
matchCount: number;
matchedIndex: number;
isMarked: boolean;
private hlIndex;
constructor(content: string, options?: {
className?: string;
markedClassName?: string;
style?: {
[key: string]: string | undefined;
};
markedStyle?: {
[key: string]: string | undefined;
};
});
/**
* 根据关键字标记文本
* @param {String} keyword - 搜索关键词
* @param {Number} options.matchedIndex - 已匹配的最大的索引
* @param {Number} options.hlIndex - 需要标记的索引
* @returns this
*/
mark(keyword: string, options?: {
matchedIndex: number;
hlIndex: number;
}): this;
escapeStr(str: string): string;
getStyle(isMarked: boolean): string;
getTextNodes(el: ChildNode): ChildNode[];
wrapRangeInTextNode(node: Text, start: number, end: number): Text;
toString(): string;
distory(): void;
}
export default Mark;