summaryrefslogtreecommitdiffstats
path: root/third_party/closure_compiler/externs/file_manager_private.js
blob: 0e75529fc8ca8137000203bae086971f197a0d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/** @fileoverview Externs generated from namespace: fileManagerPrivate */

/**
 * @typedef {{
 *   taskId: string,
 *   title: string,
 *   iconUrl: string,
 *   isDefault: boolean
 * }}
 */
var FileTask;

/**
 * @typedef {{
 *   size: (number|undefined),
 *   modificationTime: (number|undefined),
 *   thumbnailUrl: (string|undefined),
 *   croppedThumbnailUrl: (string|undefined),
 *   externalFileUrl: (string|undefined),
 *   imageWidth: (number|undefined),
 *   imageHeight: (number|undefined),
 *   imageRotation: (number|undefined),
 *   pinned: (boolean|undefined),
 *   present: (boolean|undefined),
 *   hosted: (boolean|undefined),
 *   dirty: (boolean|undefined),
 *   availableOffline: (boolean|undefined),
 *   availableWhenMetered: (boolean|undefined),
 *   customIconUrl: (string|undefined),
 *   contentMimeType: (string|undefined),
 *   sharedWithMe: (boolean|undefined),
 *   shared: (boolean|undefined)
 * }}
 */
var EntryProperties;

/**
 * @typedef {{
 *   totalSize: number,
 *   remainingSize: number
 * }}
 */
var MountPointSizeStats;

/**
 * @typedef {{
 *   profileId: string,
 *   displayName: string,
 *   isCurrentProfile: boolean
 * }}
 */
var ProfileInfo;

/**
 * @typedef {{
 *   volumeId: string,
 *   fileSystemId: (string|undefined),
 *   extensionId: (string|undefined),
 *   source: string,
 *   volumeLabel: (string|undefined),
 *   profile: ProfileInfo,
 *   sourcePath: (string|undefined),
 *   volumeType: string,
 *   deviceType: (string|undefined),
 *   devicePath: (string|undefined),
 *   isParentDevice: (boolean|undefined),
 *   isReadOnly: boolean,
 *   hasMedia: boolean,
 *   configurable: boolean,
 *   mountCondition: (string|undefined),
 *   mountContext: (string|undefined)
 * }}
 */
var VolumeMetadata;

/**
 * @typedef {{
 *   eventType: string,
 *   status: string,
 *   volumeMetadata: VolumeMetadata,
 *   shouldNotify: boolean
 * }}
 */
var MountCompletedEvent;

/**
 * @typedef {{
 *   fileUrl: string,
 *   transferState: string,
 *   transferType: string,
 *   processed: number,
 *   total: number,
 *   num_total_jobs: number
 * }}
 */
var FileTransferStatus;

/**
 * @typedef {{
 *   type: string,
 *   fileUrl: string
 * }}
 */
var DriveSyncErrorEvent;

/**
 * @typedef {{
 *   type: string,
 *   sourceUrl: (string|undefined),
 *   destinationUrl: (string|undefined),
 *   size: (number|undefined),
 *   error: (string|undefined)
 * }}
 */
var CopyProgressStatus;

/**
 * @typedef {{
 *   fileUrl: string,
 *   canceled: boolean
 * }}
 */
var FileTransferCancelStatus;

/**
 * @typedef {{
 *   url: string,
 *   changes: Array
 * }}
 */
var FileChange;

/**
 * @typedef {{
 *   eventType: string,
 *   entry: Object,
 *   changedFiles: (Array|undefined)
 * }}
 */
var FileWatchEvent;

/**
 * @typedef {{
 *   driveEnabled: boolean,
 *   cellularDisabled: boolean,
 *   hostedFilesDisabled: boolean,
 *   searchSuggestEnabled: boolean,
 *   use24hourClock: boolean,
 *   allowRedeemOffers: boolean
 * }}
 */
var Preferences;

/**
 * @typedef {{
 *   cellularDisabled: (boolean|undefined),
 *   hostedFilesDisabled: (boolean|undefined)
 * }}
 */
var PreferencesChange;

/**
 * @typedef {{
 *   query: string,
 *   nextFeed: string
 * }}
 */
var SearchParams;

/**
 * @typedef {{
 *   query: string,
 *   types: string,
 *   maxResults: number
 * }}
 */
var SearchMetadataParams;

/**
 * @typedef {{
 *   entry: Object,
 *   highlightedBaseName: string
 * }}
 */
var SearchResult;

/**
 * @typedef {{
 *   type: string,
 *   reason: (string|undefined)
 * }}
 */
var DriveConnectionState;

/**
 * @typedef {{
 *   type: string,
 *   devicePath: string
 * }}
 */
var DeviceEvent;

/**
 * @typedef {{
 *   extensionId: string,
 *   name: string,
 *   configurable: boolean,
 *   multipleMounts: boolean,
 *   source: string
 * }}
 */
var ProvidingExtension;

/**
 * @typedef {{
 *   id: string,
 *   title: (string|undefined)
 * }}
 */
var EntryAction;

/**
 * @const
 */
chrome.fileManagerPrivate = {};

/**
 * Logout the current user for navigating to the re-authentication screen for
 * the Google account.
 */
chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};

/**
 * Cancels file selection.
 */
chrome.fileManagerPrivate.cancelDialog = function() {};

/**
 * Executes file browser task over selected files. |taskId| The unique
 * identifier of task to execute. |fileUrls| Array of file URLs |callback|
 * @param {string} taskId
 * @param {Array} fileUrls
 * @param {Function=} callback |result| Result of the task execution.
 */
chrome.fileManagerPrivate.executeTask = function(taskId, fileUrls, callback) {};

/**
 * Sets the default task for the supplied MIME types and suffixes of the
 * supplied file URLs. Lists of MIME types and URLs may contain duplicates.
 * |taskId| The unique identifier of task to mark as default. |fileUrls| Array
 * of selected file URLs to extract suffixes from. |mimeTypes| Array of
 * selected file MIME types. |callback|
 * @param {string} taskId
 * @param {Array} fileUrls
 * @param {Array=} mimeTypes
 * @param {Function=} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.setDefaultTask = function(taskId, fileUrls, mimeTypes, callback) {};

/**
 * Gets the list of tasks that can be performed over selected files. |fileUrls|
 * Array of selected file URLs |callback|
 * @param {Array} fileUrls
 * @param {Function} callback |tasks| The list of matched file URL patterns for
 * this task.
 */
chrome.fileManagerPrivate.getFileTasks = function(fileUrls, callback) {};

/**
 * Gets localized strings and initialization data. |callback|
 * @param {Function} callback |result| Hash containing the string assets.
 */
chrome.fileManagerPrivate.getStrings = function(callback) {};

/**
 * Adds file watch. |fileUrl| URL of file to watch |callback|
 * @param {string} fileUrl
 * @param {Function} callback |success| True when file watch is successfully
 * added.
 */
chrome.fileManagerPrivate.addFileWatch = function(fileUrl, callback) {};

/**
 * Removes file watch. |fileUrl| URL of watched file to remove |callback|
 * @param {string} fileUrl
 * @param {Function} callback |success| True when file watch is successfully
 * removed.
 */
chrome.fileManagerPrivate.removeFileWatch = function(fileUrl, callback) {};

/**
 * Enables the extenal file scheme necessary to initiate drags to the browser
 * window for files on the external backend.
 */
chrome.fileManagerPrivate.enableExternalFileScheme = function() {};

/**
 * Requests R/W access to the specified entries as |entryUrls|. Note, that only
 * files backed by external file system backend will be granted the access.
 * @param {!Array<string>} entryUrls
 * @param {function()} callback Completion callback.
 */
chrome.fileManagerPrivate.grantAccess = function(entryUrls, callback) {};

/**
 * Selects multiple files. |selectedPaths| Array of selected paths
 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
 * |callback|
 * @param {Array} selectedPaths
 * @param {boolean} shouldReturnLocalPath
 * @param {Function} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.selectFiles = function(selectedPaths, shouldReturnLocalPath, callback) {};

/**
 * Selects a file. |selectedPath| A selected path |index| Index of Filter
 * |forOpening| true if paths are selected for opening. false if for saving.
 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
 * |callback|
 * @param {string} selectedPath
 * @param {number} index
 * @param {boolean} forOpening
 * @param {boolean} shouldReturnLocalPath
 * @param {Function} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening, shouldReturnLocalPath, callback) {};

/**
 * Requests additional properties for files. |fileUrls| list of URLs of files
 * |callback|
 * @param {!Array<string>} fileUrls
 * @param {!Array<string>} names
 * @param {!Function} callback |entryProperties| A dictionary containing
 * properties of the requested entries.
 */
chrome.fileManagerPrivate.getEntryProperties = function(fileUrls, names, callback) {};

/**
 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin.
 * |pin| Pass true to pin the file. |callback| Completion callback.
 * $(ref:runtime.lastError) will be set if     there was an error.
 * @param {string} fileUrl
 * @param {boolean} pin
 * @param {Function=} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.pinDriveFile = function(fileUrl, pin, callback) {};

/**
 * Resolves file entries in the isolated file system and returns corresponding
 * entries in the external file system mounted to Chrome OS file manager
 * backend. If resolving entry fails, the entry will be just ignored and the
 * corresponding entry does not appear in the result.
 * @param {Array} entries
 * @param {Function} callback |entryUrl| URL of an entry in a normal file
 * system.
 */
chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries, callback) {};

/**
 * Mount a resource or a file. |source| Mount point source. For compressed
 * files it is relative file path     within external file system |callback|
 * @param {string} source
 * @param {Function} callback |sourcePath| Source path of the mount.
 */
chrome.fileManagerPrivate.addMount = function(source, callback) {};

/**
 * Unmounts a mounted resource. |volumeId| An ID of the volume.
 * @param {string} volumeId
 */
chrome.fileManagerPrivate.removeMount = function(volumeId) {};

/**
 * Get the list of mounted volumes. |callback|
 * @param {Function} callback |volumeMetadataList| The list of VolumeMetadata
 * representing mounted volumes.
 */
chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};

/**
 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files
 * for which ongoing transfer should be canceled.     If this is absent, all
 * jobs are canceled.  |callback|
 * @param {Array=} fileUrls
 * @param {Function=} callback |fileTransferCancelStatuses| The list of
 * FileTransferCancelStatus.
 */
chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {};

/**
 * Starts to copy an entry. If the source is a directory, the copy is done
 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| URL
 * of the destination directory. |newName| Name of the new entry. It shouldn't
 * contain '/'. |callback| Completion callback.
 * @param {string} sourceUrl
 * @param {string} parent
 * @param {string} newName
 * @param {Function} callback |copyId| ID of the copy task. Can be used to
 * identify the progress, and to cancel the task.
 */
chrome.fileManagerPrivate.startCopy = function(sourceUrl, parent, newName, callback) {};

/**
 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
 * |callback| Completion callback of the cancel.
 * @param {number} copyId
 * @param {Function=} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};

/**
 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
 * volume to be checked. |callback|
 * @param {string} volumeId
 * @param {Function} callback |sizeStats| Name/value pairs of size stats. Will
 * be undefined if stats could not be determined.
 */
chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};

/**
 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
 * @param {string} volumeId
 */
chrome.fileManagerPrivate.formatVolume = function(volumeId) {};

/**
 * Retrieves file manager preferences. |callback|
 * @param {Function} callback
 */
chrome.fileManagerPrivate.getPreferences = function(callback) {};

/**
 * Sets file manager preferences. |changeInfo|
 * @param {PreferencesChange} changeInfo
 */
chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};

/**
 * Performs drive content search. |searchParams| |callback|
 * @param {SearchParams} searchParams
 * @param {Function} callback |entries| |nextFeed| ID of the feed that contains
 * next chunk of the search result.     Should be sent to the next searchDrive
 * request to perform     incremental search.
 */
chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};

/**
 * Performs drive metadata search. |searchParams| |callback|
 * @param {SearchMetadataParams} searchParams
 * @param {Function} callback
 */
chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback) {};

/**
 * Search for files in the given volume, whose content hash matches the list of
 * given hashes.
 * @param {string} volumeId
 * @param {!Array<string>} hashes
 * @param {function(!Object<string, !Array<string>>)} callback
 */
chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes, callback) {};

/**
 * Create a zip file for the selected files. |dirURL| URL of the directory
 * containing the selected files. |selectionUrls| URLs of the selected files.
 * The files must be under the     directory specified by dirURL. |destName|
 * Name of the destination zip file. The zip file will be created     under the
 * directory specified by dirURL. |callback|
 * @param {string} dirURL
 * @param {Array} selectionUrls
 * @param {string} destName
 * @param {Function=} callback
 */
chrome.fileManagerPrivate.zipSelection = function(dirURL, selectionUrls, destName, callback) {};

/**
 * Retrieves the state of the current drive connection. |callback|
 * @param {Function} callback
 */
chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};

/**
 * Checks whether the path name length fits in the limit of the filesystem.
 * |parent_directory_url| The URL of the parent directory entry. |name| The
 * name of the file. |callback| Called back when the check is finished.
 * @param {string} parent_directory_url
 * @param {string} name
 * @param {Function} callback |result| true if the length is in the valid
 * range, false otherwise.
 */
chrome.fileManagerPrivate.validatePathNameLength = function(parent_directory_url, name, callback) {};

/**
 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
 * @param {string} operation
 */
chrome.fileManagerPrivate.zoom = function(operation) {};

/**
 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
 * be refetched instead of using the cached     one. |callback|
 * @param {boolean} refresh
 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
 * string if failed to fetch.
 */
chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};

/**
 * Requests a Webstore API OAuth2 access token. |callback|
 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
 * string if failed to fetch.
 */
chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};

/**
 * Requests a share dialog url for the specified file. |url| Url for the file.
 * |callback|
 * @param {string} url
 * @param {Function} callback |url| Result url.
 */
chrome.fileManagerPrivate.getShareUrl = function(url, callback) {};

/**
 * Requests a download url to download the file contents. |url| Url for the
 * file. |callback|
 * @param {string} url
 * @param {Function} callback |url| Result url.
 */
chrome.fileManagerPrivate.getDownloadUrl = function(url, callback) {};

/**
 * Requests to share drive files. |url| URL of a file to be shared. |shareType|
 * Type of access that is getting granted.
 * @param {string} url
 * @param {string} shareType
 * @param {Function} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.requestDriveShare = function(url, shareType, callback) {};

/**
 * Requests to install a webstore item. |item_id| The id of the item to
 * install. |silentInstallation| False to show installation prompt. True not to
 * show. |callback|
 * @param {string} itemId
 * @param {boolean} silentInstallation
 * @param {Function} callback Callback that does not take arguments.
 */
chrome.fileManagerPrivate.installWebstoreItem = function(itemId, silentInstallation, callback) {};

/**
 * Obtains a list of profiles that are logged-in.
 * @param {Function} callback |profiles| List of profile information.
 * |runningProfile| ID of the profile that runs the application instance.
 * |showingProfile| ID of the profile that shows the application window.
 */
chrome.fileManagerPrivate.getProfiles = function(callback) {};

/**
 * Opens inspector window. |type| InspectionType which specifies how to open
 * inspector.
 * @param {string} type
 */
chrome.fileManagerPrivate.openInspector = function(type) {};

/**
 * Computes an MD5 checksum for the given file.
 * @param {string} fileUrl
 * @param {function(string)} callback
 */
chrome.fileManagerPrivate.computeChecksum = function(fileUrl, callback) {};

/**
 * Gets the MIME type of a file.
 * @param {string} fileUrl File url.
 * @param {function(string)} callback Callback that MIME type of the file is
 *     passed.
 */
chrome.fileManagerPrivate.getMimeType = function(fileUrl, callback) {};

/**
 * Gets a flag indicating whether user metrics reporting is enabled.
 * @param {function(boolean)} callback
 */
chrome.fileManagerPrivate.isUMAEnabled = function(callback) {};

/**
 * Sets a tag on a file or a directory. Only Drive files are supported.
 * @param {string} entryURL
 * @param {string} visibility 'private' or 'public'
 * @param {string} key
 * @param {string} value
 * @param {function()} callback
 */
chrome.fileManagerPrivate.setEntryTag = function(entryURL, visibility, key, value, callback) {};

/**
 * Gets a flag indicating whether PiexLoader is enabled.
 * @param {function(boolean)} callback
 */
chrome.fileManagerPrivate.isPiexLoaderEnabled = function(callback) {};

/**
 * Returns list of available providing extensions.
 * @param {function(!Array<!ProvidingExtension>)} callback
 */
chrome.fileManagerPrivate.getProvidingExtensions = function(callback) {};

/**
 * Requests adding a new provided file system. If not possible, then an error
 * via chrome.runtime.lastError is returned.
 * @param {string} extensionId
 * @param {function()} callback
 */
chrome.fileManagerPrivate.addProvidedFileSystem =
    function(extensionId, callback) {};

/**
 * Requests configuring an existing file system. If not possible, then returns
 * an error via chrome.runtime.lastError.
 * @param {string} volumeId
 * @param {function()} callback
 */
chrome.fileManagerPrivate.configureVolume = function(volumeId, callback) {};

/**
 * Requests fetching list of actions for the specified entry. If not possible,
 * then returns an error via chrome.runtime.lastError.
 * @param {string} entryUrl
 * @param {function(!Array<!EntryAction>)} callback
 */
chrome.fileManagerPrivate.getEntryActions = function(entryUrl, callback) {};

/**
 * Executes the action on the specified entry. If not possible, then returns an
 * error via chrome.runtime.lastError.
 * @param {string} entryUrl
 * @param {string} actionId
 * @param {function()} callback
 */
chrome.fileManagerPrivate.executeAction = function(
    entryUrl, actionId, callback) {};

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onMountCompleted;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onFileTransfersUpdated;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onCopyProgress;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onDirectoryChanged;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onPreferencesChanged;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onDriveConnectionStatusChanged;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onDeviceChanged;

/** @type {!ChromeEvent} */
chrome.fileManagerPrivate.onDriveSyncError;