Roll src/third_party/WebKit bf18a82:a9cee16 (svn 185297:185304)
[chromium-blink-merge.git] / third_party / closure_compiler / externs / file_manager_private.js
blobcc777dabacb6ead32fbaa0b34c6f3847def98605
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 /** @fileoverview Externs generated from namespace: fileManagerPrivate */
7 /**
8 * @typedef {{
9 * scale1xUrl: string,
10 * scale2xUrl: string
11 * }}
13 var ImageSet;
15 /**
16 * @typedef {{
17 * taskId: string,
18 * title: string,
19 * iconUrl: string,
20 * isDefault: boolean
21 * }}
23 var FileTask;
25 /**
26 * @typedef {{
27 * fileSize: (number|undefined),
28 * lastModifiedTime: (number|undefined),
29 * thumbnailUrl: (string|undefined),
30 * imageWidth: (number|undefined),
31 * imageHeight: (number|undefined),
32 * imageRotation: (number|undefined),
33 * isPinned: (boolean|undefined),
34 * isPresent: (boolean|undefined),
35 * isHosted: (boolean|undefined),
36 * isAvailableOffline: (boolean|undefined),
37 * isAvailableWhenMetered: (boolean|undefined),
38 * customIconUrl: (string|undefined),
39 * contentMimeType: (string|undefined),
40 * sharedWithMe: (boolean|undefined),
41 * shared: (boolean|undefined)
42 * }}
44 var EntryProperties;
46 /**
47 * @typedef {{
48 * totalSize: number,
49 * remainingSize: number
50 * }}
52 var MountPointSizeStats;
54 /**
55 * @typedef {{
56 * profileId: string,
57 * displayName: string,
58 * isCurrentProfile: boolean
59 * }}
61 var ProfileInfo;
63 /**
64 * @typedef {{
65 * volumeId: string,
66 * fileSystemId: (string|undefined),
67 * extensionId: (string|undefined),
68 * volumeLabel: (string|undefined),
69 * profile: ProfileInfo,
70 * sourcePath: (string|undefined),
71 * volumeType: string,
72 * deviceType: (string|undefined),
73 * devicePath: (string|undefined),
74 * isParentDevice: (boolean|undefined),
75 * isReadOnly: boolean,
76 * mountCondition: (string|undefined)
77 * }}
79 var VolumeMetadata;
81 /**
82 * @typedef {{
83 * eventType: string,
84 * status: string,
85 * volumeMetadata: VolumeMetadata,
86 * shouldNotify: boolean
87 * }}
89 var MountCompletedEvent;
91 /**
92 * @typedef {{
93 * fileUrl: string,
94 * transferState: string,
95 * transferType: string,
96 * processed: (number|undefined),
97 * total: (number|undefined),
98 * num_total_jobs: number
99 * }}
101 var FileTransferStatus;
104 * @typedef {{
105 * type: string,
106 * fileUrl: string
107 * }}
109 var DriveSyncErrorEvent;
112 * @typedef {{
113 * type: string,
114 * sourceUrl: (string|undefined),
115 * destinationUrl: (string|undefined),
116 * size: (number|undefined),
117 * error: (string|undefined)
118 * }}
120 var CopyProgressStatus;
123 * @typedef {{
124 * fileUrl: string,
125 * canceled: boolean
126 * }}
128 var FileTransferCancelStatus;
131 * @typedef {{
132 * url: string,
133 * changes: Array
134 * }}
136 var FileChange;
139 * @typedef {{
140 * eventType: string,
141 * entry: Object,
142 * changedFiles: (Array|undefined)
143 * }}
145 var FileWatchEvent;
148 * @typedef {{
149 * driveEnabled: boolean,
150 * cellularDisabled: boolean,
151 * hostedFilesDisabled: boolean,
152 * use24hourClock: boolean,
153 * allowRedeemOffers: boolean
154 * }}
156 var Preferences;
159 * @typedef {{
160 * cellularDisabled: (boolean|undefined),
161 * hostedFilesDisabled: (boolean|undefined)
162 * }}
164 var PreferencesChange;
167 * @typedef {{
168 * query: string,
169 * nextFeed: string
170 * }}
172 var SearchParams;
175 * @typedef {{
176 * query: string,
177 * types: string,
178 * maxResults: number
179 * }}
181 var SearchMetadataParams;
184 * @typedef {{
185 * entry: Object,
186 * highlightedBaseName: string
187 * }}
189 var SearchResult;
192 * @typedef {{
193 * type: string,
194 * reason: (string|undefined)
195 * }}
197 var DriveConnectionState;
200 * @typedef {{
201 * type: string,
202 * devicePath: string
203 * }}
205 var DeviceEvent;
208 * @const
210 chrome.fileManagerPrivate = {};
213 * Logout the current user for navigating to the re-authentication screen for
214 * the Google account.
216 chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};
219 * Cancels file selection.
221 chrome.fileManagerPrivate.cancelDialog = function() {};
224 * Executes file browser task over selected files. |taskId| The unique
225 * identifier of task to execute. |fileUrls| Array of file URLs |callback|
226 * @param {string} taskId
227 * @param {Array} fileUrls
228 * @param {Function=} callback |result| Result of the task execution.
230 chrome.fileManagerPrivate.executeTask = function(taskId, fileUrls, callback) {};
233 * Sets the default task for the supplied MIME types and suffixes of the
234 * supplied file URLs. Lists of MIME types and URLs may contain duplicates.
235 * |taskId| The unique identifier of task to mark as default. |fileUrls| Array
236 * of selected file URLs to extract suffixes from. |mimeTypes| Array of
237 * selected file MIME types. |callback|
238 * @param {string} taskId
239 * @param {Array} fileUrls
240 * @param {Array=} mimeTypes
241 * @param {Function=} callback Callback that does not take arguments.
243 chrome.fileManagerPrivate.setDefaultTask = function(taskId, fileUrls, mimeTypes, callback) {};
246 * Gets the list of tasks that can be performed over selected files. |fileUrls|
247 * Array of selected file URLs |callback|
248 * @param {Array} fileUrls
249 * @param {Function} callback |tasks| The list of matched file URL patterns for
250 * this task.
252 chrome.fileManagerPrivate.getFileTasks = function(fileUrls, callback) {};
255 * Gets localized strings and initialization data. |callback|
256 * @param {Function} callback |result| Hash containing the string assets.
258 chrome.fileManagerPrivate.getStrings = function(callback) {};
261 * Adds file watch. |fileUrl| URL of file to watch |callback|
262 * @param {string} fileUrl
263 * @param {Function} callback |success| True when file watch is successfully
264 * added.
266 chrome.fileManagerPrivate.addFileWatch = function(fileUrl, callback) {};
269 * Removes file watch. |fileUrl| URL of watched file to remove |callback|
270 * @param {string} fileUrl
271 * @param {Function} callback |success| True when file watch is successfully
272 * removed.
274 chrome.fileManagerPrivate.removeFileWatch = function(fileUrl, callback) {};
277 * Requests access to a file system volume. |volumeId| The ID of the file
278 * system volume to request. The volume ID is delivered to JavaScript as
279 * part of VolumeMetadata. By specifying "compatible", this function
280 * behaves in the compatible mode, where the returned FileSystem object
281 * gives access to all file system volumes such as Downloads folder and
282 * removal media like SD cards (i.e. all volumes are provided inside the
283 * single FileSystem object). In the new "per-volume FileSystem object
284 * model" crbug.com/322305, a separate FileSystem object is created for
285 * each volume. "compatible" parameter will be removed once Files.app is
286 * switched to the per-volume FileSystem object model. |callback|
287 * @param {string} volumeId
288 * @param {Function} callback |fileSystem| A DOMFileSystem instance for local
289 * file system access. null if the caller has no appropriate permissions.
291 chrome.fileManagerPrivate.requestFileSystem = function(volumeId, callback) {};
294 * Selects multiple files. |selectedPaths| Array of selected paths
295 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
296 * |callback|
297 * @param {Array} selectedPaths
298 * @param {boolean} shouldReturnLocalPath
299 * @param {Function} callback Callback that does not take arguments.
301 chrome.fileManagerPrivate.selectFiles = function(selectedPaths, shouldReturnLocalPath, callback) {};
304 * Selects a file. |selectedPath| A selected path |index| Index of Filter
305 * |forOpening| true if paths are selected for opening. false if for saving.
306 * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
307 * |callback|
308 * @param {string} selectedPath
309 * @param {number} index
310 * @param {boolean} forOpening
311 * @param {boolean} shouldReturnLocalPath
312 * @param {Function} callback Callback that does not take arguments.
314 chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening, shouldReturnLocalPath, callback) {};
317 * Requests additional properties for files. |fileUrls| list of URLs of files
318 * |callback|
319 * @param {Array} fileUrls
320 * @param {Function} callback |entryProperties| A dictionary containing
321 * properties of the requested entries.
323 chrome.fileManagerPrivate.getEntryProperties = function(fileUrls, callback) {};
326 * Pins/unpins a Drive file in the cache. |fileUrl| URL of a file to pin/unpin.
327 * |pin| Pass true to pin the file. |callback| Completion callback.
328 * $(ref:runtime.lastError) will be set if there was an error.
329 * @param {string} fileUrl
330 * @param {boolean} pin
331 * @param {Function=} callback Callback that does not take arguments.
333 chrome.fileManagerPrivate.pinDriveFile = function(fileUrl, pin, callback) {};
336 * Resolves file entries in the isolated file system and returns corresponding
337 * entries in the external file system mounted to Chrome OS file manager
338 * backend. If resolving entry fails, the entry will be just ignored and the
339 * corresponding entry does not appear in the result.
340 * @param {Array} entries
341 * @param {Function} callback |entryUrl| URL of an entry in a normal file
342 * system.
344 chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries, callback) {};
347 * Mount a resource or a file. |source| Mount point source. For compressed
348 * files it is relative file path within external file system |callback|
349 * @param {string} source
350 * @param {Function} callback |sourcePath| Source path of the mount.
352 chrome.fileManagerPrivate.addMount = function(source, callback) {};
355 * Unmounts a mounted resource. |volumeId| An ID of the volume.
356 * @param {string} volumeId
358 chrome.fileManagerPrivate.removeMount = function(volumeId) {};
361 * Get the list of mounted volumes. |callback|
362 * @param {Function} callback |volumeMetadataList| The list of VolumeMetadata
363 * representing mounted volumes.
365 chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
368 * Cancels ongoing file transfers for selected files. |fileUrls| Array of files
369 * for which ongoing transfer should be canceled. If this is absent, all
370 * jobs are canceled. |callback|
371 * @param {Array=} fileUrls
372 * @param {Function=} callback |fileTransferCancelStatuses| The list of
373 * FileTransferCancelStatus.
375 chrome.fileManagerPrivate.cancelFileTransfers = function(fileUrls, callback) {};
378 * Starts to copy an entry. If the source is a directory, the copy is done
379 * recursively. |sourceUrl| URL of the source entry to be copied. |parent| URL
380 * of the destination directory. |newName| Name of the new entry. It shouldn't
381 * contain '/'. |callback| Completion callback.
382 * @param {string} sourceUrl
383 * @param {string} parent
384 * @param {string} newName
385 * @param {Function} callback |copyId| ID of the copy task. Can be used to
386 * identify the progress, and to cancel the task.
388 chrome.fileManagerPrivate.startCopy = function(sourceUrl, parent, newName, callback) {};
391 * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
392 * |callback| Completion callback of the cancel.
393 * @param {number} copyId
394 * @param {Function=} callback Callback that does not take arguments.
396 chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
399 * Retrieves total and remaining size of a mount point. |volumeId| ID of the
400 * volume to be checked. |callback|
401 * @param {string} volumeId
402 * @param {Function} callback |sizeStats| Name/value pairs of size stats. Will
403 * be undefined if stats could not be determined.
405 chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
408 * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
409 * @param {string} volumeId
411 chrome.fileManagerPrivate.formatVolume = function(volumeId) {};
414 * Retrieves file manager preferences. |callback|
415 * @param {Function} callback
417 chrome.fileManagerPrivate.getPreferences = function(callback) {};
420 * Sets file manager preferences. |changeInfo|
421 * @param {PreferencesChange} changeInfo
423 chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
426 * Performs drive content search. |searchParams| |callback|
427 * @param {SearchParams} searchParams
428 * @param {Function} callback |entries| |nextFeed| ID of the feed that contains
429 * next chunk of the search result. Should be sent to the next searchDrive
430 * request to perform incremental search.
432 chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
435 * Performs drive metadata search. |searchParams| |callback|
436 * @param {SearchMetadataParams} searchParams
437 * @param {Function} callback
439 chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback) {};
442 * Create a zip file for the selected files. |dirURL| URL of the directory
443 * containing the selected files. |selectionUrls| URLs of the selected files.
444 * The files must be under the directory specified by dirURL. |destName|
445 * Name of the destination zip file. The zip file will be created under the
446 * directory specified by dirURL. |callback|
447 * @param {string} dirURL
448 * @param {Array} selectionUrls
449 * @param {string} destName
450 * @param {Function=} callback
452 chrome.fileManagerPrivate.zipSelection = function(dirURL, selectionUrls, destName, callback) {};
455 * Retrieves the state of the current drive connection. |callback|
456 * @param {Function} callback
458 chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
461 * Checks whether the path name length fits in the limit of the filesystem.
462 * |parent_directory_url| The URL of the parent directory entry. |name| The
463 * name of the file. |callback| Called back when the check is finished.
464 * @param {string} parent_directory_url
465 * @param {string} name
466 * @param {Function} callback |result| true if the length is in the valid
467 * range, false otherwise.
469 chrome.fileManagerPrivate.validatePathNameLength = function(parent_directory_url, name, callback) {};
472 * Changes the zoom factor of the Files.app. |operation| Zooming mode.
473 * @param {string} operation
475 chrome.fileManagerPrivate.zoom = function(operation) {};
478 * Requests a Drive API OAuth2 access token. |refresh| Whether the token should
479 * be refetched instead of using the cached one. |callback|
480 * @param {boolean} refresh
481 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
482 * string if failed to fetch.
484 chrome.fileManagerPrivate.requestAccessToken = function(refresh, callback) {};
487 * Requests a Webstore API OAuth2 access token. |callback|
488 * @param {Function} callback |accessToken| OAuth2 access token, or an empty
489 * string if failed to fetch.
491 chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
494 * Requests a share dialog url for the specified file. |url| Url for the file.
495 * |callback|
496 * @param {string} url
497 * @param {Function} callback |url| Result url.
499 chrome.fileManagerPrivate.getShareUrl = function(url, callback) {};
502 * Requests a download url to download the file contents. |url| Url for the
503 * file. |callback|
504 * @param {string} url
505 * @param {Function} callback |url| Result url.
507 chrome.fileManagerPrivate.getDownloadUrl = function(url, callback) {};
510 * Requests to share drive files. |url| URL of a file to be shared. |shareType|
511 * Type of access that is getting granted.
512 * @param {string} url
513 * @param {string} shareType
514 * @param {Function} callback Callback that does not take arguments.
516 chrome.fileManagerPrivate.requestDriveShare = function(url, shareType, callback) {};
519 * Requests to install a webstore item. |item_id| The id of the item to
520 * install. |silentInstallation| False to show installation prompt. True not to
521 * show. |callback|
522 * @param {string} itemId
523 * @param {boolean} silentInstallation
524 * @param {Function} callback Callback that does not take arguments.
526 chrome.fileManagerPrivate.installWebstoreItem = function(itemId, silentInstallation, callback) {};
529 * Obtains a list of profiles that are logged-in.
530 * @param {Function} callback |profiles| List of profile information.
531 * |runningProfile| ID of the profile that runs the application instance.
532 * |showingProfile| ID of the profile that shows the application window.
534 chrome.fileManagerPrivate.getProfiles = function(callback) {};
537 * Moves the window to other user's desktop.
538 * @param {string} profileId
539 * @param {Function=} callback Callback that does not take arguments.
541 chrome.fileManagerPrivate.visitDesktop = function(profileId, callback) {};
544 * Opens inspector window. |type| InspectionType which specifies how to open
545 * inspector.
546 * @param {string} type
548 chrome.fileManagerPrivate.openInspector = function(type) {};
550 /** @type {!ChromeEvent} */
551 chrome.fileManagerPrivate.onMountCompleted;
553 /** @type {!ChromeEvent} */
554 chrome.fileManagerPrivate.onFileTransfersUpdated;
556 /** @type {!ChromeEvent} */
557 chrome.fileManagerPrivate.onCopyProgress;
559 /** @type {!ChromeEvent} */
560 chrome.fileManagerPrivate.onDirectoryChanged;
562 /** @type {!ChromeEvent} */
563 chrome.fileManagerPrivate.onPreferencesChanged;
565 /** @type {!ChromeEvent} */
566 chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
568 /** @type {!ChromeEvent} */
569 chrome.fileManagerPrivate.onDeviceChanged;
571 /** @type {!ChromeEvent} */
572 chrome.fileManagerPrivate.onDriveSyncError;