1 | import { Contents } from '@jupyterlab/services';
|
2 | import { ITranslator } from '@jupyterlab/translation';
|
3 | import { SidePanel } from '@jupyterlab/ui-components';
|
4 | import { Panel } from '@lumino/widgets';
|
5 | import { BreadCrumbs } from './crumbs';
|
6 | import { DirListing } from './listing';
|
7 | import { FilterFileBrowserModel } from './model';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare class FileBrowser extends SidePanel {
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | constructor(options: FileBrowser.IOptions);
|
22 | /**
|
23 | * The model used by the file browser.
|
24 | */
|
25 | readonly model: FilterFileBrowserModel;
|
26 | /**
|
27 | * Whether to show active file in file browser
|
28 | */
|
29 | get navigateToCurrentDirectory(): boolean;
|
30 | set navigateToCurrentDirectory(value: boolean);
|
31 | /**
|
32 | * Whether to show the last modified column
|
33 | */
|
34 | get showLastModifiedColumn(): boolean;
|
35 | set showLastModifiedColumn(value: boolean);
|
36 | /**
|
37 | * Whether to show the file size column
|
38 | */
|
39 | get showFileSizeColumn(): boolean;
|
40 | set showFileSizeColumn(value: boolean);
|
41 | /**
|
42 | * Whether to show hidden files
|
43 | */
|
44 | get showHiddenFiles(): boolean;
|
45 | set showHiddenFiles(value: boolean);
|
46 | /**
|
47 | * Whether to show checkboxes next to files and folders
|
48 | */
|
49 | get showFileCheckboxes(): boolean;
|
50 | set showFileCheckboxes(value: boolean);
|
51 | /**
|
52 | * Whether to sort notebooks above other files
|
53 | */
|
54 | get sortNotebooksFirst(): boolean;
|
55 | set sortNotebooksFirst(value: boolean);
|
56 | /**
|
57 | * Create an iterator over the listing's selected items.
|
58 | *
|
59 | * @returns A new iterator over the listing's selected items.
|
60 | */
|
61 | selectedItems(): IterableIterator<Contents.IModel>;
|
62 | /**
|
63 | * Select an item by name.
|
64 | *
|
65 | * @param name - The name of the item to select.
|
66 | */
|
67 | selectItemByName(name: string): Promise<void>;
|
68 | clearSelectedItems(): void;
|
69 | /**
|
70 | * Rename the first currently selected item.
|
71 | *
|
72 | * @returns A promise that resolves with the new name of the item.
|
73 | */
|
74 | rename(): Promise<string>;
|
75 | /**
|
76 | * Cut the selected items.
|
77 | */
|
78 | cut(): void;
|
79 | /**
|
80 | * Copy the selected items.
|
81 | */
|
82 | copy(): void;
|
83 | /**
|
84 | * Paste the items from the clipboard.
|
85 | *
|
86 | * @returns A promise that resolves when the operation is complete.
|
87 | */
|
88 | paste(): Promise<void>;
|
89 | private _createNew;
|
90 | /**
|
91 | * Create a new directory
|
92 | */
|
93 | createNewDirectory(): Promise<Contents.IModel>;
|
94 | /**
|
95 | * Create a new file
|
96 | */
|
97 | createNewFile(options: FileBrowser.IFileOptions): Promise<Contents.IModel>;
|
98 | /**
|
99 | * Delete the currently selected item(s).
|
100 | *
|
101 | * @returns A promise that resolves when the operation is complete.
|
102 | */
|
103 | delete(): Promise<void>;
|
104 | /**
|
105 | * Duplicate the currently selected item(s).
|
106 | *
|
107 | * @returns A promise that resolves when the operation is complete.
|
108 | */
|
109 | duplicate(): Promise<void>;
|
110 | /**
|
111 | * Download the currently selected item(s).
|
112 | */
|
113 | download(): Promise<void>;
|
114 | /**
|
115 | * cd ..
|
116 | *
|
117 | * Go up one level in the directory tree.
|
118 | */
|
119 | goUp(): Promise<void>;
|
120 | /**
|
121 | * Shut down kernels on the applicable currently selected items.
|
122 | *
|
123 | * @returns A promise that resolves when the operation is complete.
|
124 | */
|
125 | shutdownKernels(): Promise<void>;
|
126 | /**
|
127 | * Select next item.
|
128 | */
|
129 | selectNext(): void;
|
130 | /**
|
131 | * Select previous item.
|
132 | */
|
133 | selectPrevious(): void;
|
134 | /**
|
135 | * Find a model given a click.
|
136 | *
|
137 | * @param event - The mouse event.
|
138 | *
|
139 | * @returns The model for the selected file.
|
140 | */
|
141 | modelForClick(event: MouseEvent): Contents.IModel | undefined;
|
142 | /**
|
143 | * Create the underlying DirListing instance.
|
144 | *
|
145 | * @param options - The DirListing constructor options.
|
146 | *
|
147 | * @returns The created DirListing instance.
|
148 | */
|
149 | protected createDirListing(options: DirListing.IOptions): DirListing;
|
150 | protected translator: ITranslator;
|
151 | /**
|
152 | * Handle a connection lost signal from the model.
|
153 | */
|
154 | private _onConnectionFailure;
|
155 | protected listing: DirListing;
|
156 | protected crumbs: BreadCrumbs;
|
157 | protected mainPanel: Panel;
|
158 | private _manager;
|
159 | private _directoryPending;
|
160 | private _filePending;
|
161 | private _navigateToCurrentDirectory;
|
162 | private _showLastModifiedColumn;
|
163 | private _showFileSizeColumn;
|
164 | private _showHiddenFiles;
|
165 | private _showFileCheckboxes;
|
166 | private _sortNotebooksFirst;
|
167 | }
|
168 | /**
|
169 | * The namespace for the `FileBrowser` class statics.
|
170 | */
|
171 | export declare namespace FileBrowser {
|
172 | /**
|
173 | * An options object for initializing a file browser widget.
|
174 | */
|
175 | interface IOptions {
|
176 | |
177 |
|
178 |
|
179 | id: string;
|
180 | |
181 |
|
182 |
|
183 | model: FilterFileBrowserModel;
|
184 | |
185 |
|
186 |
|
187 |
|
188 |
|
189 | renderer?: DirListing.IRenderer;
|
190 | |
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 | restore?: boolean;
|
199 | |
200 |
|
201 |
|
202 | translator?: ITranslator;
|
203 | }
|
204 | |
205 |
|
206 |
|
207 | interface IFileOptions {
|
208 | |
209 |
|
210 |
|
211 | ext: string;
|
212 | }
|
213 | }
|