@@ -141,7 +141,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
141141 *
142142 * @param container The dialog container
143143 */
144- public setContainer ( container : string ) {
144+ public setContainer ( container : string ) : this {
145145 this . container = container
146146 return this
147147 }
@@ -161,7 +161,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
161161 *
162162 * @param filter MIME type to allow
163163 */
164- public addMimeTypeFilter ( filter : string ) {
164+ public addMimeTypeFilter ( filter : string ) : this {
165165 this . mimeTypeFilter . push ( filter )
166166 return this
167167 }
@@ -171,7 +171,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
171171 *
172172 * @param filter Array of allowed MIME types
173173 */
174- public setMimeTypeFilter ( filter : string [ ] ) {
174+ public setMimeTypeFilter ( filter : string [ ] ) : this {
175175 this . mimeTypeFilter = filter
176176 return this
177177 }
@@ -182,7 +182,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
182182 *
183183 * @param button The button
184184 */
185- public addButton ( button : IFilePickerButton ) {
185+ public addButton ( button : IFilePickerButton ) : this {
186186 if ( typeof this . buttons === 'function' ) {
187187 logger . warn ( 'FilePicker buttons were set to factory, now overwritten with button object.' )
188188 this . buttons = [ ]
@@ -197,7 +197,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
197197 *
198198 * @param factory The button factory
199199 */
200- public setButtonFactory ( factory : IFilePickerButtonFactory ) {
200+ public setButtonFactory ( factory : IFilePickerButtonFactory ) : this {
201201 this . buttons = factory
202202 return this
203203 }
@@ -208,7 +208,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
208208 * @param type The legacy filepicker type to emulate
209209 * @deprecated Use `addButton` or `setButtonFactory` instead as with setType you do not know which button was pressed
210210 */
211- public setType ( type : FilePickerType ) {
211+ public setType ( type : FilePickerType ) : this {
212212 this . buttons = ( nodes , path ) => {
213213 const buttons : IFilePickerButton [ ] = [ ]
214214 const node = nodes [ 0 ]
@@ -254,7 +254,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
254254 *
255255 * @param allow True to allow picking directories
256256 */
257- public allowDirectories ( allow = true ) {
257+ public allowDirectories ( allow = true ) : this {
258258 this . directoriesAllowed = allow
259259 return this
260260 }
@@ -264,7 +264,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
264264 *
265265 * @param noMenu True to hide menu
266266 */
267- public setNoMenu ( noMenu = true ) {
267+ public setNoMenu ( noMenu = true ) : this {
268268 this . noMenu = noMenu
269269 return this
270270 }
@@ -274,7 +274,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
274274 *
275275 * @param path Path to start from picking
276276 */
277- public startAt ( path : string ) {
277+ public startAt ( path : string ) : this {
278278 this . path = path
279279 return this
280280 }
@@ -284,7 +284,7 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
284284 *
285285 * @param filter Filter function to apply
286286 */
287- public setFilter ( filter : IFilePickerFilter ) {
287+ public setFilter ( filter : IFilePickerFilter ) : this {
288288 this . filter = filter
289289 return this
290290 }
@@ -294,23 +294,23 @@ export class FilePickerBuilder<IsMultiSelect extends boolean> {
294294 *
295295 * @param canPick Function to decide if a node can be picked
296296 */
297- public setCanPick ( canPick : IFilePickerCanPick ) {
297+ public setCanPick ( canPick : IFilePickerCanPick ) : this {
298298 this . canPick = canPick
299299 return this
300300 }
301301
302302 /**
303303 * Disable navigation (view selection)
304304 */
305- public disableNavigation ( ) {
305+ public disableNavigation ( ) : this {
306306 this . disabledNavigation = true
307307 return this
308308 }
309309
310310 /**
311311 * Construct the configured FilePicker
312312 */
313- public build ( ) {
313+ public build ( ) : FilePicker < IsMultiSelect > {
314314 return new FilePicker < IsMultiSelect > (
315315 this . title ,
316316 this . multiSelect as IsMultiSelect ,
0 commit comments