@wordpress/components
Version:
UI components for WordPress.
64 lines • 2.2 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?: keyof JSX.IntrinsicElements | 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