1 | import { SearchBoxDebounce, SearchBoxDebounceOptions } from '../tree/search-box-debounce';
|
2 | import { BaseWidget, Message } from '../widgets/widget';
|
3 | import { Emitter, Event } from '../../common/event';
|
4 | import { KeyCode, Key } from '../keyboard/keys';
|
5 |
|
6 |
|
7 |
|
8 | export interface SearchBoxProps extends SearchBoxDebounceOptions {
|
9 | |
10 |
|
11 |
|
12 | readonly showButtons?: boolean;
|
13 | |
14 |
|
15 |
|
16 | readonly showFilter?: boolean;
|
17 | }
|
18 | export declare namespace SearchBoxProps {
|
19 | |
20 |
|
21 |
|
22 | const DEFAULT: SearchBoxProps;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 | export declare class SearchBox extends BaseWidget {
|
28 | protected readonly props: SearchBoxProps;
|
29 | protected readonly debounce: SearchBoxDebounce;
|
30 | protected static SPECIAL_KEYS: Key[];
|
31 | protected static MAX_CONTENT_LENGTH: number;
|
32 | protected readonly nextEmitter: Emitter<void>;
|
33 | protected readonly previousEmitter: Emitter<void>;
|
34 | protected readonly closeEmitter: Emitter<void>;
|
35 | protected readonly textChangeEmitter: Emitter<string | undefined>;
|
36 | protected readonly filterToggleEmitter: Emitter<boolean>;
|
37 | protected readonly input: HTMLSpanElement;
|
38 | protected readonly filter: HTMLElement | undefined;
|
39 | protected _isFiltering: boolean;
|
40 | constructor(props: SearchBoxProps, debounce: SearchBoxDebounce);
|
41 | get onPrevious(): Event<void>;
|
42 | get onNext(): Event<void>;
|
43 | get onClose(): Event<void>;
|
44 | get onTextChange(): Event<string | undefined>;
|
45 | get onFilterToggled(): Event<boolean>;
|
46 | get isFiltering(): boolean;
|
47 | get keyCodePredicate(): KeyCode.Predicate;
|
48 | protected firePrevious(): void;
|
49 | protected fireNext(): void;
|
50 | protected fireClose(): void;
|
51 | protected fireTextChange(input: string | undefined): void;
|
52 | protected fireFilterToggle(): void;
|
53 | protected doFireFilterToggle(toggleTo?: boolean): void;
|
54 | handle(event: KeyboardEvent): void;
|
55 | protected handleArrowUp(): void;
|
56 | protected handleArrowDown(): void;
|
57 | onBeforeHide(): void;
|
58 | protected handleKey(keyCode: KeyCode): void;
|
59 | protected getTrimmedContent(data: string): string;
|
60 | protected canHandle(keyCode: KeyCode | undefined): boolean;
|
61 | protected isCtrlBackspace(keyCode: KeyCode): boolean;
|
62 | updateHighlightInfo(info: SearchBox.HighlightInfo): void;
|
63 | protected createContent(): {
|
64 | container: HTMLElement;
|
65 | input: HTMLSpanElement;
|
66 | filter: HTMLElement | undefined;
|
67 | previous: HTMLElement | undefined;
|
68 | next: HTMLElement | undefined;
|
69 | close: HTMLElement | undefined;
|
70 | };
|
71 | protected onAfterAttach(msg: Message): void;
|
72 | }
|
73 | export declare namespace SearchBox {
|
74 | |
75 |
|
76 |
|
77 | namespace Styles {
|
78 | const SEARCH_BOX = "theia-search-box";
|
79 | const SEARCH_INPUT = "theia-search-input";
|
80 | const SEARCH_BUTTONS_WRAPPER = "theia-search-buttons-wrapper";
|
81 | const BUTTON = "theia-search-button";
|
82 | const FILTER: string[];
|
83 | const FILTER_ON = "filter-active";
|
84 | const BUTTON_PREVIOUS = "theia-search-button-previous";
|
85 | const BUTTON_NEXT = "theia-search-button-next";
|
86 | const BUTTON_CLOSE = "theia-search-button-close";
|
87 | const NON_SELECTABLE = "theia-non-selectable";
|
88 | const NO_MATCH = "no-match";
|
89 | }
|
90 | interface HighlightInfo {
|
91 | filterText: string | undefined;
|
92 | matched: number;
|
93 | total: number;
|
94 | }
|
95 | }
|
96 |
|
97 |
|
98 |
|
99 | export declare const SearchBoxFactory: unique symbol;
|
100 | export interface SearchBoxFactory {
|
101 | |
102 |
|
103 |
|
104 | (props: SearchBoxProps): SearchBox;
|
105 | }
|
106 |
|
\ | No newline at end of file |