@wordpress/components
Version:
UI components for WordPress.
64 lines • 4.06 kB
TypeScript
/**
*
* @param {Options} options
*/
export function createHighlighterText({ activeClassName, activeIndex, activeStyle, autoEscape, caseSensitive, children, findChunks, highlightClassName, highlightStyle, highlightTag, sanitize, searchWords, unhighlightClassName, unhighlightStyle, }: Options): import("react").DOMElement<Record<string, any>, Element>[] | null;
export type Options = {
/**
* Classname for active highlighted areas.
*/
activeClassName?: string | undefined;
/**
* The index of the active highlighted area.
*/
activeIndex?: number | undefined;
/**
* Styles to apply to the active highlighted area.
*/
activeStyle?: import('react').AllHTMLAttributes<HTMLDivElement>['style'];
/**
* Whether to automatically escape text.
*/
autoEscape?: boolean | undefined;
/**
* Whether to highlight in a case-sensitive manner.
*/
caseSensitive?: boolean | undefined;
/**
* Children to highlight.
*/
children: string;
/**
* Custom `findChunks` function to pass to `highlight-words-core`.
*/
findChunks?: import('highlight-words-core').FindAllArgs['findChunks'];
/**
* Classname to apply to highlighted text or a Record of classnames to apply to given text (which should be the key).
*/
highlightClassName?: string | Record<string, unknown> | undefined;
/**
* Styles to apply to highlighted text.
*/
highlightStyle?: import('react').AllHTMLAttributes<HTMLDivElement>['style'];
/**
* Tag to use for the highlighted text.
*/
highlightTag?: "symbol" | "object" | "small" | "div" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "text" | "circle" | "menuitem" | "clipPath" | "filter" | "mask" | "marker" | "big" | "keygen" | "noindex" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | undefined;
/**
* Custom `santize` function to pass to `highlight-words-core`.
*/
sanitize?: import('highlight-words-core').FindAllArgs['sanitize'];
/**
* Words to search for and highlight.
*/
searchWords?: string[] | undefined;
/**
* Classname to apply to unhighlighted text.
*/
unhighlightClassName?: string | undefined;
/**
* Style to apply to unhighlighted text.
*/
unhighlightStyle?: import('react').AllHTMLAttributes<HTMLDivElement>['style'];
};
//# sourceMappingURL=utils.d.ts.map