UNPKG

2.25 kBTypeScriptView Raw
1import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
2import { toString } from '../util/util';
3import * as i0 from "@angular/core";
4/**
5 * The context for the typeahead result template in case you want to override the default one.
6 */
7export interface ResultTemplateContext {
8 /**
9 * Your typeahead result item.
10 */
11 result: any;
12 /**
13 * Search term from the `<input>` used to get current result.
14 */
15 term: string;
16}
17export declare class NgbTypeaheadWindow implements OnInit {
18 activeIdx: number;
19 /**
20 * The id for the typeahead window. The id should be unique and the same
21 * as the associated typeahead's id.
22 */
23 id: string;
24 /**
25 * Flag indicating if the first row should be active initially
26 */
27 focusFirst: boolean;
28 /**
29 * Typeahead match results to be displayed
30 */
31 results: any;
32 /**
33 * Search term used to get current results
34 */
35 term: string;
36 /**
37 * A function used to format a given result before display. This function should return a formatted string without any
38 * HTML markup
39 */
40 formatter: typeof toString;
41 /**
42 * A template to override a matching result default display
43 */
44 resultTemplate: TemplateRef<ResultTemplateContext>;
45 /**
46 * A custom class to append to the typeahead window
47 *
48 * @since 9.1.0
49 */
50 popupClass: string;
51 /**
52 * Event raised when user selects a particular result row
53 */
54 selectEvent: EventEmitter<any>;
55 activeChangeEvent: EventEmitter<any>;
56 hasActive(): boolean;
57 getActive(): any;
58 markActive(activeIdx: number): void;
59 next(): void;
60 prev(): void;
61 resetActive(): void;
62 select(item: any): void;
63 ngOnInit(): void;
64 private _activeChanged;
65 static ɵfac: i0.ɵɵFactoryDeclaration<NgbTypeaheadWindow, never>;
66 static ɵcmp: i0.ɵɵComponentDeclaration<NgbTypeaheadWindow, "ngb-typeahead-window", ["ngbTypeaheadWindow"], { "id": "id"; "focusFirst": "focusFirst"; "results": "results"; "term": "term"; "formatter": "formatter"; "resultTemplate": "resultTemplate"; "popupClass": "popupClass"; }, { "selectEvent": "select"; "activeChangeEvent": "activeChange"; }, never, never, false>;
67}