What is @types/autosuggest-highlight?
@types/autosuggest-highlight provides TypeScript definitions for the autosuggest-highlight library, which is used to highlight matching parts of suggestions in an autosuggest or autocomplete component.
Highlight Matching Parts
This feature allows you to highlight the parts of a suggestion that match the user's query. The `match` function finds the matching parts, and the `parse` function splits the text into highlighted and non-highlighted parts.
const highlight = require('autosuggest-highlight');
const text = 'Hello World';
const query = 'lo';
const matches = highlight.match(text, query);
const parts = highlight.parse(text, matches);
console.log(parts);