UNPKG

1.53 kBTypeScriptView Raw
1import { OnChanges, SimpleChanges } from '@angular/core';
2/**
3 * A component that helps with text highlighting.
4 *
5 * If splits the `result` text into parts that contain the searched `term` and generates the HTML markup to simplify
6 * highlighting:
7 *
8 * Ex. `result="Alaska"` and `term="as"` will produce `Al<span class="ngb-highlight">as</span>ka`.
9 */
10export declare class NgbHighlight implements OnChanges {
11 parts: string[];
12 /**
13 * The CSS class for `<span>` elements wrapping the `term` inside the `result`.
14 */
15 highlightClass: string;
16 /**
17 * The text highlighting is added to.
18 *
19 * If the `term` is found inside this text, it will be highlighted.
20 * If the `term` contains array then all the items from it will be highlighted inside the text.
21 */
22 result?: string | null;
23 /**
24 * The term or array of terms to be highlighted.
25 * Since version `v4.2.0` term could be a `string[]`
26 */
27 term: string | readonly string[];
28 /**
29 * Boolean option to determine if the highlighting should be sensitive to accents or not.
30 *
31 * This feature is only available for browsers that implement the `String.normalize` function
32 * (typically not Internet Explorer).
33 * If you want to use this feature in a browser that does not implement `String.normalize`,
34 * you will have to include a polyfill in your application (`unorm` for example).
35 *
36 * @since 9.1.0
37 */
38 accentSensitive: boolean;
39 ngOnChanges(changes: SimpleChanges): void;
40}