UNPKG

drip-table

Version:

A tiny and powerful enterprise-class solution for building tables.

31 lines (30 loc) 773 B
import React from 'react'; export interface HighlightProps { content: string; keywords: string[]; color?: string; tagName?: keyof React.ReactHTML; tagAttrs?: Record<string, unknown>; } /** * 高亮文本 * * @export * @class Highlight * @extends {React.Component<HighlightProps, {}>} */ export default class Highlight extends React.PureComponent<HighlightProps> { private get contents(); /** * 搜索匹配字符串 * * @private * @param {string} content 内容文本 * @param {string[]} keywords 关键字列表(按长度降序排列) * @returns {[string, number]} 匹配到的关键字, 匹配到的位置 * * @memberOf Highlight */ private searchString; render(): JSX.Element; }