zim-fuzzysearch
Version:
Client side fuzzy search combined with seperate configurable result highlighting.
15 lines (14 loc) • 752 B
TypeScript
import Mark from "mark.js";
export declare type useMarkJsType = (search?: string, markOptions?: Mark.MarkOptions) => {
mark: (elem: HTMLElement, value: string | undefined, options?: Mark.MarkOptions | undefined) => void;
markRegEx: (elem: HTMLElement, regex: RegExp, options?: Mark.MarkOptions | undefined) => void;
};
export interface ZimMarkOptions extends Mark.MarkOptions {
}
/**
* Uses library mark.js (https://markjs.io/#getting-to-know-markjs) to highlight
* html text nodes according to given search value. For implementation details see link.
* @param search Optional: string to be searched.
* @param markOptions Optional: mark.js-option object to customize search.
*/
export declare const useMarkJs: useMarkJsType;