UNPKG

1.28 kBTypeScriptView Raw
1import { Event, Emitter } from '../../common/event';
2import { Disposable, DisposableCollection } from '../../common/disposable';
3/**
4 * Options for the search term debounce.
5 */
6export interface SearchBoxDebounceOptions {
7 /**
8 * The delay (in milliseconds) before the debounce notifies clients about its content change.
9 */
10 readonly delay: number;
11}
12export declare namespace SearchBoxDebounceOptions {
13 /**
14 * The default debounce option.
15 */
16 const DEFAULT: SearchBoxDebounceOptions;
17}
18/**
19 * It notifies the clients, once if the underlying search term has changed after a given amount of delay.
20 */
21export declare class SearchBoxDebounce implements Disposable {
22 protected readonly options: SearchBoxDebounceOptions;
23 protected readonly disposables: DisposableCollection;
24 protected readonly emitter: Emitter<string | undefined>;
25 protected readonly handler: () => void;
26 protected state: string | undefined;
27 constructor(options: SearchBoxDebounceOptions);
28 append(input: string | undefined): string | undefined;
29 get onChanged(): Event<string | undefined>;
30 dispose(): void;
31 protected fireChanged(value: string | undefined): void;
32 protected reset(): void;
33}
34//# sourceMappingURL=search-box-debounce.d.ts.map
\No newline at end of file