UNPKG

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