1 | import { IHighlightAdjacentMatchOptions } from '@jupyterlab/codemirror';
|
2 | import { IFilter, IFilters, IReplaceOptions, IReplaceOptionsSupport, ISearchMatch, ISearchProvider, SearchProvider } from '@jupyterlab/documentsearch';
|
3 | import { ITranslator } from '@jupyterlab/translation';
|
4 | import { Widget } from '@lumino/widgets';
|
5 | import { NotebookPanel } from './panel';
|
6 |
|
7 |
|
8 |
|
9 | export declare class NotebookSearchProvider extends SearchProvider<NotebookPanel> {
|
10 | protected translator: ITranslator;
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | constructor(widget: NotebookPanel, translator?: ITranslator);
|
18 | private _onNotebookStateChanged;
|
19 | /**
|
20 | * Report whether or not this provider has the ability to search on the given object
|
21 | *
|
22 | * @param domain Widget to test
|
23 | * @returns Search ability
|
24 | */
|
25 | static isApplicable(domain: Widget): domain is NotebookPanel;
|
26 | /**
|
27 | * Instantiate a search provider for the notebook panel.
|
28 | *
|
29 | * #### Notes
|
30 | * The widget provided is always checked using `isApplicable` before calling
|
31 | * this factory.
|
32 | *
|
33 | * @param widget The widget to search on
|
34 | * @param translator [optional] The translator object
|
35 | *
|
36 | * @returns The search provider on the notebook panel
|
37 | */
|
38 | static createNew(widget: NotebookPanel, translator?: ITranslator): ISearchProvider;
|
39 | /**
|
40 | * The current index of the selected match.
|
41 | */
|
42 | get currentMatchIndex(): number | null;
|
43 | /**
|
44 | * The number of matches.
|
45 | */
|
46 | get matchesCount(): number | null;
|
47 | /**
|
48 | * Set to true if the widget under search is read-only, false
|
49 | * if it is editable. Will be used to determine whether to show
|
50 | * the replace option.
|
51 | */
|
52 | get isReadOnly(): boolean;
|
53 | /**
|
54 | * Support for options adjusting replacement behavior.
|
55 | */
|
56 | get replaceOptionsSupport(): IReplaceOptionsSupport;
|
57 | /**
|
58 | * Dispose of the resources held by the search provider.
|
59 | *
|
60 | * #### Notes
|
61 | * If the object's `dispose` method is called more than once, all
|
62 | * calls made after the first will be a no-op.
|
63 | *
|
64 | * #### Undefined Behavior
|
65 | * It is undefined behavior to use any functionality of the object
|
66 | * after it has been disposed unless otherwise explicitly noted.
|
67 | */
|
68 | dispose(): void;
|
69 | /**
|
70 | * Get the filters for the given provider.
|
71 | *
|
72 | * @returns The filters.
|
73 | */
|
74 | getFilters(): {
|
75 | [key: string]: IFilter;
|
76 | };
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | private _updateSelectionMode;
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | getInitialQuery(): string;
|
91 | |
92 |
|
93 |
|
94 | clearHighlight(): Promise<void>;
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | highlightNext(loop?: boolean, options?: IHighlightAdjacentMatchOptions): Promise<ISearchMatch | undefined>;
|
103 | |
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | highlightPrevious(loop?: boolean, options?: IHighlightAdjacentMatchOptions): Promise<ISearchMatch | undefined>;
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | startQuery(query: RegExp, filters: IFilters | undefined): Promise<void>;
|
119 | |
120 |
|
121 |
|
122 | endQuery(): Promise<void>;
|
123 | |
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 | replaceCurrentMatch(newText: string, loop?: boolean, options?: IReplaceOptions): Promise<boolean>;
|
132 | |
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 | replaceAllMatches(newText: string, options?: IReplaceOptions): Promise<boolean>;
|
140 | validateFilter(name: string, value: boolean): Promise<boolean>;
|
141 | private _addCellProvider;
|
142 | private _removeCellProvider;
|
143 | private _onCellsChanged;
|
144 | private _stepNext;
|
145 | private _onActiveCellChanged;
|
146 | private _handleHighlightsAfterActiveCellChange;
|
147 | |
148 |
|
149 |
|
150 |
|
151 | private _ensureCurrentMatch;
|
152 | private _observeActiveCell;
|
153 | private _stopObservingLastCell;
|
154 | private _setSelectedLines;
|
155 | private _textSelection;
|
156 | |
157 |
|
158 |
|
159 | private _setEnginesSelectionSearchMode;
|
160 | private _onCellSelectionChanged;
|
161 | private _updateCellSelection;
|
162 | protected delayedActiveCellChangeHandlerReady: Promise<void>;
|
163 | private _currentProviderIndex;
|
164 | private _delayedActiveCellChangeHandler;
|
165 | private _filters;
|
166 | private _onSelection;
|
167 | private _selectedCells;
|
168 | private _selectedLines;
|
169 | private _query;
|
170 | private _searchProviders;
|
171 | private _editorSelectionsObservable;
|
172 | private _selectionSearchMode;
|
173 | private _selectionLock;
|
174 | }
|