file_manager_private.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595
  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.
  4. /** @fileoverview Externs generated from namespace: fileManagerPrivate */
  5. /** @const */
  6. chrome.fileManagerPrivate = {};
  7. /** @enum {string} */
  8. chrome.fileManagerPrivate.VolumeType = {
  9. DRIVE: 'drive',
  10. DOWNLOADS: 'downloads',
  11. REMOVABLE: 'removable',
  12. ARCHIVE: 'archive',
  13. PROVIDED: 'provided',
  14. MTP: 'mtp',
  15. MEDIA_VIEW: 'media_view',
  16. CROSTINI: 'crostini',
  17. ANDROID_FILES: 'android_files',
  18. DOCUMENTS_PROVIDER: 'documents_provider',
  19. TESTING: 'testing',
  20. SMB: 'smb',
  21. SYSTEM_INTERNAL: 'system_internal',
  22. GUEST_OS: 'guest_os',
  23. };
  24. /** @enum {string} */
  25. chrome.fileManagerPrivate.DeviceType = {
  26. USB: 'usb',
  27. SD: 'sd',
  28. OPTICAL: 'optical',
  29. MOBILE: 'mobile',
  30. UNKNOWN: 'unknown',
  31. };
  32. /**
  33. * @enum {string}
  34. */
  35. chrome.fileManagerPrivate.DriveConnectionStateType = {
  36. OFFLINE: 'OFFLINE',
  37. METERED: 'METERED',
  38. ONLINE: 'ONLINE',
  39. };
  40. /**
  41. * @enum {string}
  42. */
  43. chrome.fileManagerPrivate.DriveOfflineReason = {
  44. NOT_READY: 'NOT_READY',
  45. NO_NETWORK: 'NO_NETWORK',
  46. NO_SERVICE: 'NO_SERVICE',
  47. };
  48. /** @enum {string} */
  49. chrome.fileManagerPrivate.MountCondition = {
  50. UNKNOWN: 'unknown',
  51. UNSUPPORTED: 'unsupported',
  52. };
  53. /** @enum {string} */
  54. chrome.fileManagerPrivate.MountContext = {
  55. USER: 'user',
  56. AUTO: 'auto',
  57. };
  58. /** @enum {string} */
  59. chrome.fileManagerPrivate.MountCompletedEventType = {
  60. MOUNT: 'mount',
  61. UNMOUNT: 'unmount',
  62. };
  63. /** @enum {string} */
  64. chrome.fileManagerPrivate.MountCompletedStatus = {
  65. SUCCESS: 'success',
  66. ERROR_UNKNOWN: 'error_unknown',
  67. ERROR_INTERNAL: 'error_internal',
  68. ERROR_INVALID_ARGUMENT: 'error_invalid_argument',
  69. ERROR_INVALID_PATH: 'error_invalid_path',
  70. ERROR_PATH_ALREADY_MOUNTED: 'error_path_already_mounted',
  71. ERROR_PATH_NOT_MOUNTED: 'error_path_not_mounted',
  72. ERROR_DIRECTORY_CREATION_FAILED: 'error_directory_creation_failed',
  73. ERROR_INVALID_MOUNT_OPTIONS: 'error_invalid_mount_options',
  74. ERROR_INVALID_UNMOUNT_OPTIONS: 'error_invalid_unmount_options',
  75. ERROR_INSUFFICIENT_PERMISSIONS: 'error_insufficient_permissions',
  76. ERROR_MOUNT_PROGRAM_NOT_FOUND: 'error_mount_program_not_found',
  77. ERROR_MOUNT_PROGRAM_FAILED: 'error_mount_program_failed',
  78. ERROR_INVALID_DEVICE_PATH: 'error_invalid_device_path',
  79. ERROR_UNKNOWN_FILESYSTEM: 'error_unknown_filesystem',
  80. ERROR_UNSUPPORTED_FILESYSTEM: 'error_unsupported_filesystem',
  81. ERROR_INVALID_ARCHIVE: 'error_invalid_archive',
  82. ERROR_NEED_PASSWORD: 'error_need_password',
  83. ERROR_IN_PROGRESS: 'error_in_progress',
  84. ERROR_CANCELLED: 'error_cancelled',
  85. };
  86. /** @enum {string} */
  87. chrome.fileManagerPrivate.FormatFileSystemType = {
  88. VFAT: 'vfat',
  89. EXFAT: 'exfat',
  90. NTFS: 'ntfs',
  91. };
  92. /** @enum {string} */
  93. chrome.fileManagerPrivate.TransferState = {
  94. IN_PROGRESS: 'in_progress',
  95. COMPLETED: 'completed',
  96. FAILED: 'failed',
  97. };
  98. /** @enum {string} */
  99. chrome.fileManagerPrivate.CopyOrMoveProgressStatusType = {
  100. BEGIN: 'begin',
  101. PROGRESS: 'progress',
  102. END_COPY: 'end_copy',
  103. END_MOVE: 'end_move',
  104. END_REMOVE_SOURCE: 'end_remove_source',
  105. SUCCESS: 'success',
  106. ERROR: 'error',
  107. };
  108. /** @enum {string} */
  109. chrome.fileManagerPrivate.FileWatchEventType = {
  110. CHANGED: 'changed',
  111. ERROR: 'error',
  112. };
  113. /** @enum {string} */
  114. chrome.fileManagerPrivate.ChangeType = {
  115. ADD_OR_UPDATE: 'add_or_update',
  116. DELETE: 'delete',
  117. };
  118. /** @enum {string} */
  119. chrome.fileManagerPrivate.SearchType = {
  120. EXCLUDE_DIRECTORIES: 'EXCLUDE_DIRECTORIES',
  121. SHARED_WITH_ME: 'SHARED_WITH_ME',
  122. OFFLINE: 'OFFLINE',
  123. ALL: 'ALL',
  124. };
  125. /** @enum {string} */
  126. chrome.fileManagerPrivate.ZoomOperationType = {
  127. IN: 'in',
  128. OUT: 'out',
  129. RESET: 'reset',
  130. };
  131. /** @enum {string} */
  132. chrome.fileManagerPrivate.InspectionType = {
  133. NORMAL: 'normal',
  134. CONSOLE: 'console',
  135. ELEMENT: 'element',
  136. BACKGROUND: 'background',
  137. };
  138. /** @enum {string} */
  139. chrome.fileManagerPrivate.DeviceEventType = {
  140. DISABLED: 'disabled',
  141. REMOVED: 'removed',
  142. HARD_UNPLUGGED: 'hard_unplugged',
  143. FORMAT_START: 'format_start',
  144. FORMAT_SUCCESS: 'format_success',
  145. FORMAT_FAIL: 'format_fail',
  146. RENAME_START: 'rename_start',
  147. RENAME_SUCCESS: 'rename_success',
  148. RENAME_FAIL: 'rename_fail',
  149. PARTITION_START: 'partition_start',
  150. PARTITION_SUCCESS: 'partition_success',
  151. PARTITION_FAIL: 'partition_fail',
  152. };
  153. /** @enum {string} */
  154. chrome.fileManagerPrivate.DriveSyncErrorType = {
  155. DELETE_WITHOUT_PERMISSION: 'delete_without_permission',
  156. SERVICE_UNAVAILABLE: 'service_unavailable',
  157. NO_SERVER_SPACE: 'no_server_space',
  158. NO_SERVER_SPACE_ORGANIZATION: 'no_server_space_organization',
  159. NO_LOCAL_SPACE: 'no_local_space',
  160. MISC: 'misc',
  161. };
  162. /** @enum {string} */
  163. chrome.fileManagerPrivate.DriveConfirmDialogType = {
  164. ENABLE_DOCS_OFFLINE: 'enable_docs_offline',
  165. };
  166. /** @enum {string} */
  167. chrome.fileManagerPrivate.DriveDialogResult = {
  168. NOT_DISPLAYED: 'not_displayed',
  169. ACCEPT: 'accept',
  170. REJECT: 'reject',
  171. DISMISS: 'dismiss',
  172. };
  173. /** @enum {string} */
  174. chrome.fileManagerPrivate.TaskResult = {
  175. OPENED: 'opened',
  176. MESSAGE_SENT: 'message_sent',
  177. FAILED: 'failed',
  178. EMPTY: 'empty',
  179. FAILED_PLUGIN_VM_DIRECTORY_NOT_SHARED:
  180. 'failed_plugin_vm_directory_not_shared',
  181. };
  182. /** @enum {string} */
  183. chrome.fileManagerPrivate.DriveShareType = {
  184. CAN_EDIT: 'can_edit',
  185. CAN_COMMENT: 'can_comment',
  186. CAN_VIEW: 'can_view',
  187. };
  188. /** @enum {string} */
  189. chrome.fileManagerPrivate.EntryPropertyName = {
  190. SIZE: 'size',
  191. MODIFICATION_TIME: 'modificationTime',
  192. MODIFICATION_BY_ME_TIME: 'modificationByMeTime',
  193. THUMBNAIL_URL: 'thumbnailUrl',
  194. CROPPED_THUMBNAIL_URL: 'croppedThumbnailUrl',
  195. IMAGE_WIDTH: 'imageWidth',
  196. IMAGE_HEIGHT: 'imageHeight',
  197. IMAGE_ROTATION: 'imageRotation',
  198. PINNED: 'pinned',
  199. PRESENT: 'present',
  200. HOSTED: 'hosted',
  201. AVAILABLE_OFFLINE: 'availableOffline',
  202. AVAILABLE_WHEN_METERED: 'availableWhenMetered',
  203. DIRTY: 'dirty',
  204. CUSTOM_ICON_URL: 'customIconUrl',
  205. CONTENT_MIME_TYPE: 'contentMimeType',
  206. SHARED_WITH_ME: 'sharedWithMe',
  207. SHARED: 'shared',
  208. STARRED: 'starred',
  209. EXTERNAL_FILE_URL: 'externalFileUrl',
  210. ALTERNATE_URL: 'alternateUrl',
  211. SHARE_URL: 'shareUrl',
  212. CAN_COPY: 'canCopy',
  213. CAN_DELETE: 'canDelete',
  214. CAN_RENAME: 'canRename',
  215. CAN_ADD_CHILDREN: 'canAddChildren',
  216. CAN_SHARE: 'canShare',
  217. CAN_PIN: 'canPin',
  218. IS_MACHINE_ROOT: 'isMachineRoot',
  219. IS_EXTERNAL_MEDIA: 'isExternalMedia',
  220. IS_ARBITRARY_SYNC_FOLDER: 'isArbitrarySyncFolder',
  221. };
  222. /** @enum {string} */
  223. chrome.fileManagerPrivate.EntryTagVisibility = {
  224. PRIVATE: 'private',
  225. PUBLIC: 'public',
  226. };
  227. /** @enum {string} */
  228. chrome.fileManagerPrivate.Source = {
  229. FILE: 'file',
  230. DEVICE: 'device',
  231. NETWORK: 'network',
  232. SYSTEM: 'system',
  233. };
  234. /** @enum {string} */
  235. chrome.fileManagerPrivate.Verb = {
  236. OPEN_WITH: 'open_with',
  237. ADD_TO: 'add_to',
  238. PACK_WITH: 'pack_with',
  239. SHARE_WITH: 'share_with',
  240. };
  241. /** @enum {string} */
  242. chrome.fileManagerPrivate.SourceRestriction = {
  243. ANY_SOURCE: 'any_source',
  244. NATIVE_SOURCE: 'native_source',
  245. };
  246. /** @enum {string} */
  247. chrome.fileManagerPrivate.RecentFileType = {
  248. ALL: 'all',
  249. AUDIO: 'audio',
  250. IMAGE: 'image',
  251. VIDEO: 'video',
  252. DOCUMENT: 'document',
  253. };
  254. /** @enum {string} */
  255. chrome.fileManagerPrivate.InstallLinuxPackageResponse = {
  256. STARTED: 'started',
  257. FAILED: 'failed',
  258. INSTALL_ALREADY_ACTIVE: 'install_already_active',
  259. };
  260. /** @enum {string} */
  261. chrome.fileManagerPrivate.CrostiniEventType = {
  262. ENABLE: 'enable',
  263. DISABLE: 'disable',
  264. SHARE: 'share',
  265. UNSHARE: 'unshare',
  266. DROP_FAILED_PLUGIN_VM_DIRECTORY_NOT_SHARED:
  267. 'drop_failed_plugin_vm_directory_not_shared',
  268. };
  269. /** @enum {string} */
  270. chrome.fileManagerPrivate.SharesheetLaunchSource = {
  271. CONTEXT_MENU: 'context_menu',
  272. SHARESHEET_BUTTON: 'sharesheet_button',
  273. UNKNOWN: 'unknown',
  274. };
  275. /** @enum {string} */
  276. chrome.fileManagerPrivate.IOTaskState = {
  277. QUEUED: 'queued',
  278. IN_PROGRESS: 'in_progress',
  279. SUCCESS: 'success',
  280. ERROR: 'error',
  281. NEED_PASSWORD: 'need_password',
  282. CANCELLED: 'cancelled',
  283. };
  284. /** @enum {string} */
  285. chrome.fileManagerPrivate.IOTaskType = {
  286. COPY: 'copy',
  287. DELETE: 'delete',
  288. EMPTY_TRASH: 'empty_trash',
  289. EXTRACT: 'extract',
  290. MOVE: 'move',
  291. RESTORE: 'restore',
  292. TRASH: 'trash',
  293. ZIP: 'zip',
  294. };
  295. /** @enum {string} */
  296. chrome.fileManagerPrivate.RecentDateBucket = {
  297. TODAY: 'today',
  298. YESTERDAY: 'yesterday',
  299. EARLIER_THIS_WEEK: 'earlier_this_week',
  300. EARLIER_THIS_MONTH: 'earlier_this_month',
  301. EARLIER_THIS_YEAR: 'earlier_this_year',
  302. OLDER: 'older',
  303. };
  304. /** @enum {string} */
  305. chrome.fileManagerPrivate.VmType = {
  306. TERMINA: 'termina',
  307. PLUGIN_VM: 'plugin_vm',
  308. BOREALIS: 'borealis',
  309. BRUSCHETTA: 'bruschetta',
  310. ARCVM: 'arcvm',
  311. };
  312. /** @enum {string} */
  313. chrome.fileManagerPrivate.UserType = {
  314. UNMANAGED: 'kUnmanaged',
  315. ORGANIZATION: 'kOrganization'
  316. };
  317. /**
  318. * @typedef {{
  319. * appId: string,
  320. * taskType: string,
  321. * actionId: string
  322. * }}
  323. */
  324. chrome.fileManagerPrivate.FileTaskDescriptor;
  325. /**
  326. * @typedef {{
  327. * descriptor: !chrome.fileManagerPrivate.FileTaskDescriptor,
  328. * title: string,
  329. * verb: (!chrome.fileManagerPrivate.Verb|undefined),
  330. * iconUrl: (string|undefined),
  331. * isDefault: (boolean|undefined),
  332. * isGenericFileHandler: (boolean|undefined)
  333. * }}
  334. */
  335. chrome.fileManagerPrivate.FileTask;
  336. /**
  337. * @typedef {{
  338. * size: (number|undefined),
  339. * modificationTime: (number|undefined),
  340. * modificationByMeTime: (number|undefined),
  341. * thumbnailUrl: (string|undefined),
  342. * croppedThumbnailUrl: (string|undefined),
  343. * imageWidth: (number|undefined),
  344. * imageHeight: (number|undefined),
  345. * imageRotation: (number|undefined),
  346. * pinned: (boolean|undefined),
  347. * present: (boolean|undefined),
  348. * hosted: (boolean|undefined),
  349. * availableOffline: (boolean|undefined),
  350. * availableWhenMetered: (boolean|undefined),
  351. * dirty: (boolean|undefined),
  352. * customIconUrl: (string|undefined),
  353. * contentMimeType: (string|undefined),
  354. * sharedWithMe: (boolean|undefined),
  355. * shared: (boolean|undefined),
  356. * starred: (boolean|undefined),
  357. * externalFileUrl: (string|undefined),
  358. * alternateUrl: (string|undefined),
  359. * shareUrl: (string|undefined),
  360. * canCopy: (boolean|undefined),
  361. * canDelete: (boolean|undefined),
  362. * canRename: (boolean|undefined),
  363. * canAddChildren: (boolean|undefined),
  364. * canShare: (boolean|undefined),
  365. * canPin: (boolean|undefined),
  366. * isMachineRoot: (boolean|undefined),
  367. * isExternalMedia: (boolean|undefined),
  368. * isArbitrarySyncFolder: (boolean|undefined)
  369. * }}
  370. */
  371. chrome.fileManagerPrivate.EntryProperties;
  372. /**
  373. * @typedef {{
  374. * totalSize: number,
  375. * remainingSize: number
  376. * }}
  377. */
  378. chrome.fileManagerPrivate.MountPointSizeStats;
  379. /**
  380. * @typedef {{
  381. * userType: !chrome.fileManagerPrivate.UserType,
  382. * usedUserBytes: number,
  383. * totalUserBytes: number,
  384. * organizationLimitExceeded: boolean,
  385. * organizationName: string
  386. * }}
  387. */
  388. chrome.fileManagerPrivate.DriveQuotaMetadata;
  389. /**
  390. * @typedef {{
  391. * profileId: string,
  392. * displayName: string,
  393. * isCurrentProfile: boolean
  394. * }}
  395. */
  396. chrome.fileManagerPrivate.ProfileInfo;
  397. /**
  398. * @typedef {{
  399. * icon16x16Url: (string|undefined),
  400. * icon32x32Url: (string|undefined)
  401. * }}
  402. */
  403. chrome.fileManagerPrivate.IconSet;
  404. /**
  405. * @typedef {{
  406. * volumeId: string,
  407. * fileSystemId: (string|undefined),
  408. * providerId: (string|undefined),
  409. * source: !chrome.fileManagerPrivate.Source,
  410. * volumeLabel: (string|undefined),
  411. * profile: !chrome.fileManagerPrivate.ProfileInfo,
  412. * sourcePath: (string|undefined),
  413. * volumeType: !chrome.fileManagerPrivate.VolumeType,
  414. * deviceType: (!chrome.fileManagerPrivate.DeviceType|undefined),
  415. * devicePath: (string|undefined),
  416. * isParentDevice: (boolean|undefined),
  417. * isReadOnly: boolean,
  418. * isReadOnlyRemovableDevice: boolean,
  419. * hasMedia: boolean,
  420. * configurable: boolean,
  421. * watchable: boolean,
  422. * mountCondition: (!chrome.fileManagerPrivate.MountCondition|undefined),
  423. * mountContext: (!chrome.fileManagerPrivate.MountContext|undefined),
  424. * diskFileSystemType: (string|undefined),
  425. * iconSet: !chrome.fileManagerPrivate.IconSet,
  426. * driveLabel: (string|undefined),
  427. * remoteMountPath: (string|undefined)
  428. * }}
  429. */
  430. chrome.fileManagerPrivate.VolumeMetadata;
  431. /**
  432. * @typedef {{
  433. * eventType: !chrome.fileManagerPrivate.MountCompletedEventType,
  434. * status: !chrome.fileManagerPrivate.MountCompletedStatus,
  435. * volumeMetadata: !chrome.fileManagerPrivate.VolumeMetadata,
  436. * shouldNotify: boolean
  437. * }}
  438. */
  439. chrome.fileManagerPrivate.MountCompletedEvent;
  440. /**
  441. * @typedef {{
  442. * fileUrl: string,
  443. * transferState: !chrome.fileManagerPrivate.TransferState,
  444. * processed: number,
  445. * total: number,
  446. * numTotalJobs: number,
  447. * hideWhenZeroJobs: boolean
  448. * }}
  449. */
  450. chrome.fileManagerPrivate.FileTransferStatus;
  451. /**
  452. * @typedef {{
  453. * type: !chrome.fileManagerPrivate.DriveSyncErrorType,
  454. * fileUrl: string
  455. * }}
  456. */
  457. chrome.fileManagerPrivate.DriveSyncErrorEvent;
  458. /**
  459. * @typedef {{
  460. * type: !chrome.fileManagerPrivate.DriveConfirmDialogType,
  461. * fileUrl: string
  462. * }}
  463. */
  464. chrome.fileManagerPrivate.DriveConfirmDialogEvent;
  465. /**
  466. * @typedef {{
  467. * type: !chrome.fileManagerPrivate.CopyOrMoveProgressStatusType,
  468. * sourceUrl: (string|undefined),
  469. * destinationUrl: (string|undefined),
  470. * size: (number|undefined),
  471. * error: (string|undefined)
  472. * }}
  473. */
  474. chrome.fileManagerPrivate.CopyOrMoveProgressStatus;
  475. /**
  476. * @typedef {{
  477. * url: string,
  478. * changes: !Array<!chrome.fileManagerPrivate.ChangeType>
  479. * }}
  480. */
  481. chrome.fileManagerPrivate.FileChange;
  482. /**
  483. * @typedef {{
  484. * eventType: !chrome.fileManagerPrivate.FileWatchEventType,
  485. * entry: Object,
  486. * changedFiles: (!Array<!chrome.fileManagerPrivate.FileChange>|undefined)
  487. * }}
  488. */
  489. chrome.fileManagerPrivate.FileWatchEvent;
  490. /**
  491. * @typedef {{
  492. * driveEnabled: boolean,
  493. * cellularDisabled: boolean,
  494. * searchSuggestEnabled: boolean,
  495. * use24hourClock: boolean,
  496. * timezone: string,
  497. * arcEnabled: boolean,
  498. * arcRemovableMediaAccessEnabled: boolean,
  499. * folderShortcuts: !Array<string>
  500. * }}
  501. */
  502. chrome.fileManagerPrivate.Preferences;
  503. /**
  504. * @typedef {{
  505. * cellularDisabled: (boolean|undefined),
  506. * arcEnabled: (boolean|undefined),
  507. * arcRemovableMediaAccessEnabled: (boolean|undefined),
  508. * folderShortcuts: (!Array<string>|undefined)
  509. * }}
  510. */
  511. chrome.fileManagerPrivate.PreferencesChange;
  512. /**
  513. * @typedef {{
  514. * query: string,
  515. * nextFeed: string
  516. * }}
  517. */
  518. chrome.fileManagerPrivate.SearchParams;
  519. /**
  520. * @typedef {{
  521. * query: string,
  522. * types: !chrome.fileManagerPrivate.SearchType,
  523. * maxResults: number
  524. * }}
  525. */
  526. chrome.fileManagerPrivate.SearchMetadataParams;
  527. /**
  528. * @typedef {{
  529. * entry: Entry,
  530. * highlightedBaseName: string,
  531. * availableOffline: (boolean|undefined)
  532. * }}
  533. */
  534. chrome.fileManagerPrivate.DriveMetadataSearchResult;
  535. /**
  536. * @typedef {{
  537. * type: !chrome.fileManagerPrivate.DriveConnectionStateType,
  538. * reason: (!chrome.fileManagerPrivate.DriveOfflineReason|undefined),
  539. * hasCellularNetworkAccess: boolean,
  540. * canPinHostedFiles: boolean
  541. * }}
  542. */
  543. chrome.fileManagerPrivate.DriveConnectionState;
  544. /**
  545. * @typedef {{
  546. * type: !chrome.fileManagerPrivate.DeviceEventType,
  547. * devicePath: string,
  548. * deviceLabel: string
  549. * }}
  550. */
  551. chrome.fileManagerPrivate.DeviceEvent;
  552. /**
  553. * @typedef {{
  554. * providerId: string,
  555. * iconSet: !chrome.fileManagerPrivate.IconSet,
  556. * name: string,
  557. * configurable: boolean,
  558. * watchable: boolean,
  559. * multipleMounts: boolean,
  560. * source: string
  561. * }}
  562. */
  563. chrome.fileManagerPrivate.Provider;
  564. /**
  565. * @typedef {{
  566. * name: string,
  567. * version: string,
  568. * summary: (string|undefined),
  569. * description: (string|undefined),
  570. * }}
  571. */
  572. chrome.fileManagerPrivate.LinuxPackageInfo;
  573. /**
  574. * @typedef {{
  575. * id: number,
  576. * displayName: string,
  577. * vmType: !chrome.fileManagerPrivate.VmType,
  578. * }}
  579. */
  580. chrome.fileManagerPrivate.MountableGuest;
  581. /**
  582. * @typedef {{
  583. * eventType: chrome.fileManagerPrivate.CrostiniEventType,
  584. * vmName: string,
  585. * entries: !Array<!Entry>,
  586. * }}
  587. */
  588. chrome.fileManagerPrivate.CrostiniEvent;
  589. /**
  590. * @typedef {{
  591. * name: string,
  592. * packageName: string,
  593. * activityName: string,
  594. * iconSet: !chrome.fileManagerPrivate.IconSet
  595. * }}
  596. */
  597. chrome.fileManagerPrivate.AndroidApp;
  598. /**
  599. * @typedef {{
  600. * type: string,
  601. * tags: !Object,
  602. * }}
  603. */
  604. chrome.fileManagerPrivate.StreamInfo;
  605. /**
  606. * @typedef {{
  607. * data: string,
  608. * type: string,
  609. * }}
  610. */
  611. chrome.fileManagerPrivate.AttachedImages;
  612. /**
  613. * @typedef {{
  614. * mimeType: string,
  615. * height: (number|undefined),
  616. * width: (number|undefined),
  617. * duration: (number|undefined),
  618. * rotation: (number|undefined),
  619. * album: (string|undefined),
  620. * artist: (string|undefined),
  621. * comment: (string|undefined),
  622. * copyright: (string|undefined),
  623. * disc: (number|undefined),
  624. * genre: (string|undefined),
  625. * language: (string|undefined),
  626. * title: (string|undefined),
  627. * track: (number|undefined),
  628. * rawTags: !Array<!chrome.fileManagerPrivate.StreamInfo>,
  629. * attachedImages: !Array<!chrome.fileManagerPrivate.AttachedImages>,
  630. * }}
  631. */
  632. chrome.fileManagerPrivate.MediaMetadata;
  633. /**
  634. * @typedef {{
  635. * itemUrls: !Array<string>
  636. * }}
  637. */
  638. chrome.fileManagerPrivate.HoldingSpaceState;
  639. /**
  640. * @typedef {{
  641. * currentDirectoryURL: (string|undefined),
  642. * selectionURL: (string|undefined)
  643. * }}
  644. */
  645. chrome.fileManagerPrivate.OpenWindowParams;
  646. /**
  647. * @typedef {{
  648. * volumeId: string,
  649. * writable: boolean,
  650. * }}
  651. */
  652. chrome.fileManagerPrivate.GetVolumeRootOptions;
  653. /**
  654. * @typedef {{
  655. * destinationFolder: (DirectoryEntry|undefined),
  656. * password: (string|undefined),
  657. * }}
  658. */
  659. chrome.fileManagerPrivate.IOTaskParams;
  660. /**
  661. * @typedef {{
  662. * type: !chrome.fileManagerPrivate.IOTaskType,
  663. * state: !chrome.fileManagerPrivate.IOTaskState,
  664. * numRemainingItems: number,
  665. * itemCount: number,
  666. * bytesTransferred: number,
  667. * sourceName: string,
  668. * destinationName: string,
  669. * totalBytes: number,
  670. * taskId: number,
  671. * remainingSeconds: number,
  672. * errorName: string,
  673. * outputs: (Array<Entry>|undefined),
  674. * }}
  675. */
  676. chrome.fileManagerPrivate.ProgressStatus;
  677. /**
  678. * @typedef {{
  679. * sourceUrl: string,
  680. * isDlpRestricted: boolean,
  681. * }}
  682. */
  683. chrome.fileManagerPrivate.DlpMetadata;
  684. /** @enum {string} */
  685. chrome.fileManagerPrivate.DlpLevel = {
  686. BLOCK: 'block',
  687. ALLOW: 'allow',
  688. };
  689. /**
  690. * @typedef {{
  691. * level: chrome.fileManagerPrivate.DlpLevel,
  692. * urls: !Array<string>,
  693. * components: !Array<chrome.fileManagerPrivate.VolumeType>,
  694. * }}
  695. */
  696. chrome.fileManagerPrivate.DlpRestrictionDetails;
  697. /**
  698. * @typedef {{
  699. * restoreEntry: !Entry,
  700. * trashInfoFileName: string,
  701. * deletionDate: Date,
  702. * }}
  703. */
  704. chrome.fileManagerPrivate.ParsedTrashInfoFile;
  705. /**
  706. * Logout the current user for navigating to the re-authentication screen for
  707. * the Google account.
  708. */
  709. chrome.fileManagerPrivate.logoutUserForReauthentication = function() {};
  710. /**
  711. * Cancels file selection.
  712. */
  713. chrome.fileManagerPrivate.cancelDialog = function() {};
  714. /**
  715. * Executes file browser task over selected files. |descriptor| The unique
  716. * identifier of task to execute. |entries| Array of file entries |callback|
  717. * @param {!chrome.fileManagerPrivate.FileTaskDescriptor} descriptor
  718. * @param {!Array<!Entry>} entries
  719. * @param {function(!chrome.fileManagerPrivate.TaskResult)} callback |result|
  720. * Result of the task execution.
  721. */
  722. chrome.fileManagerPrivate.executeTask = function(descriptor, entries, callback) {};
  723. /**
  724. * Sets the default task for the supplied MIME types and path extensions. Lists
  725. * of MIME types and entries may contain duplicates. |descriptor| The unique
  726. * identifier of task to mark as default. |entries| Array of selected file
  727. * entries to extract path extensions from. |mimeTypes| Array of selected file
  728. * MIME types. |callback|
  729. * @param {!chrome.fileManagerPrivate.FileTaskDescriptor} descriptor
  730. * @param {!Array<!Entry>} entries
  731. * @param {!Array<string>} mimeTypes
  732. * @param {!function()} callback Callback that does not take arguments.
  733. */
  734. chrome.fileManagerPrivate.setDefaultTask = function(descriptor, entries, mimeTypes,
  735. callback) {};
  736. /**
  737. * Gets the list of tasks that can be performed over selected files. |entries|
  738. * Array of selected entries |callback|
  739. * @param {!Array<!Entry>} entries
  740. * @param {function((!Array<!chrome.fileManagerPrivate.FileTask>|undefined))}
  741. * callback |tasks| The list of matched file entries for this task.
  742. */
  743. chrome.fileManagerPrivate.getFileTasks = function(entries, callback) {};
  744. /**
  745. * Gets the MIME type of an entry.
  746. * @param {!Entry} entry The Entry.
  747. * @param {function((string|undefined))} callback The MIME type callback.
  748. */
  749. chrome.fileManagerPrivate.getMimeType = function(entry, callback) {};
  750. /**
  751. * Gets the content sniffed MIME type of a file.
  752. * @param {!FileEntry} fileEntry The file entry.
  753. * @param {function((string|undefined))} callback The MIME type callback.
  754. * $(ref:runtime.lastError) will be set if there was an error.
  755. */
  756. chrome.fileManagerPrivate.getContentMimeType = function(fileEntry, callback) {};
  757. /**
  758. * Gets the content metadata from an Audio or Video file.
  759. * @param {!FileEntry} fileEntry The file entry.
  760. * @param {string} mimeType The content sniffed mimeType of the file.
  761. * @param {boolean} includeImages If true, return metadata tags and thumbnail
  762. * images. If false, return metadata tags only.
  763. * @param {function((!chrome.fileManagerPrivate.MediaMetadata|undefined))}
  764. * callback The content MediaMetadata callback.
  765. * $(ref:runtime.lastError) will be set if there was an error.
  766. */
  767. chrome.fileManagerPrivate.getContentMetadata = function(fileEntry, mimeType,
  768. includeImages, callback) {};
  769. /**
  770. * Gets localized strings and initialization data. |callback|
  771. * @param {function((!Object|undefined))} callback |result| Hash containing the
  772. * string assets.
  773. */
  774. chrome.fileManagerPrivate.getStrings = function(callback) {};
  775. /**
  776. * Adds file watch. |entry| Entry of file to watch |callback|
  777. * @param {!Entry} entry
  778. * @param {function((boolean|undefined))} callback |success| True when file
  779. * watch is successfully added.
  780. */
  781. chrome.fileManagerPrivate.addFileWatch = function(entry, callback) {};
  782. /**
  783. * Removes file watch. |entry| Entry of watched file to remove |callback|
  784. * @param {!Entry} entry
  785. * @param {function((boolean|undefined))} callback |success| True when file
  786. * watch is successfully
  787. * removed.
  788. */
  789. chrome.fileManagerPrivate.removeFileWatch = function(entry, callback) {};
  790. /**
  791. * Enables the extenal file scheme necessary to initiate drags to the browser
  792. * window for files on the external backend.
  793. */
  794. chrome.fileManagerPrivate.enableExternalFileScheme = function() {};
  795. /**
  796. * Requests R/W access to the specified entries as |entryUrls|. Note, that only
  797. * files backed by external file system backend will be granted the access.
  798. * @param {!Array<string>} entryUrls
  799. * @param {function()} callback Completion callback.
  800. */
  801. chrome.fileManagerPrivate.grantAccess = function(entryUrls, callback) {};
  802. /**
  803. * Selects multiple files. |selectedPaths| Array of selected paths
  804. * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
  805. * |callback|
  806. * @param {!Array<string>} selectedPaths
  807. * @param {boolean} shouldReturnLocalPath
  808. * @param {function()} callback Callback that does not take arguments.
  809. */
  810. chrome.fileManagerPrivate.selectFiles = function(selectedPaths,
  811. shouldReturnLocalPath, callback) {};
  812. /**
  813. * Selects a file. |selectedPath| A selected path |index| Index of Filter
  814. * |forOpening| true if paths are selected for opening. false if for saving.
  815. * |shouldReturnLocalPath| true if paths need to be resolved to local paths.
  816. * |callback|
  817. * @param {string} selectedPath
  818. * @param {number} index
  819. * @param {boolean} forOpening
  820. * @param {boolean} shouldReturnLocalPath
  821. * @param {function()} callback Callback that does not take arguments.
  822. */
  823. chrome.fileManagerPrivate.selectFile = function(selectedPath, index, forOpening,
  824. shouldReturnLocalPath, callback) {};
  825. /**
  826. * Requests additional properties for files. |entries| list of entries of files
  827. * |callback|
  828. * @param {!Array<!Entry>} entries
  829. * @param {!Array<string>} names
  830. * @param {function((!Array<!chrome.fileManagerPrivate.EntryProperties>|undefined))}
  831. * callback |entryProperties| A dictionary containing properties of the
  832. * requested entries.
  833. */
  834. chrome.fileManagerPrivate.getEntryProperties = function(entries, names,
  835. callback) {};
  836. /**
  837. * Pins/unpins a Drive file in the cache. |entry| Entry of a file to pin/unpin.
  838. * |pin| Pass true to pin the file. |callback| Completion callback.
  839. * $(ref:runtime.lastError) will be set if there was an error.
  840. * @param {!Entry} entry
  841. * @param {boolean} pin
  842. * @param {function()} callback Callback that does not take arguments.
  843. */
  844. chrome.fileManagerPrivate.pinDriveFile = function(entry, pin, callback) {};
  845. /**
  846. * Resolves file entries in the isolated file system and returns corresponding
  847. * entries in the external file system mounted to Chrome OS file manager
  848. * backend. If resolving entry fails, the entry will be just ignored and the
  849. * corresponding entry does not appear in the result.
  850. * @param {!Array<!Entry>} entries
  851. * @param {function(!Array<!Entry>): void} callback Completion callback
  852. * with resolved entries.
  853. */
  854. chrome.fileManagerPrivate.resolveIsolatedEntries = function(entries,
  855. callback) {};
  856. /**
  857. * Mounts a resource or an archive.
  858. * @param {string} fileUrl Mount point source.
  859. * @param {string|undefined} password Optional password to decrypt the archive.
  860. * @param {function(string): void} callback callback Callback called with the
  861. * source path of the mount.
  862. */
  863. chrome.fileManagerPrivate.addMount = function(fileUrl, password, callback) {};
  864. /**
  865. * Cancels an archive mounting operation.
  866. * @param {string} fileUrl Mount point source. Should be same as the one passed
  867. * to addMount.
  868. * @param {function()} callback
  869. */
  870. chrome.fileManagerPrivate.cancelMounting = function(fileUrl, callback) {};
  871. /**
  872. * Unmounts a mounted resource. |volumeId| An ID of the volume.
  873. * @param {string} volumeId
  874. * @param {function()} callback
  875. */
  876. chrome.fileManagerPrivate.removeMount = function(volumeId, callback) {};
  877. /**
  878. * Get the list of mounted volumes. |callback|
  879. * @param {function((!Array<!chrome.fileManagerPrivate.VolumeMetadata>|undefined))}
  880. * callback Callback with the list of
  881. * chrome.fileManagerPrivate.VolumeMetadata representing mounted volumes.
  882. */
  883. chrome.fileManagerPrivate.getVolumeMetadataList = function(callback) {};
  884. /**
  885. * Returns a list of files not allowed to be transferred. |entries| list of
  886. * source entries to be transferred. If any of |entries| is a directory, it will
  887. * check all its files recursively. |destinationEntry| Entry of the destination
  888. * directory.
  889. * @param {!Array<!Entry>} entries
  890. * @param {!DirectoryEntry} destinationEntry
  891. * @param {!Array<!Entry>} callback Entries of the files not allowed to be
  892. * transferred.
  893. */
  894. chrome.fileManagerPrivate.getDisallowedTransfers = function(
  895. entries, destinationEntry, callback) {};
  896. /**
  897. * Returns a list of files that are restricted by any Data Leak Prevention
  898. * (DLP) rule. |entries| list of source entries to be checked.
  899. * @param {!Array<!Entry>} entries
  900. * @param {function((!Array<!chrome.fileManagerPrivate.DlpMetadata>|undefined))}
  901. * callback Callback with the list of chrome.fileManagerPrivate.DlpMetadata
  902. * containing DLP information about the entries.
  903. */
  904. chrome.fileManagerPrivate.getDlpMetadata = function(entries, callback) {};
  905. /**
  906. * Retrieves Data Leak Prevention (DLP) restriction details.
  907. * @param {string} sourceUrl Source URL of the Entry for which the details
  908. * should be shown.
  909. * @param {function(!Array<chrome.fileManagerPrivate.DlpRestrictionDetails>)}
  910. * callback Callback with the list of
  911. * chrome.fileManagerPrivate.DlpRestrictionDetails containing summarized
  912. * restriction information about the entry.
  913. */
  914. chrome.fileManagerPrivate.getDlpRestrictionDetails = function(
  915. sourceUrl, callback) {};
  916. /**
  917. * Starts to copy an entry. If the source is a directory, the copy is done
  918. * recursively. |entry| Entry of the source entry to be copied. |parent| Entry
  919. * of the destination directory. |newName| Name of the new entry. It must not
  920. * contain '/'. |callback| Completion callback.
  921. * @param {!Entry} entry
  922. * @param {!DirectoryEntry} parentEntry
  923. * @param {string} newName
  924. * @param {function((number|undefined))} callback |copyId| ID of the copy task.
  925. * Can be used to identify the progress, and to cancel the task.
  926. */
  927. chrome.fileManagerPrivate.startCopy = function(entry, parentEntry, newName,
  928. callback) {};
  929. /**
  930. * Cancels the running copy task. |copyId| ID of the copy task to be cancelled.
  931. * |callback| Completion callback of the cancel.
  932. * @param {number} copyId
  933. * @param {function()} callback Callback that does not take arguments.
  934. */
  935. chrome.fileManagerPrivate.cancelCopy = function(copyId, callback) {};
  936. /**
  937. * Retrieves total and remaining size of a mount point. |volumeId| ID of the
  938. * volume to be checked. |callback|
  939. * @param {string} volumeId
  940. * @param {function((!chrome.fileManagerPrivate.MountPointSizeStats|undefined))}
  941. * callback Name/value pairs of size stats. Will be undefined if stats could
  942. * not be determined.
  943. */
  944. chrome.fileManagerPrivate.getSizeStats = function(volumeId, callback) {};
  945. /**
  946. * Retrieves drive quota metadata.
  947. * @param {function((!chrome.fileManagerPrivate.DriveQuotaMetadata|undefined))}
  948. * callback Name/value pairs of drive quota metadata. Will be undefined if
  949. * quota metadata could not be determined.
  950. */
  951. chrome.fileManagerPrivate.getDriveQuotaMetadata = function(callback) {};
  952. /**
  953. * Formats a mounted volume. |volumeId| ID of the volume to be formatted.
  954. * @param {string} volumeId
  955. * @param {chrome.fileManagerPrivate.FormatFileSystemType} filesystem
  956. * @param {string} volumeLabel
  957. */
  958. chrome.fileManagerPrivate.formatVolume = function(volumeId, filesystem,
  959. volumeLabel) {};
  960. /**
  961. * Deletes partitions of removable device, creates a single partition
  962. * and format it.
  963. * @param {string} devicePath
  964. * @param {chrome.fileManagerPrivate.FormatFileSystemType} filesystem
  965. * @param {string} volumeLabel
  966. */
  967. chrome.fileManagerPrivate.singlePartitionFormat = function(devicePath,
  968. filesystem, volumeLabel) {};
  969. /**
  970. * Renames a mounted volume. |volumeId| ID of the volume to be renamed to
  971. * |newName|.
  972. * @param {string} volumeId
  973. * @param {string} newName
  974. */
  975. chrome.fileManagerPrivate.renameVolume = function(volumeId, newName) {};
  976. /**
  977. * Retrieves file manager preferences. |callback|
  978. * @param {function((!chrome.fileManagerPrivate.Preferences|undefined))}
  979. * callback
  980. */
  981. chrome.fileManagerPrivate.getPreferences = function(callback) {};
  982. /**
  983. * Sets file manager preferences. |changeInfo|
  984. * @param {chrome.fileManagerPrivate.PreferencesChange} changeInfo
  985. */
  986. chrome.fileManagerPrivate.setPreferences = function(changeInfo) {};
  987. /**
  988. * Performs drive content search. |searchParams| |callback|
  989. * @param {chrome.fileManagerPrivate.SearchParams} searchParams
  990. * @param {function((!Array<Entry>|undefined), (string|undefined))} callback
  991. * Entries and ID of the feed that contains next chunk of the search result.
  992. * Should be sent to the next searchDrive request to perform incremental search.
  993. */
  994. chrome.fileManagerPrivate.searchDrive = function(searchParams, callback) {};
  995. /**
  996. * Performs drive metadata search. |searchParams| |callback|
  997. * @param {!chrome.fileManagerPrivate.SearchMetadataParams} searchParams
  998. * @param {function(!Array<!chrome.fileManagerPrivate.DriveMetadataSearchResult>): void}
  999. * callback
  1000. */
  1001. chrome.fileManagerPrivate.searchDriveMetadata = function(searchParams, callback) {};
  1002. /**
  1003. * Search for files in the given volume, whose content hash matches the list of
  1004. * given hashes.
  1005. * @param {string} volumeId
  1006. * @param {!Array<string>} hashes
  1007. * @param {function((!Object<string, !Array<string>>|undefined))} callback
  1008. */
  1009. chrome.fileManagerPrivate.searchFilesByHashes = function(volumeId, hashes,
  1010. callback) {};
  1011. /**
  1012. * Search files in My Files.
  1013. * @param {!chrome.fileManagerPrivate.SearchMetadataParams} searchParams
  1014. * @param {function(!Array<Object>): void} callback
  1015. */
  1016. chrome.fileManagerPrivate.searchFiles = function(searchParams, callback) {};
  1017. /**
  1018. * Creates a ZIP file for the selected files and folders. Folders are
  1019. * recursively explored and zipped. Hidden files and folders (with names
  1020. * starting with a dot) found during recursive exploration are included too.
  1021. * @param {!Array<!Entry>} entries Entries of the selected files and folders to
  1022. * zip. They must be under the |parentEntry| directory.
  1023. * @param {!DirectoryEntry} parentEntry Entry of the directory containing the
  1024. * selected files and folders. This is where the ZIP file will be created,
  1025. * too.
  1026. * @param {string} destName Name of the destination ZIP file. The ZIP file will
  1027. * be created in the directory specified by |parentEntry|.
  1028. * @param {function(number, number)} callback called with (zipId, totalBytes)
  1029. * where |zipId| is the ID of the ZIP operation, and |totalBytes| is the
  1030. * total number of bytes in all the files that are going to be zipped.
  1031. */
  1032. chrome.fileManagerPrivate.zipSelection = function(
  1033. entries, parentEntry, destName, callback) {};
  1034. /**
  1035. * Cancels an ongoing ZIP operation.
  1036. * Does nothing if there is no matching ongoing ZIP operation.
  1037. * @param {number} zipId ID of the ZIP operation.
  1038. */
  1039. chrome.fileManagerPrivate.cancelZip = function(zipId) {};
  1040. /**
  1041. * Gets the progress of an ongoing ZIP operation.
  1042. * @param {number} zipId ID of the ZIP operation.
  1043. * @param {function(number, number)} callback called with progress information
  1044. * (result, bytes), where |result| is less than 0 if the operation is still
  1045. * in progress, 0 if the operation finished successfully, or greater than 0
  1046. * if the operation finished with an error, and |bytes| is the total number
  1047. * of bytes having been zipped so far.
  1048. */
  1049. chrome.fileManagerPrivate.getZipProgress = function(zipId, callback) {};
  1050. /**
  1051. * Retrieves the state of the current drive connection. |callback|
  1052. * @param {function(!chrome.fileManagerPrivate.DriveConnectionState): void}
  1053. * callback
  1054. */
  1055. chrome.fileManagerPrivate.getDriveConnectionState = function(callback) {};
  1056. /**
  1057. * Checks whether the path name length fits in the limit of the filesystem.
  1058. * |parentEntry| The parent directory entry. |name| The name of the file.
  1059. * |callback| Called back when the check is finished.
  1060. * @param {!DirectoryEntry} parentEntry
  1061. * @param {string} name
  1062. * @param {function((boolean|undefined))} callback |result| true if the length
  1063. * is in the valid range, false otherwise.
  1064. */
  1065. chrome.fileManagerPrivate.validatePathNameLength = function(
  1066. parentEntry, name, callback) {};
  1067. /**
  1068. * Changes the zoom factor of the Files app. |operation| Zooming mode.
  1069. * @param {string} operation
  1070. */
  1071. chrome.fileManagerPrivate.zoom = function(operation) {};
  1072. /**
  1073. * Requests a Webstore API OAuth2 access token. |callback|
  1074. * @param {function((string|undefined))} callback |accessToken| OAuth2 access
  1075. * token, or an empty string if failed to fetch.
  1076. */
  1077. chrome.fileManagerPrivate.requestWebStoreAccessToken = function(callback) {};
  1078. /**
  1079. * Requests a download url to download the file contents.
  1080. * @param {!Entry} entry
  1081. * @param {function((string|undefined))} callback Callback with the result url.
  1082. */
  1083. chrome.fileManagerPrivate.getDownloadUrl = function(entry, callback) {};
  1084. /**
  1085. * Obtains a list of profiles that are logged-in.
  1086. * @param {function((!Array<!chrome.fileManagerPrivate.ProfileInfo>|undefined),
  1087. * (string|undefined), (string|undefined))} callback Callback with list of
  1088. * profile information, |runningProfile| ID of the profile that runs the
  1089. * application instance. |showingProfile| ID of the profile that shows the
  1090. * application window.
  1091. */
  1092. chrome.fileManagerPrivate.getProfiles = function(callback) {};
  1093. /**
  1094. * Opens inspector window. |type| InspectionType which specifies how to open
  1095. * inspector.
  1096. * @param {string} type
  1097. */
  1098. chrome.fileManagerPrivate.openInspector = function(type) {};
  1099. /**
  1100. * Opens settings sub page. |sub_page| Name of a sub page.
  1101. * @param {string} sub_page
  1102. */
  1103. chrome.fileManagerPrivate.openSettingsSubpage = function(sub_page) {};
  1104. /**
  1105. * Computes an MD5 checksum for the given file.
  1106. * @param {!Entry} entry
  1107. * @param {function((string|undefined))} callback
  1108. */
  1109. chrome.fileManagerPrivate.computeChecksum = function(entry, callback) {};
  1110. /**
  1111. * Returns list of available providers.
  1112. * @param {function((!Array<!chrome.fileManagerPrivate.Provider>|undefined))}
  1113. * callback
  1114. */
  1115. chrome.fileManagerPrivate.getProviders = function(callback) {};
  1116. /**
  1117. * Requests adding a new provided file system. If not possible, then an error
  1118. * via chrome.runtime.lastError is returned.
  1119. * @param {string} providerId
  1120. * @param {function()} callback
  1121. */
  1122. chrome.fileManagerPrivate.addProvidedFileSystem =
  1123. function(providerId, callback) {};
  1124. /**
  1125. * Requests configuring an existing file system. If not possible, then returns
  1126. * an error via chrome.runtime.lastError.
  1127. * @param {string} volumeId
  1128. * @param {function()} callback
  1129. */
  1130. chrome.fileManagerPrivate.configureVolume = function(volumeId, callback) {};
  1131. /**
  1132. * Requests fetching list of actions for the specified set of entries. If not
  1133. * possible, then returns an error via chrome.runtime.lastError.
  1134. * @param {!Array<!Entry>} entries
  1135. * @param {function((!Array<!chrome.fileSystemProvider.Action>|undefined))}
  1136. * callback
  1137. */
  1138. chrome.fileManagerPrivate.getCustomActions = function(entries, callback) {};
  1139. /**
  1140. * Executes the action on the specified set of entries. If not possible, then
  1141. * returns an error via chrome.runtime.lastError.
  1142. * @param {!Array<!Entry>} entries
  1143. * @param {string} actionId
  1144. * @param {function()} callback
  1145. */
  1146. chrome.fileManagerPrivate.executeCustomAction = function(
  1147. entries, actionId, callback) {};
  1148. /**
  1149. * Get the total size of a directory. |entry| Entry of the target directory.
  1150. * |callback|
  1151. * @param {!DirectoryEntry} entry
  1152. * @param {function(number)} callback
  1153. */
  1154. chrome.fileManagerPrivate.getDirectorySize = function(entry, callback) {};
  1155. /**
  1156. * Gets recently modified files across file systems.
  1157. * @param {string} restriction
  1158. * @param {string} fileType
  1159. * @param {boolean} invalidateCache
  1160. * @param {function((!Array<!FileEntry>))} callback
  1161. */
  1162. chrome.fileManagerPrivate.getRecentFiles = function(restriction, fileType, invalidateCache, callback) {};
  1163. /**
  1164. * Requests the root directory of a volume. The ID of the volume must be
  1165. * specified as |volumeId| of the |options| paramter.
  1166. * @param {!chrome.fileManagerPrivate.GetVolumeRootOptions} options
  1167. * @param {function(!DirectoryEntry)} callback
  1168. */
  1169. chrome.fileManagerPrivate.getVolumeRoot = function(options, callback) {};
  1170. /**
  1171. * Starts and mounts crostini container.
  1172. * @param {function()} callback Callback called after the crostini container
  1173. * is started and mounted.
  1174. * chrome.runtime.lastError will be set if there was an error.
  1175. */
  1176. chrome.fileManagerPrivate.mountCrostini = function(callback) {};
  1177. /**
  1178. * Lists guests
  1179. * @param {function((!Array<!chrome.fileManagerPrivate.MountableGuest>))} callback
  1180. * chrome.runtime.lastError will be set if there was an error.
  1181. */
  1182. chrome.fileManagerPrivate.listMountableGuests = function(callback) {};
  1183. /**
  1184. * Starts and mounts target guest
  1185. * @param {!number} id Id of the mount provider to use
  1186. * @param {function()} callback Callback called after the requests completes
  1187. * (either successfully or with an error).
  1188. * chrome.runtime.lastError will be set if there was an error.
  1189. */
  1190. chrome.fileManagerPrivate.mountGuest = function(id, callback) {};
  1191. /**
  1192. * Shares paths with crostini container.
  1193. * @param {string} vmName VM to share path with.
  1194. * @param {!Array<!Entry>} entries Entries of the files and directories to
  1195. * share.
  1196. * @param {boolean} persist If true, share will persist across restarts.
  1197. * @param {function()} callback Callback called after the paths are shared.
  1198. * chrome.runtime.lastError will be set if there was an error.
  1199. */
  1200. chrome.fileManagerPrivate.sharePathsWithCrostini = function(
  1201. vmName, entries, persist, callback) {};
  1202. /**
  1203. * Unshares path with crostini container.
  1204. * @param {string} vmName VM to unshare path from.
  1205. * @param {!Entry} entry Entry of the file or directory to unshare.
  1206. * @param {function()} callback Callback called after the path is unshared.
  1207. * chrome.runtime.lastError will be set if there was an error.
  1208. */
  1209. chrome.fileManagerPrivate.unsharePathWithCrostini = function(
  1210. vmName, entry, callback) {};
  1211. /**
  1212. * Returns list of paths shared with the crostini container, and whether this is
  1213. * the first time this function is called for this session.
  1214. * @param {boolean} observeFirstForSession If true, callback provides whether
  1215. * this is the first time this function has been called with
  1216. * observeFirstForSession true.
  1217. * @param {string} vmName VM to get shared paths of.
  1218. * @param {function(!Array<!Entry>, boolean)} callback
  1219. */
  1220. chrome.fileManagerPrivate.getCrostiniSharedPaths = function(
  1221. observeFirstForSession, vmName, callback) {};
  1222. /**
  1223. * Requests information about a Linux package.
  1224. * @param {!Entry} entry
  1225. * @param {function((!chrome.fileManagerPrivate.LinuxPackageInfo|undefined))}
  1226. * callback
  1227. * Called when package information is retrieved.
  1228. * chrome.runtime.lastError will be set if there was an error.
  1229. */
  1230. chrome.fileManagerPrivate.getLinuxPackageInfo = function(entry, callback) {};
  1231. /**
  1232. * Starts installation of a Linux package.
  1233. * @param {!Entry} entry
  1234. * @param {function(!chrome.fileManagerPrivate.InstallLinuxPackageResponse,
  1235. * string)} callback
  1236. * Called when the installation is either started or fails to start.
  1237. */
  1238. chrome.fileManagerPrivate.installLinuxPackage = function(entry, callback) {};
  1239. /**
  1240. * Imports a Crostini Image File (.tini). This overrides the existing Linux apps
  1241. * and files.
  1242. * @param {!Entry} entry
  1243. */
  1244. chrome.fileManagerPrivate.importCrostiniImage = function(entry) {};
  1245. /**
  1246. * For a file in DriveFS, retrieves its thumbnail. If |cropToSquare| is true,
  1247. * returns a thumbnail appropriate for file list or grid views; otherwise,
  1248. * returns a thumbnail appropriate for quickview.
  1249. * @param {!FileEntry} entry
  1250. * @param {boolean} cropToSquare
  1251. * @param {function(string): void} callback |thumbnailDataUrl| A data URL for
  1252. * the thumbnail as a PNG; |thumbnailDataUrl| is empty if no thumbnail was
  1253. * available.
  1254. */
  1255. chrome.fileManagerPrivate.getDriveThumbnail = function(entry, cropToSquare, callback) {};
  1256. /**
  1257. * For a local PDF file, retrieves its thumbnail with a given |width| and
  1258. * |height|.
  1259. * @param {!FileEntry} entry
  1260. * @param {number} width
  1261. * @param {number} height
  1262. * @param {function(string): void} callback |thumbnailDataUrl| A data URL for
  1263. * the thumbnail as a PNG; |thumbnailDataUrl| is empty if no thumbnail was
  1264. * available.
  1265. */
  1266. chrome.fileManagerPrivate.getPdfThumbnail = function(entry, width, height, callback) {};
  1267. /**
  1268. Retrieves a thumbnail of an ARC DocumentsProvider file, close in size to
  1269. |widthHint| and |heightHint|, but not necessarily exactly this size.
  1270. * @param {!FileEntry} entry
  1271. * @param {number} widthHint
  1272. * @param {number} heightHint
  1273. * @param {function(string): void} callback |thumbnailDataUrl| A data URL for the
  1274. * thumbnail; |thumbnailDataUrl| is empty if no thumbnail was available.
  1275. * Note: The thumbnail data may originate from third-party application code,
  1276. * and is untrustworthy (Security).
  1277. */
  1278. chrome.fileManagerPrivate.getArcDocumentsProviderThumbnail = function(entry, widthHint, heightHint, callback) {};
  1279. /**
  1280. * @param {!Array<string>} extensions
  1281. * @param {function(!Array<chrome.fileManagerPrivate.AndroidApp>): void} callback
  1282. * Completion callback.
  1283. */
  1284. chrome.fileManagerPrivate.getAndroidPickerApps = function(extensions, callback) {};
  1285. /**
  1286. * @param {chrome.fileManagerPrivate.AndroidApp} androidApp
  1287. * @param {function()} callback Completion callback.
  1288. */
  1289. chrome.fileManagerPrivate.selectAndroidPickerApp = function(androidApp, callback) {};
  1290. /**
  1291. * Return true if sharesheet contains share targets for entries.
  1292. * @param {!Array<!Entry>} entries
  1293. * @param {function((boolean|undefined))} callback
  1294. */
  1295. chrome.fileManagerPrivate.sharesheetHasTargets = function(entries, callback) {};
  1296. /**
  1297. * Invoke Sharesheet for selected files. If not possible, then returns
  1298. * an error via chrome.runtime.lastError. |entries| Array of selected entries.
  1299. * @param {!Array<!Entry>} entries
  1300. * @param {chrome.fileManagerPrivate.SharesheetLaunchSource} launchSource
  1301. * @param {function()} callback
  1302. */
  1303. chrome.fileManagerPrivate.invokeSharesheet = function(
  1304. entries, launchSource, callback) {};
  1305. /**
  1306. * Adds or removes a list of entries to temporary holding space. Any entries
  1307. * whose current holding space state matches the intended state will be skipped.
  1308. * |entries| The list of entries whose holding space needs to be updated. |add|
  1309. * Whether items should be added or removed from the holding space. |callback|
  1310. * Completion callback.
  1311. * @param {!Array<!Entry>} entries
  1312. * @param {boolean} added
  1313. * @param {function(): void=} callback Callback that does not take arguments.
  1314. */
  1315. chrome.fileManagerPrivate.toggleAddedToHoldingSpace = function(entries, added, callback) {};
  1316. /**
  1317. * Retrieves the current holding space state, for example the list of items the
  1318. * holding space currently contains. |callback| The result callback.
  1319. * @param {function(!chrome.fileManagerPrivate.HoldingSpaceState): void}
  1320. * callback |state| Describes the current holding space state.
  1321. */
  1322. chrome.fileManagerPrivate.getHoldingSpaceState = function(callback) {};
  1323. /**
  1324. * Returns true via `callback` if tablet mode is enabled, false otherwise.
  1325. * @param {function(boolean): void} callback
  1326. */
  1327. chrome.fileManagerPrivate.isTabletModeEnabled = function(callback) {};
  1328. /**
  1329. * Notifies Drive about the result of the last dialog shown.
  1330. * @param {chrome.fileManagerPrivate.DriveDialogResult} result
  1331. */
  1332. chrome.fileManagerPrivate.notifyDriveDialogResult = function(result) {};
  1333. /**
  1334. * Opens a new browser tab and navigates to `URL`.
  1335. * @param {!string} URL
  1336. */
  1337. chrome.fileManagerPrivate.openURL = function(URL) {};
  1338. /**
  1339. * Creates a new Files app window in the directory provided in `params`.
  1340. * @param {!chrome.fileManagerPrivate.OpenWindowParams} params
  1341. * @param {function(boolean): void} callback |result| Boolean result returned by
  1342. * the invoked function.
  1343. */
  1344. chrome.fileManagerPrivate.openWindow = function(params, callback) {};
  1345. /**
  1346. * Opens the feedback report window.
  1347. */
  1348. chrome.fileManagerPrivate.sendFeedback = function() {};
  1349. /**
  1350. * Starts an I/O task of type |type| on |entries|. Task type specific parameters
  1351. * passed via |params|.
  1352. * @param {!chrome.fileManagerPrivate.IOTaskType} type
  1353. * @param {!Array<!Entry>} entries
  1354. * @param {!chrome.fileManagerPrivate.IOTaskParams} params
  1355. * @param {(function(number): void)=} callback Returns the task ID.
  1356. */
  1357. chrome.fileManagerPrivate.startIOTask = function(
  1358. type, entries, params, callback) {};
  1359. /**
  1360. * Cancels an I/O task by id. Task ids are communicated to the Files App in
  1361. * each I/O task's progress status.
  1362. * @param {number} taskId
  1363. */
  1364. chrome.fileManagerPrivate.cancelIOTask = function (taskId) { };
  1365. /**
  1366. * Tells DriveFS to update its cached pin states of hosted files (once).
  1367. */
  1368. chrome.fileManagerPrivate.pollDriveHostedFilePinStates = function() {};
  1369. /**
  1370. * Opens the page to manage currently syncing folders.
  1371. */
  1372. chrome.fileManagerPrivate.openManageSyncSettings = function() {};
  1373. /**
  1374. * Returns color via `callback` for Files app foreground window frame.
  1375. * @param {function(string): void} callback |color| String containing the color
  1376. * of the title bar.
  1377. */
  1378. chrome.fileManagerPrivate.getFrameColor = function(callback) {};
  1379. /**
  1380. * Parses the supplied .trashinfo files and returns the successfully parsed
  1381. * data.
  1382. * @param {!Array<!Entry>} entries
  1383. * @param {function(!Array<!chrome.fileManagerPrivate.ParsedTrashInfoFile>):
  1384. * void} callback
  1385. */
  1386. chrome.fileManagerPrivate.parseTrashInfoFiles = function(entries, callback) {};
  1387. /** @type {!ChromeEvent} */
  1388. chrome.fileManagerPrivate.onMountCompleted;
  1389. /** @type {!ChromeEvent} */
  1390. chrome.fileManagerPrivate.onFileTransfersUpdated;
  1391. /** @type {!ChromeEvent} */
  1392. chrome.fileManagerPrivate.onPinTransfersUpdated;
  1393. /** @type {!ChromeEvent} */
  1394. chrome.fileManagerPrivate.onCopyProgress;
  1395. /** @type {!ChromeEvent} */
  1396. chrome.fileManagerPrivate.onDirectoryChanged;
  1397. /** @type {!ChromeEvent} */
  1398. chrome.fileManagerPrivate.onPreferencesChanged;
  1399. /** @type {!ChromeEvent} */
  1400. chrome.fileManagerPrivate.onDriveConnectionStatusChanged;
  1401. /** @type {!ChromeEvent} */
  1402. chrome.fileManagerPrivate.onDeviceChanged;
  1403. /** @type {!ChromeEvent} */
  1404. chrome.fileManagerPrivate.onDriveSyncError;
  1405. /** @type {!ChromeEvent} */
  1406. chrome.fileManagerPrivate.onDriveConfirmDialog;
  1407. /** @type {!ChromeEvent} */
  1408. chrome.fileManagerPrivate.onAppsUpdated;
  1409. /** @type {!ChromeEvent} */
  1410. chrome.fileManagerPrivate.onCrostiniChanged;
  1411. /** @type {!ChromeEvent} */
  1412. chrome.fileManagerPrivate.onTabletModeChanged;
  1413. /** @type {!ChromeEvent} */
  1414. chrome.fileManagerPrivate.onIOTaskProgressStatus;
  1415. /** @type {!ChromeEvent} */
  1416. chrome.fileManagerPrivate.onMountableGuestsChanged;