chrome-types 0.1.448 → 0.1.449

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/_all.d.ts +1310 -436
  2. package/index.d.ts +1284 -410
  3. package/package.json +2 -2
package/_all.d.ts CHANGED
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // Generated on Sat Sep 19 2026 22:23:22 GMT+0000 (Coordinated Universal Time)
18
- // Built at 63e7f8905f1321aa5729bac838d4f95bdc72405d
17
+ // Generated on Mon Sep 21 2026 14:30:06 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 4b572cb29b45a13fd5e1f261c0f4792af77d5f2b
19
19
 
20
20
  // Includes all types, including MV2 + Platform Apps APIs.
21
21
 
@@ -13499,227 +13499,6 @@ declare namespace chrome {
13499
13499
  ): void;
13500
13500
  }
13501
13501
 
13502
- /**
13503
- * Schemas for structured manifest entries
13504
- */
13505
- export namespace extensionsManifestTypes {
13506
-
13507
- /**
13508
- * This API provides programmatic access to the user interface elements of Chrome. This includes everything in the web view, and optionally Chrome's full user interface.
13509
- *
13510
- * @since Chrome 67
13511
- */
13512
- export type automation = boolean | {
13513
-
13514
- /**
13515
- * Whether to request permission to the whole ChromeOS desktop. If granted, this gives the extension access to every aspect of the desktop, and every site and app. If this permission is requested, all other permissions are implicitly included and do not need to be requested separately.
13516
- */
13517
- desktop?: boolean,
13518
- };
13519
-
13520
- /**
13521
- * The `content_capabilities` manifest entry allows an extension to grant certain additional capabilities to web contents whose locations match a given set of URL patterns.
13522
- */
13523
- export interface ContentCapabilities {
13524
-
13525
- /**
13526
- * The set of URL patterns to match against. If any of the given patterns match a URL, its contents will be granted the specified capabilities.
13527
- */
13528
- matches: string[];
13529
-
13530
- /**
13531
- * The set of capabilities to grant matched contents. This is currently limited to `clipboardRead`, `clipboardWrite`, and `unlimitedStorage`.
13532
- */
13533
- permissions: string[];
13534
- }
13535
-
13536
- export interface ExternallyConnectable {
13537
-
13538
- /**
13539
- * The IDs of extensions or apps that are allowed to connect. If left empty or unspecified, no extensions or apps can connect.
13540
- *
13541
- * The wildcard `"*"` will allow all extensions and apps to connect.
13542
- */
13543
- ids?: string[];
13544
-
13545
- /**
13546
- * The URL patterns for _web pages_ that are allowed to connect. _This does not affect content scripts._ If left empty or unspecified, no web pages can connect.
13547
- *
13548
- * Patterns cannot include wildcard domains nor subdomains of [(effective) top level domains](https://publicsuffix.org/list/); `*://google.com/*` and `http://*.chromium.org/*` are valid, while `<all_urls>`, `http://*\/*`, `*://*.com/*`, and even `http://*.appspot.com/*` are not.
13549
- */
13550
- matches?: string[];
13551
-
13552
- /**
13553
- * If `true`, messages sent via {@link runtime.connect} or {@link runtime.sendMessage} will set {@link runtime.MessageSender.tlsChannelId} if those methods request it to be. If `false`, {@link runtime.MessageSender.tlsChannelId} will never be set under any circumstance.
13554
- */
13555
- accepts_tls_channel_id?: boolean;
13556
- }
13557
-
13558
- /**
13559
- * The `options_ui` manifest property declares how the options page should be displayed.
13560
- */
13561
- export interface OptionsUI {
13562
-
13563
- /**
13564
- * The path to your options page, relative to your extension's root.
13565
- */
13566
- page: string;
13567
-
13568
- /**
13569
- * If `true`, a Chrome user agent stylesheet will be applied to your options page. The default value is `false`. We do not recommend you enable it as it no longer results in a consistent UI with Chrome. This option will be removed in Manifest V3.
13570
- */
13571
- chrome_style?: boolean;
13572
-
13573
- /**
13574
- * If `true`, your extension's options page will be opened in a new tab rather than embedded in _chrome://extensions_. The default is `false`, and we recommend that you don't change it.
13575
- *
13576
- * **This is only useful to delay the inevitable deprecation of the old options UI!** It will be removed soon, so try not to use it. It will break.
13577
- */
13578
- open_in_tab?: boolean;
13579
- }
13580
-
13581
- /**
13582
- * A single string or a list of strings representing host:port patterns.
13583
- */
13584
- export type SocketHostPatterns = string | string[];
13585
-
13586
- /**
13587
- * The `sockets` manifest property declares which sockets operations an app can issue.
13588
- */
13589
- export interface sockets {
13590
-
13591
- /**
13592
- * The `udp` manifest property declares which sockets.udp operations an app can issue.
13593
- */
13594
- udp?: {
13595
-
13596
- /**
13597
- * The host:port pattern for `bind` operations.
13598
- */
13599
- bind?: SocketHostPatterns,
13600
-
13601
- /**
13602
- * The host:port pattern for `send` operations.
13603
- */
13604
- send?: SocketHostPatterns,
13605
-
13606
- /**
13607
- * The host:port pattern for `joinGroup` operations.
13608
- */
13609
- multicastMembership?: SocketHostPatterns,
13610
- };
13611
-
13612
- /**
13613
- * The `tcp` manifest property declares which sockets.tcp operations an app can issue.
13614
- */
13615
- tcp?: {
13616
-
13617
- /**
13618
- * The host:port pattern for `connect` operations.
13619
- */
13620
- connect?: SocketHostPatterns,
13621
- };
13622
-
13623
- /**
13624
- * The `tcpServer` manifest property declares which sockets.tcpServer operations an app can issue.
13625
- */
13626
- tcpServer?: {
13627
-
13628
- /**
13629
- * The host:port pattern for `listen` operations.
13630
- */
13631
- listen?: SocketHostPatterns,
13632
- };
13633
- }
13634
-
13635
- /**
13636
- * The `bluetooth` manifest property give permission to an app to use the {@link bluetooth} API. A list of UUIDs can be optionally specified to enable communication with devices.
13637
- */
13638
- export interface bluetooth {
13639
-
13640
- /**
13641
- * The `uuids` manifest property declares the list of protocols, profiles and services that an app can communicate using.
13642
- */
13643
- uuids?: string[];
13644
-
13645
- /**
13646
- * If `true`, gives permission to an app to use the {@link bluetoothSocket} API
13647
- */
13648
- socket?: boolean;
13649
-
13650
- /**
13651
- * If `true`, gives permission to an app to use the {@link bluetoothLowEnergy} API
13652
- */
13653
- low_energy?: boolean;
13654
-
13655
- /**
13656
- * If `true`, gives permission to an app to use the advertisement functions in the {@link bluetoothLowEnergy} API
13657
- *
13658
- * @since Chrome 44
13659
- */
13660
- peripheral?: boolean;
13661
- }
13662
-
13663
- /**
13664
- * The `usb_printers` manifest property lists the USB printers supported by an app implementing the {@link printerProvider} API.
13665
- *
13666
- * @since Chrome 44
13667
- */
13668
- export interface UsbPrinters {
13669
-
13670
- /**
13671
- * A list of {@link usb.DeviceFilter USB device filters} matching supported devices. A device only needs to match one of the provided filters. A `vendorId` is required and only one of `productId` or `interfaceClass` may be provided.
13672
- */
13673
- filters: {
13674
-
13675
- /**
13676
- * USB vendor ID of matching devices
13677
- */
13678
- vendorId: number,
13679
-
13680
- /**
13681
- * USB product ID of matching devices
13682
- */
13683
- productId?: number,
13684
-
13685
- /**
13686
- * USB interface class implemented by any interface of a matching device.
13687
- */
13688
- interfaceClass?: number,
13689
-
13690
- /**
13691
- * USB interface sub-class implemented by the interface matching {@link interfaceClass}.
13692
- */
13693
- interfaceSubclass?: number,
13694
-
13695
- /**
13696
- * USB interface protocol implemented by the interface matching {@link interfaceClass} and {@link interfaceSubclass}.
13697
- */
13698
- interfaceProtocol?: number,
13699
- }[];
13700
- }
13701
-
13702
- /**
13703
- * The `kiosk_secondary_apps` manifest property lists the secondary kiosk apps to be deployed by the primary kiosk app.
13704
- *
13705
- * @since Chrome 47
13706
- */
13707
- export type KioskSecondaryApps = {
13708
-
13709
- /**
13710
- * ID of secondary kiosk app
13711
- */
13712
- id: string,
13713
-
13714
- /**
13715
- * Whether the secondary app should be enabled when kiosk app is launched. If true, the app will be enabled before the kiosk app launch; if false the app will be disabled before the kiosk app launch; if not set, the app's enabled state will not be changed during the kiosk app launch. The ${ref:management} API can be used to later change the secondary app state.
13716
- *
13717
- * @since Chrome 66
13718
- */
13719
- enabled_on_launch?: boolean,
13720
- }[];
13721
- }
13722
-
13723
13502
  /**
13724
13503
  * The `chrome.extensionTypes` API contains type declarations for Chrome extensions.
13725
13504
  */
@@ -14043,213 +13822,1401 @@ declare namespace chrome {
14043
13822
  }
14044
13823
 
14045
13824
  /**
14046
- * @since Chrome 44
13825
+ * @since Chrome 44
13826
+ */
13827
+ export interface RequestFileSystemOptions {
13828
+
13829
+ /**
13830
+ * The ID of the requested volume.
13831
+ */
13832
+ volumeId: string;
13833
+
13834
+ /**
13835
+ * Whether the requested file system should be writable. The default is read-only.
13836
+ */
13837
+ writable?: boolean;
13838
+ }
13839
+
13840
+ /**
13841
+ * @since Chrome 44
13842
+ */
13843
+ export interface Volume {
13844
+
13845
+ volumeId: string;
13846
+
13847
+ writable: boolean;
13848
+ }
13849
+
13850
+ /**
13851
+ * @since Chrome 44
13852
+ */
13853
+ export interface VolumeListChangedEvent {
13854
+
13855
+ volumes: Volume[];
13856
+ }
13857
+
13858
+ /**
13859
+ * Called when a list of available volumes is changed.
13860
+ *
13861
+ * @since Chrome 44
13862
+ */
13863
+ export const onVolumeListChanged: events.Event<(
13864
+ event: VolumeListChangedEvent,
13865
+ ) => void>;
13866
+
13867
+ /**
13868
+ * Get the display path of an Entry object. The display path is based on the full path of the file or directory on the local file system, but may be made more readable for display purposes.
13869
+ *
13870
+ * @chrome-returns-extra since Chrome 117
13871
+ */
13872
+ export function getDisplayPath(
13873
+
13874
+ entry: Entry,
13875
+ ): Promise<string>;
13876
+
13877
+ /**
13878
+ * Get the display path of an Entry object. The display path is based on the full path of the file or directory on the local file system, but may be made more readable for display purposes.
13879
+ */
13880
+ export function getDisplayPath(
13881
+
13882
+ entry: Entry,
13883
+
13884
+ callback?: (
13885
+ displayPath: string,
13886
+ ) => void,
13887
+ ): void;
13888
+
13889
+ /**
13890
+ * Get a writable Entry from another Entry. This call will fail with a runtime error if the application does not have the 'write' permission under 'fileSystem'. If entry is a DirectoryEntry, this call will fail if the application does not have the 'directory' permission under 'fileSystem'.
13891
+ */
13892
+ export function getWritableEntry(
13893
+
13894
+ entry: Entry,
13895
+
13896
+ callback: (
13897
+ entry: Entry,
13898
+ ) => void,
13899
+ ): void;
13900
+
13901
+ /**
13902
+ * Gets whether this Entry is writable or not.
13903
+ *
13904
+ * @chrome-returns-extra since Chrome 117
13905
+ */
13906
+ export function isWritableEntry(
13907
+
13908
+ entry: Entry,
13909
+ ): Promise<boolean>;
13910
+
13911
+ /**
13912
+ * Gets whether this Entry is writable or not.
13913
+ */
13914
+ export function isWritableEntry(
13915
+
13916
+ entry: Entry,
13917
+
13918
+ callback?: (
13919
+ isWritable: boolean,
13920
+ ) => void,
13921
+ ): void;
13922
+
13923
+ /**
13924
+ * Ask the user to choose a file or directory.
13925
+ */
13926
+ export function chooseEntry(
13927
+
13928
+ options: ChooseEntryOptions,
13929
+
13930
+ callback: (
13931
+ entry?: Entry,
13932
+ fileEntries?: FileEntry[],
13933
+ ) => void,
13934
+ ): void;
13935
+
13936
+ /**
13937
+ * Ask the user to choose a file or directory.
13938
+ */
13939
+ export function chooseEntry(
13940
+
13941
+ callback: (
13942
+ entry?: Entry,
13943
+ fileEntries?: FileEntry[],
13944
+ ) => void,
13945
+ ): void;
13946
+
13947
+ /**
13948
+ * Returns the file entry with the given id if it can be restored. This call will fail with a runtime error otherwise.
13949
+ */
13950
+ export function restoreEntry(
13951
+
13952
+ id: string,
13953
+
13954
+ callback: (
13955
+ entry: Entry,
13956
+ ) => void,
13957
+ ): void;
13958
+
13959
+ /**
13960
+ * Returns whether the app has permission to restore the entry with the given id.
13961
+ *
13962
+ * @chrome-returns-extra since Chrome 117
13963
+ */
13964
+ export function isRestorable(
13965
+
13966
+ id: string,
13967
+ ): Promise<boolean>;
13968
+
13969
+ /**
13970
+ * Returns whether the app has permission to restore the entry with the given id.
13971
+ */
13972
+ export function isRestorable(
13973
+
13974
+ id: string,
13975
+
13976
+ callback?: (
13977
+ isRestorable: boolean,
13978
+ ) => void,
13979
+ ): void;
13980
+
13981
+ /**
13982
+ * Returns an id that can be passed to restoreEntry to regain access to a given file entry. Only the 500 most recently used entries are retained, where calls to retainEntry and restoreEntry count as use. If the app has the 'retainEntries' permission under 'fileSystem', entries are retained indefinitely. Otherwise, entries are retained only while the app is running and across restarts.
13983
+ */
13984
+ export function retainEntry(
13985
+
13986
+ entry: Entry,
13987
+ ): string;
13988
+
13989
+ /**
13990
+ * Requests access to a file system for a volume represented by `options.volumeId`. If `options.writable` is set to true, then the file system will be writable. Otherwise, it will be read-only. The `writable` option requires the `"fileSystem": {"write"}` permission in the manifest. Available to kiosk apps running in kiosk session only. For manual-launch kiosk mode, a confirmation dialog will be shown on top of the active app window. In case of an error, `fileSystem` will be undefined, and `chrome.runtime.lastError` will be set.
13991
+ *
13992
+ * @chrome-returns-extra since Chrome 117
13993
+ * @since Chrome 44
13994
+ */
13995
+ export function requestFileSystem(
13996
+
13997
+ options: RequestFileSystemOptions,
13998
+ ): Promise<FileSystem | undefined>;
13999
+
14000
+ /**
14001
+ * Requests access to a file system for a volume represented by `options.volumeId`. If `options.writable` is set to true, then the file system will be writable. Otherwise, it will be read-only. The `writable` option requires the `"fileSystem": {"write"}` permission in the manifest. Available to kiosk apps running in kiosk session only. For manual-launch kiosk mode, a confirmation dialog will be shown on top of the active app window. In case of an error, `fileSystem` will be undefined, and `chrome.runtime.lastError` will be set.
14002
+ *
14003
+ * @since Chrome 44
14004
+ */
14005
+ export function requestFileSystem(
14006
+
14007
+ options: RequestFileSystemOptions,
14008
+
14009
+ callback?: (
14010
+ fileSystem?: FileSystem,
14011
+ ) => void,
14012
+ ): void;
14013
+
14014
+ /**
14015
+ * Returns a list of volumes available for `requestFileSystem()`. The `"fileSystem": {"requestFileSystem"}` manifest permission is required. Available to kiosk apps running in the kiosk session only. In case of an error, `volumes` will be undefined, and `chrome.runtime.lastError` will be set.
14016
+ *
14017
+ * @chrome-returns-extra since Chrome 117
14018
+ * @since Chrome 44
14019
+ */
14020
+ export function getVolumeList(): Promise<Volume[] | undefined>;
14021
+
14022
+ /**
14023
+ * Returns a list of volumes available for `requestFileSystem()`. The `"fileSystem": {"requestFileSystem"}` manifest permission is required. Available to kiosk apps running in the kiosk session only. In case of an error, `volumes` will be undefined, and `chrome.runtime.lastError` will be set.
14024
+ *
14025
+ * @since Chrome 44
14026
+ */
14027
+ export function getVolumeList(
14028
+
14029
+ callback?: (
14030
+ volumes?: Volume[],
14031
+ ) => void,
14032
+ ): void;
14033
+ }
14034
+
14035
+ /**
14036
+ * Use the `chrome.fileSystemProvider` API to create file systems, that can be accessible from the file manager on Chrome OS.
14037
+ *
14038
+ * @chrome-permission fileSystemProvider
14039
+ * @chrome-platform chromeos
14040
+ */
14041
+ export namespace fileSystemProvider {
14042
+
14043
+ /**
14044
+ * Error codes used by providing extensions in response to requests as well as in case of errors when calling methods of the API. For success, `"OK"` must be used.
14045
+ */
14046
+ export type ProviderError = "OK" | "FAILED" | "IN_USE" | "EXISTS" | "NOT_FOUND" | "ACCESS_DENIED" | "TOO_MANY_OPENED" | "NO_MEMORY" | "NO_SPACE" | "NOT_A_DIRECTORY" | "INVALID_OPERATION" | "SECURITY" | "ABORT" | "NOT_A_FILE" | "NOT_EMPTY" | "INVALID_URL" | "IO";
14047
+
14048
+ /**
14049
+ * Mode of opening a file. Used by {@link onOpenFileRequested}.
14050
+ */
14051
+ export type OpenFileMode = "READ" | "WRITE";
14052
+
14053
+ /**
14054
+ * Type of a change detected on the observed directory.
14055
+ */
14056
+ export type ChangeType = "CHANGED" | "DELETED";
14057
+
14058
+ /**
14059
+ * List of common actions. `"SHARE"` is for sharing files with others. `"SAVE_FOR_OFFLINE"` for pinning (saving for offline access). `"OFFLINE_NOT_NECESSARY"` for notifying that the file doesn't need to be stored for offline access anymore. Used by {@link onGetActionsRequested} and {@link onExecuteActionRequested}.
14060
+ *
14061
+ * @since Chrome 45
14062
+ */
14063
+ export type CommonActionId = "SAVE_FOR_OFFLINE" | "OFFLINE_NOT_NECESSARY" | "SHARE";
14064
+
14065
+ /**
14066
+ * @since Chrome 117
14067
+ */
14068
+ export interface CloudIdentifier {
14069
+
14070
+ /**
14071
+ * Identifier for the cloud storage provider (e.g. 'drive.google.com').
14072
+ */
14073
+ providerName: string;
14074
+
14075
+ /**
14076
+ * The provider's identifier for the given file/directory.
14077
+ */
14078
+ id: string;
14079
+ }
14080
+
14081
+ /**
14082
+ * @since Chrome 125
14083
+ */
14084
+ export interface CloudFileInfo {
14085
+
14086
+ /**
14087
+ * A tag that represents the version of the file.
14088
+ */
14089
+ versionTag?: string;
14090
+ }
14091
+
14092
+ export interface EntryMetadata {
14093
+
14094
+ /**
14095
+ * True if it is a directory. Must be provided if requested in `options`.
14096
+ */
14097
+ isDirectory?: boolean;
14098
+
14099
+ /**
14100
+ * Name of this entry (not full path name). Must not contain '/'. For root it must be empty. Must be provided if requested in `options`.
14101
+ */
14102
+ name?: string;
14103
+
14104
+ /**
14105
+ * File size in bytes. Must be provided if requested in `options`.
14106
+ */
14107
+ size?: number;
14108
+
14109
+ /**
14110
+ * The last modified time of this entry. Must be provided if requested in `options`.
14111
+ */
14112
+ modificationTime?: Date;
14113
+
14114
+ /**
14115
+ * Mime type for the entry. Always optional, but should be provided if requested in `options`.
14116
+ */
14117
+ mimeType?: string;
14118
+
14119
+ /**
14120
+ * Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the {@link onGetMetadataRequested} event.
14121
+ */
14122
+ thumbnail?: string;
14123
+
14124
+ /**
14125
+ * Cloud storage representation of this entry. Must be provided if requested in `options` and the file is backed by cloud storage. For local files not backed by cloud storage, it should be undefined when requested.
14126
+ *
14127
+ * @since Chrome 117
14128
+ */
14129
+ cloudIdentifier?: CloudIdentifier;
14130
+
14131
+ /**
14132
+ * Information that identifies a specific file in the underlying cloud file system. Must be provided if requested in `options` and the file is backed by cloud storage.
14133
+ *
14134
+ * @since Chrome 125
14135
+ */
14136
+ cloudFileInfo?: CloudFileInfo;
14137
+ }
14138
+
14139
+ export interface Watcher {
14140
+
14141
+ /**
14142
+ * The path of the entry being observed.
14143
+ */
14144
+ entryPath: string;
14145
+
14146
+ /**
14147
+ * Whether watching should include all child entries recursively. It can be true for directories only.
14148
+ */
14149
+ recursive: boolean;
14150
+
14151
+ /**
14152
+ * Tag used by the last notification for the watcher.
14153
+ */
14154
+ lastTag?: string;
14155
+ }
14156
+
14157
+ export interface OpenedFile {
14158
+
14159
+ /**
14160
+ * A request ID to be be used by consecutive read/write and close requests.
14161
+ */
14162
+ openRequestId: number;
14163
+
14164
+ /**
14165
+ * The path of the opened file.
14166
+ */
14167
+ filePath: string;
14168
+
14169
+ /**
14170
+ * Whether the file was opened for reading or writing.
14171
+ */
14172
+ mode: OpenFileMode;
14173
+ }
14174
+
14175
+ export interface FileSystemInfo {
14176
+
14177
+ /**
14178
+ * The identifier of the file system.
14179
+ */
14180
+ fileSystemId: string;
14181
+
14182
+ /**
14183
+ * A human-readable name for the file system.
14184
+ */
14185
+ displayName: string;
14186
+
14187
+ /**
14188
+ * Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files).
14189
+ */
14190
+ writable: boolean;
14191
+
14192
+ /**
14193
+ * The maximum number of files that can be opened at once. If 0, then not limited.
14194
+ */
14195
+ openedFilesLimit: number;
14196
+
14197
+ /**
14198
+ * List of currently opened files.
14199
+ */
14200
+ openedFiles: OpenedFile[];
14201
+
14202
+ /**
14203
+ * Whether the file system supports the `tag` field for observing directories.
14204
+ *
14205
+ * @since Chrome 45
14206
+ */
14207
+ supportsNotifyTag?: boolean;
14208
+
14209
+ /**
14210
+ * List of watchers.
14211
+ *
14212
+ * @since Chrome 45
14213
+ */
14214
+ watchers: Watcher[];
14215
+ }
14216
+
14217
+ export interface MountOptions {
14218
+
14219
+ /**
14220
+ * The string indentifier of the file system. Must be unique per each extension.
14221
+ */
14222
+ fileSystemId: string;
14223
+
14224
+ /**
14225
+ * A human-readable name for the file system.
14226
+ */
14227
+ displayName: string;
14228
+
14229
+ /**
14230
+ * Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files).
14231
+ */
14232
+ writable?: boolean;
14233
+
14234
+ /**
14235
+ * The maximum number of files that can be opened at once. If not specified, or 0, then not limited.
14236
+ */
14237
+ openedFilesLimit?: number;
14238
+
14239
+ /**
14240
+ * Whether the file system supports the `tag` field for observed directories.
14241
+ *
14242
+ * @since Chrome 45
14243
+ */
14244
+ supportsNotifyTag?: boolean;
14245
+
14246
+ /**
14247
+ * Whether the framework should resume the file system at the next sign-in session. True by default.
14248
+ *
14249
+ * @since Chrome 64
14250
+ */
14251
+ persistent?: boolean;
14252
+ }
14253
+
14254
+ export interface UnmountOptions {
14255
+
14256
+ /**
14257
+ * The identifier of the file system to be unmounted.
14258
+ */
14259
+ fileSystemId: string;
14260
+ }
14261
+
14262
+ export interface UnmountRequestedOptions {
14263
+
14264
+ /**
14265
+ * The identifier of the file system to be unmounted.
14266
+ */
14267
+ fileSystemId: string;
14268
+
14269
+ /**
14270
+ * The unique identifier of this request.
14271
+ */
14272
+ requestId: number;
14273
+ }
14274
+
14275
+ export interface GetMetadataRequestedOptions {
14276
+
14277
+ /**
14278
+ * The identifier of the file system related to this operation.
14279
+ */
14280
+ fileSystemId: string;
14281
+
14282
+ /**
14283
+ * The unique identifier of this request.
14284
+ */
14285
+ requestId: number;
14286
+
14287
+ /**
14288
+ * The path of the entry to fetch metadata about.
14289
+ */
14290
+ entryPath: string;
14291
+
14292
+ /**
14293
+ * Set to `true` if `is_directory` value is requested.
14294
+ *
14295
+ * @since Chrome 49
14296
+ */
14297
+ isDirectory: boolean;
14298
+
14299
+ /**
14300
+ * Set to `true` if `name` value is requested.
14301
+ *
14302
+ * @since Chrome 49
14303
+ */
14304
+ name: boolean;
14305
+
14306
+ /**
14307
+ * Set to `true` if `size` value is requested.
14308
+ *
14309
+ * @since Chrome 49
14310
+ */
14311
+ size: boolean;
14312
+
14313
+ /**
14314
+ * Set to `true` if `modificationTime` value is requested.
14315
+ *
14316
+ * @since Chrome 49
14317
+ */
14318
+ modificationTime: boolean;
14319
+
14320
+ /**
14321
+ * Set to `true` if `mimeType` value is requested.
14322
+ *
14323
+ * @since Chrome 49
14324
+ */
14325
+ mimeType: boolean;
14326
+
14327
+ /**
14328
+ * Set to `true` if `thumbnail` value is requested.
14329
+ */
14330
+ thumbnail: boolean;
14331
+
14332
+ /**
14333
+ * Set to `true` if `cloudIdentifier` value is requested.
14334
+ *
14335
+ * @since Chrome 117
14336
+ */
14337
+ cloudIdentifier: boolean;
14338
+
14339
+ /**
14340
+ * Set to `true` if `cloudFileInfo` value is requested.
14341
+ *
14342
+ * @since Chrome 125
14343
+ */
14344
+ cloudFileInfo: boolean;
14345
+ }
14346
+
14347
+ /**
14348
+ * @since Chrome 45
14349
+ */
14350
+ export interface GetActionsRequestedOptions {
14351
+
14352
+ /**
14353
+ * The identifier of the file system related to this operation.
14354
+ */
14355
+ fileSystemId: string;
14356
+
14357
+ /**
14358
+ * The unique identifier of this request.
14359
+ */
14360
+ requestId: number;
14361
+
14362
+ /**
14363
+ * List of paths of entries for the list of actions.
14364
+ *
14365
+ * @since Chrome 47
14366
+ */
14367
+ entryPaths: string[];
14368
+ }
14369
+
14370
+ export interface ReadDirectoryRequestedOptions {
14371
+
14372
+ /**
14373
+ * The identifier of the file system related to this operation.
14374
+ */
14375
+ fileSystemId: string;
14376
+
14377
+ /**
14378
+ * The unique identifier of this request.
14379
+ */
14380
+ requestId: number;
14381
+
14382
+ /**
14383
+ * The path of the directory which contents are requested.
14384
+ */
14385
+ directoryPath: string;
14386
+
14387
+ /**
14388
+ * Set to `true` if `is_directory` value is requested.
14389
+ *
14390
+ * @since Chrome 49
14391
+ */
14392
+ isDirectory: boolean;
14393
+
14394
+ /**
14395
+ * Set to `true` if `name` value is requested.
14396
+ *
14397
+ * @since Chrome 49
14398
+ */
14399
+ name: boolean;
14400
+
14401
+ /**
14402
+ * Set to `true` if `size` value is requested.
14403
+ *
14404
+ * @since Chrome 49
14405
+ */
14406
+ size: boolean;
14407
+
14408
+ /**
14409
+ * Set to `true` if `modificationTime` value is requested.
14410
+ *
14411
+ * @since Chrome 49
14412
+ */
14413
+ modificationTime: boolean;
14414
+
14415
+ /**
14416
+ * Set to `true` if `mimeType` value is requested.
14417
+ *
14418
+ * @since Chrome 49
14419
+ */
14420
+ mimeType: boolean;
14421
+
14422
+ /**
14423
+ * Set to `true` if `thumbnail` value is requested.
14424
+ *
14425
+ * @since Chrome 49
14426
+ */
14427
+ thumbnail: boolean;
14428
+ }
14429
+
14430
+ export interface OpenFileRequestedOptions {
14431
+
14432
+ /**
14433
+ * The identifier of the file system related to this operation.
14434
+ */
14435
+ fileSystemId: string;
14436
+
14437
+ /**
14438
+ * A request ID which will be used by consecutive read/write and close requests.
14439
+ */
14440
+ requestId: number;
14441
+
14442
+ /**
14443
+ * The path of the file to be opened.
14444
+ */
14445
+ filePath: string;
14446
+
14447
+ /**
14448
+ * Whether the file will be used for reading or writing.
14449
+ */
14450
+ mode: OpenFileMode;
14451
+ }
14452
+
14453
+ export interface CloseFileRequestedOptions {
14454
+
14455
+ /**
14456
+ * The identifier of the file system related to this operation.
14457
+ */
14458
+ fileSystemId: string;
14459
+
14460
+ /**
14461
+ * The unique identifier of this request.
14462
+ */
14463
+ requestId: number;
14464
+
14465
+ /**
14466
+ * A request ID used to open the file.
14467
+ */
14468
+ openRequestId: number;
14469
+ }
14470
+
14471
+ export interface ReadFileRequestedOptions {
14472
+
14473
+ /**
14474
+ * The identifier of the file system related to this operation.
14475
+ */
14476
+ fileSystemId: string;
14477
+
14478
+ /**
14479
+ * The unique identifier of this request.
14480
+ */
14481
+ requestId: number;
14482
+
14483
+ /**
14484
+ * A request ID used to open the file.
14485
+ */
14486
+ openRequestId: number;
14487
+
14488
+ /**
14489
+ * Position in the file (in bytes) to start reading from.
14490
+ */
14491
+ offset: number;
14492
+
14493
+ /**
14494
+ * Number of bytes to be returned.
14495
+ */
14496
+ length: number;
14497
+ }
14498
+
14499
+ export interface CreateDirectoryRequestedOptions {
14500
+
14501
+ /**
14502
+ * The identifier of the file system related to this operation.
14503
+ */
14504
+ fileSystemId: string;
14505
+
14506
+ /**
14507
+ * The unique identifier of this request.
14508
+ */
14509
+ requestId: number;
14510
+
14511
+ /**
14512
+ * The path of the directory to be created.
14513
+ */
14514
+ directoryPath: string;
14515
+
14516
+ /**
14517
+ * Whether the operation is recursive (for directories only).
14518
+ */
14519
+ recursive: boolean;
14520
+ }
14521
+
14522
+ export interface DeleteEntryRequestedOptions {
14523
+
14524
+ /**
14525
+ * The identifier of the file system related to this operation.
14526
+ */
14527
+ fileSystemId: string;
14528
+
14529
+ /**
14530
+ * The unique identifier of this request.
14531
+ */
14532
+ requestId: number;
14533
+
14534
+ /**
14535
+ * The path of the entry to be deleted.
14536
+ */
14537
+ entryPath: string;
14538
+
14539
+ /**
14540
+ * Whether the operation is recursive (for directories only).
14541
+ */
14542
+ recursive: boolean;
14543
+ }
14544
+
14545
+ export interface CreateFileRequestedOptions {
14546
+
14547
+ /**
14548
+ * The identifier of the file system related to this operation.
14549
+ */
14550
+ fileSystemId: string;
14551
+
14552
+ /**
14553
+ * The unique identifier of this request.
14554
+ */
14555
+ requestId: number;
14556
+
14557
+ /**
14558
+ * The path of the file to be created.
14559
+ */
14560
+ filePath: string;
14561
+ }
14562
+
14563
+ export interface CopyEntryRequestedOptions {
14564
+
14565
+ /**
14566
+ * The identifier of the file system related to this operation.
14567
+ */
14568
+ fileSystemId: string;
14569
+
14570
+ /**
14571
+ * The unique identifier of this request.
14572
+ */
14573
+ requestId: number;
14574
+
14575
+ /**
14576
+ * The source path of the entry to be copied.
14577
+ */
14578
+ sourcePath: string;
14579
+
14580
+ /**
14581
+ * The destination path for the copy operation.
14582
+ */
14583
+ targetPath: string;
14584
+ }
14585
+
14586
+ export interface MoveEntryRequestedOptions {
14587
+
14588
+ /**
14589
+ * The identifier of the file system related to this operation.
14590
+ */
14591
+ fileSystemId: string;
14592
+
14593
+ /**
14594
+ * The unique identifier of this request.
14595
+ */
14596
+ requestId: number;
14597
+
14598
+ /**
14599
+ * The source path of the entry to be moved into a new place.
14600
+ */
14601
+ sourcePath: string;
14602
+
14603
+ /**
14604
+ * The destination path for the copy operation.
14605
+ */
14606
+ targetPath: string;
14607
+ }
14608
+
14609
+ export interface TruncateRequestedOptions {
14610
+
14611
+ /**
14612
+ * The identifier of the file system related to this operation.
14613
+ */
14614
+ fileSystemId: string;
14615
+
14616
+ /**
14617
+ * The unique identifier of this request.
14618
+ */
14619
+ requestId: number;
14620
+
14621
+ /**
14622
+ * The path of the file to be truncated.
14623
+ */
14624
+ filePath: string;
14625
+
14626
+ /**
14627
+ * Number of bytes to be retained after the operation completes.
14628
+ */
14629
+ length: number;
14630
+ }
14631
+
14632
+ export interface WriteFileRequestedOptions {
14633
+
14634
+ /**
14635
+ * The identifier of the file system related to this operation.
14636
+ */
14637
+ fileSystemId: string;
14638
+
14639
+ /**
14640
+ * The unique identifier of this request.
14641
+ */
14642
+ requestId: number;
14643
+
14644
+ /**
14645
+ * A request ID used to open the file.
14646
+ */
14647
+ openRequestId: number;
14648
+
14649
+ /**
14650
+ * Position in the file (in bytes) to start writing the bytes from.
14651
+ */
14652
+ offset: number;
14653
+
14654
+ /**
14655
+ * Buffer of bytes to be written to the file.
14656
+ */
14657
+ data: ArrayBuffer;
14658
+ }
14659
+
14660
+ export interface AbortRequestedOptions {
14661
+
14662
+ /**
14663
+ * The identifier of the file system related to this operation.
14664
+ */
14665
+ fileSystemId: string;
14666
+
14667
+ /**
14668
+ * The unique identifier of this request.
14669
+ */
14670
+ requestId: number;
14671
+
14672
+ /**
14673
+ * An ID of the request to be aborted.
14674
+ */
14675
+ operationRequestId: number;
14676
+ }
14677
+
14678
+ export interface AddWatcherRequestedOptions {
14679
+
14680
+ /**
14681
+ * The identifier of the file system related to this operation.
14682
+ */
14683
+ fileSystemId: string;
14684
+
14685
+ /**
14686
+ * The unique identifier of this request.
14687
+ */
14688
+ requestId: number;
14689
+
14690
+ /**
14691
+ * The path of the entry to be observed.
14692
+ */
14693
+ entryPath: string;
14694
+
14695
+ /**
14696
+ * Whether observing should include all child entries recursively. It can be true for directories only.
14697
+ */
14698
+ recursive: boolean;
14699
+ }
14700
+
14701
+ export interface RemoveWatcherRequestedOptions {
14702
+
14703
+ /**
14704
+ * The identifier of the file system related to this operation.
14705
+ */
14706
+ fileSystemId: string;
14707
+
14708
+ /**
14709
+ * The unique identifier of this request.
14710
+ */
14711
+ requestId: number;
14712
+
14713
+ /**
14714
+ * The path of the watched entry.
14715
+ */
14716
+ entryPath: string;
14717
+
14718
+ /**
14719
+ * Mode of the watcher.
14720
+ */
14721
+ recursive: boolean;
14722
+ }
14723
+
14724
+ /**
14725
+ * @since Chrome 45
14726
+ */
14727
+ export interface Action {
14728
+
14729
+ /**
14730
+ * The identifier of the action. Any string or {@link CommonActionId} for common actions.
14731
+ */
14732
+ id: string;
14733
+
14734
+ /**
14735
+ * The title of the action. It may be ignored for common actions.
14736
+ */
14737
+ title?: string;
14738
+ }
14739
+
14740
+ /**
14741
+ * @since Chrome 45
14742
+ */
14743
+ export interface ExecuteActionRequestedOptions {
14744
+
14745
+ /**
14746
+ * The identifier of the file system related to this operation.
14747
+ */
14748
+ fileSystemId: string;
14749
+
14750
+ /**
14751
+ * The unique identifier of this request.
14752
+ */
14753
+ requestId: number;
14754
+
14755
+ /**
14756
+ * The set of paths of the entries to be used for the action.
14757
+ *
14758
+ * @since Chrome 47
14759
+ */
14760
+ entryPaths: string[];
14761
+
14762
+ /**
14763
+ * The identifier of the action to be executed.
14764
+ */
14765
+ actionId: string;
14766
+ }
14767
+
14768
+ export interface Change {
14769
+
14770
+ /**
14771
+ * The path of the changed entry.
14772
+ */
14773
+ entryPath: string;
14774
+
14775
+ /**
14776
+ * The type of the change which happened to the entry.
14777
+ */
14778
+ changeType: ChangeType;
14779
+
14780
+ /**
14781
+ * Information relating to the file if backed by a cloud file system.
14782
+ *
14783
+ * @since Chrome 125
14784
+ */
14785
+ cloudFileInfo?: CloudFileInfo;
14786
+ }
14787
+
14788
+ export interface NotifyOptions {
14789
+
14790
+ /**
14791
+ * The identifier of the file system related to this change.
14792
+ */
14793
+ fileSystemId: string;
14794
+
14795
+ /**
14796
+ * The path of the observed entry.
14797
+ */
14798
+ observedPath: string;
14799
+
14800
+ /**
14801
+ * Mode of the observed entry.
14802
+ */
14803
+ recursive: boolean;
14804
+
14805
+ /**
14806
+ * The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries.
14807
+ */
14808
+ changeType: ChangeType;
14809
+
14810
+ /**
14811
+ * List of changes to entries within the observed directory (including the entry itself)
14812
+ */
14813
+ changes?: Change[];
14814
+
14815
+ /**
14816
+ * Tag for the notification. Required if the file system was mounted with the `supportsNotifyTag` option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown.
14817
+ */
14818
+ tag?: string;
14819
+ }
14820
+
14821
+ /**
14822
+ * @since Chrome 44
14823
+ */
14824
+ export interface ConfigureRequestedOptions {
14825
+
14826
+ /**
14827
+ * The identifier of the file system to be configured.
14828
+ */
14829
+ fileSystemId: string;
14830
+
14831
+ /**
14832
+ * The unique identifier of this request.
14833
+ */
14834
+ requestId: number;
14835
+ }
14836
+
14837
+ /**
14838
+ * Raised when unmounting for the file system with the `fileSystemId` identifier is requested. In the response, the {@link unmount} API method must be called together with `successCallback`. If unmounting is not possible (eg. due to a pending operation), then `errorCallback` must be called.
14839
+ */
14840
+ export const onUnmountRequested: events.Event<(
14841
+ options: UnmountRequestedOptions,
14842
+ successCallback: () => void,
14843
+ errorCallback: (
14844
+ error: ProviderError,
14845
+ ) => void,
14846
+ ) => void>;
14847
+
14848
+ /**
14849
+ * Raised when metadata of a file or a directory at `entryPath` is requested. The metadata must be returned with the `successCallback` call. In case of an error, `errorCallback` must be called.
14850
+ */
14851
+ export const onGetMetadataRequested: events.Event<(
14852
+ options: GetMetadataRequestedOptions,
14853
+ successCallback: (
14854
+ metadata: EntryMetadata,
14855
+ ) => void,
14856
+ errorCallback: (
14857
+ error: ProviderError,
14858
+ ) => void,
14859
+ ) => void>;
14860
+
14861
+ /**
14862
+ * Raised when a list of actions for a set of files or directories at `entryPaths` is requested. All of the returned actions must be applicable to each entry. If there are no such actions, an empty array should be returned. The actions must be returned with the `successCallback` call. In case of an error, `errorCallback` must be called.
14863
+ *
14864
+ * @since Chrome 48
14865
+ */
14866
+ export const onGetActionsRequested: events.Event<(
14867
+ options: GetActionsRequestedOptions,
14868
+ successCallback: (
14869
+ actions: Action[],
14870
+ ) => void,
14871
+ errorCallback: (
14872
+ error: ProviderError,
14873
+ ) => void,
14874
+ ) => void>;
14875
+
14876
+ /**
14877
+ * Raised when contents of a directory at `directoryPath` are requested. The results must be returned in chunks by calling the `successCallback` several times. In case of an error, `errorCallback` must be called.
14878
+ */
14879
+ export const onReadDirectoryRequested: events.Event<(
14880
+ options: ReadDirectoryRequestedOptions,
14881
+ successCallback: (
14882
+ entries: EntryMetadata[],
14883
+ hasMore: boolean,
14884
+ ) => void,
14885
+ errorCallback: (
14886
+ error: ProviderError,
14887
+ ) => void,
14888
+ ) => void>;
14889
+
14890
+ /**
14891
+ * Raised when opening a file at `filePath` is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with `MountOptions`.
14892
+ */
14893
+ export const onOpenFileRequested: events.Event<(
14894
+ options: OpenFileRequestedOptions,
14895
+ successCallback: (
14896
+ /**
14897
+ * @since Chrome 125
14898
+ */
14899
+ metadata?: EntryMetadata,
14900
+ ) => void,
14901
+ errorCallback: (
14902
+ error: ProviderError,
14903
+ ) => void,
14904
+ ) => void>;
14905
+
14906
+ /**
14907
+ * Raised when opening a file previously opened with `openRequestId` is requested to be closed.
14908
+ */
14909
+ export const onCloseFileRequested: events.Event<(
14910
+ options: CloseFileRequestedOptions,
14911
+ successCallback: () => void,
14912
+ errorCallback: (
14913
+ error: ProviderError,
14914
+ ) => void,
14915
+ ) => void>;
14916
+
14917
+ /**
14918
+ * Raised when reading contents of a file opened previously with `openRequestId` is requested. The results must be returned in chunks by calling `successCallback` several times. In case of an error, `errorCallback` must be called.
14919
+ */
14920
+ export const onReadFileRequested: events.Event<(
14921
+ options: ReadFileRequestedOptions,
14922
+ successCallback: (
14923
+ data: ArrayBuffer,
14924
+ hasMore: boolean,
14925
+ ) => void,
14926
+ errorCallback: (
14927
+ error: ProviderError,
14928
+ ) => void,
14929
+ ) => void>;
14930
+
14931
+ /**
14932
+ * Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If `recursive` is true, then all of the missing directories on the directory path must be created.
14047
14933
  */
14048
- export interface RequestFileSystemOptions {
14934
+ export const onCreateDirectoryRequested: events.Event<(
14935
+ options: CreateDirectoryRequestedOptions,
14936
+ successCallback: () => void,
14937
+ errorCallback: (
14938
+ error: ProviderError,
14939
+ ) => void,
14940
+ ) => void>;
14049
14941
 
14050
- /**
14051
- * The ID of the requested volume.
14052
- */
14053
- volumeId: string;
14942
+ /**
14943
+ * Raised when deleting an entry is requested. If `recursive` is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well.
14944
+ */
14945
+ export const onDeleteEntryRequested: events.Event<(
14946
+ options: DeleteEntryRequestedOptions,
14947
+ successCallback: () => void,
14948
+ errorCallback: (
14949
+ error: ProviderError,
14950
+ ) => void,
14951
+ ) => void>;
14054
14952
 
14055
- /**
14056
- * Whether the requested file system should be writable. The default is read-only.
14057
- */
14058
- writable?: boolean;
14059
- }
14953
+ /**
14954
+ * Raised when creating a file is requested. If the file already exists, then `errorCallback` must be called with the `"EXISTS"` error code.
14955
+ */
14956
+ export const onCreateFileRequested: events.Event<(
14957
+ options: CreateFileRequestedOptions,
14958
+ successCallback: () => void,
14959
+ errorCallback: (
14960
+ error: ProviderError,
14961
+ ) => void,
14962
+ ) => void>;
14060
14963
 
14061
14964
  /**
14062
- * @since Chrome 44
14965
+ * Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then `errorCallback` must be called.
14063
14966
  */
14064
- export interface Volume {
14967
+ export const onCopyEntryRequested: events.Event<(
14968
+ options: CopyEntryRequestedOptions,
14969
+ successCallback: () => void,
14970
+ errorCallback: (
14971
+ error: ProviderError,
14972
+ ) => void,
14973
+ ) => void>;
14065
14974
 
14066
- volumeId: string;
14975
+ /**
14976
+ * Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then `errorCallback` must be called.
14977
+ */
14978
+ export const onMoveEntryRequested: events.Event<(
14979
+ options: MoveEntryRequestedOptions,
14980
+ successCallback: () => void,
14981
+ errorCallback: (
14982
+ error: ProviderError,
14983
+ ) => void,
14984
+ ) => void>;
14067
14985
 
14068
- writable: boolean;
14069
- }
14986
+ /**
14987
+ * Raised when truncating a file to a desired length is requested. If an error occurs, then `errorCallback` must be called.
14988
+ */
14989
+ export const onTruncateRequested: events.Event<(
14990
+ options: TruncateRequestedOptions,
14991
+ successCallback: () => void,
14992
+ errorCallback: (
14993
+ error: ProviderError,
14994
+ ) => void,
14995
+ ) => void>;
14070
14996
 
14071
14997
  /**
14072
- * @since Chrome 44
14998
+ * Raised when writing contents to a file opened previously with `openRequestId` is requested.
14073
14999
  */
14074
- export interface VolumeListChangedEvent {
15000
+ export const onWriteFileRequested: events.Event<(
15001
+ options: WriteFileRequestedOptions,
15002
+ successCallback: () => void,
15003
+ errorCallback: (
15004
+ error: ProviderError,
15005
+ ) => void,
15006
+ ) => void>;
14075
15007
 
14076
- volumes: Volume[];
14077
- }
15008
+ /**
15009
+ * Raised when aborting an operation with `operationRequestId` is requested. The operation executed with `operationRequestId` must be immediately stopped and `successCallback` of this abort request executed. If aborting fails, then `errorCallback` must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling `errorCallback`, the request may be forcibly aborted.
15010
+ */
15011
+ export const onAbortRequested: events.Event<(
15012
+ options: AbortRequestedOptions,
15013
+ successCallback: () => void,
15014
+ errorCallback: (
15015
+ error: ProviderError,
15016
+ ) => void,
15017
+ ) => void>;
14078
15018
 
14079
15019
  /**
14080
- * Called when a list of available volumes is changed.
15020
+ * Raised when showing a configuration dialog for `fileSystemId` is requested. If it's handled, the `file_system_provider.configurable` manfiest option must be set to true.
14081
15021
  *
14082
15022
  * @since Chrome 44
14083
15023
  */
14084
- export const onVolumeListChanged: events.Event<(
14085
- event: VolumeListChangedEvent,
15024
+ export const onConfigureRequested: events.Event<(
15025
+ options: ConfigureRequestedOptions,
15026
+ successCallback: () => void,
15027
+ errorCallback: (
15028
+ error: ProviderError,
15029
+ ) => void,
14086
15030
  ) => void>;
14087
15031
 
14088
15032
  /**
14089
- * Get the display path of an Entry object. The display path is based on the full path of the file or directory on the local file system, but may be made more readable for display purposes.
15033
+ * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead `app.runtime.onLaunched` should be handled in order to mount new file systems when a file is opened. For multiple mounts, the `file_system_provider.multiple_mounts` manifest option must be set to true.
14090
15034
  *
14091
- * @chrome-returns-extra since Chrome 117
15035
+ * @since Chrome 44
14092
15036
  */
14093
- export function getDisplayPath(
14094
-
14095
- entry: Entry,
14096
- ): Promise<string>;
15037
+ export const onMountRequested: events.Event<(
15038
+ successCallback: () => void,
15039
+ errorCallback: (
15040
+ error: ProviderError,
15041
+ ) => void,
15042
+ ) => void>;
14097
15043
 
14098
15044
  /**
14099
- * Get the display path of an Entry object. The display path is based on the full path of the file or directory on the local file system, but may be made more readable for display purposes.
15045
+ * Raised when setting a new directory watcher is requested. If an error occurs, then `errorCallback` must be called.
15046
+ *
15047
+ * @since Chrome 45
14100
15048
  */
14101
- export function getDisplayPath(
14102
-
14103
- entry: Entry,
14104
-
14105
- callback?: (
14106
- displayPath: string,
15049
+ export const onAddWatcherRequested: events.Event<(
15050
+ options: AddWatcherRequestedOptions,
15051
+ successCallback: () => void,
15052
+ errorCallback: (
15053
+ error: ProviderError,
14107
15054
  ) => void,
14108
- ): void;
15055
+ ) => void>;
14109
15056
 
14110
15057
  /**
14111
- * Get a writable Entry from another Entry. This call will fail with a runtime error if the application does not have the 'write' permission under 'fileSystem'. If entry is a DirectoryEntry, this call will fail if the application does not have the 'directory' permission under 'fileSystem'.
15058
+ * Raised when the watcher should be removed. If an error occurs, then `errorCallback` must be called.
15059
+ *
15060
+ * @since Chrome 45
14112
15061
  */
14113
- export function getWritableEntry(
14114
-
14115
- entry: Entry,
14116
-
14117
- callback: (
14118
- entry: Entry,
15062
+ export const onRemoveWatcherRequested: events.Event<(
15063
+ options: RemoveWatcherRequestedOptions,
15064
+ successCallback: () => void,
15065
+ errorCallback: (
15066
+ error: ProviderError,
14119
15067
  ) => void,
14120
- ): void;
15068
+ ) => void>;
14121
15069
 
14122
15070
  /**
14123
- * Gets whether this Entry is writable or not.
15071
+ * Raised when executing an action for a set of files or directories is\\ requested. After the action is completed, `successCallback` must be called. On error, `errorCallback` must be called.
14124
15072
  *
14125
- * @chrome-returns-extra since Chrome 117
15073
+ * @since Chrome 48
14126
15074
  */
14127
- export function isWritableEntry(
14128
-
14129
- entry: Entry,
14130
- ): Promise<boolean>;
15075
+ export const onExecuteActionRequested: events.Event<(
15076
+ options: ExecuteActionRequestedOptions,
15077
+ successCallback: () => void,
15078
+ errorCallback: (
15079
+ error: ProviderError,
15080
+ ) => void,
15081
+ ) => void>;
14131
15082
 
14132
15083
  /**
14133
- * Gets whether this Entry is writable or not.
15084
+ * Mounts a file system with the given `fileSystemId` and `displayName`. `displayName` will be shown in the left panel of the Files app. `displayName` can contain any characters including '/', but cannot be an empty string. `displayName` must be descriptive but doesn't have to be unique. The `fileSystemId` must not be an empty string.
15085
+ *
15086
+ * Depending on the type of the file system being mounted, the `source` option must be set appropriately.
15087
+ *
15088
+ * In case of an error, {@link runtime.lastError} will be set with a corresponding error code.
15089
+ *
15090
+ * @chrome-returns-extra since Chrome 96
15091
+ * @returns A generic result callback to indicate success or failure.
14134
15092
  */
14135
- export function isWritableEntry(
14136
-
14137
- entry: Entry,
15093
+ export function mount(
14138
15094
 
14139
- callback?: (
14140
- isWritable: boolean,
14141
- ) => void,
14142
- ): void;
15095
+ options: MountOptions,
15096
+ ): Promise<void>;
14143
15097
 
14144
15098
  /**
14145
- * Ask the user to choose a file or directory.
15099
+ * Mounts a file system with the given `fileSystemId` and `displayName`. `displayName` will be shown in the left panel of the Files app. `displayName` can contain any characters including '/', but cannot be an empty string. `displayName` must be descriptive but doesn't have to be unique. The `fileSystemId` must not be an empty string.
15100
+ *
15101
+ * Depending on the type of the file system being mounted, the `source` option must be set appropriately.
15102
+ *
15103
+ * In case of an error, {@link runtime.lastError} will be set with a corresponding error code.
14146
15104
  */
14147
- export function chooseEntry(
15105
+ export function mount(
14148
15106
 
14149
- options: ChooseEntryOptions,
15107
+ options: MountOptions,
14150
15108
 
14151
- callback: (
14152
- entry?: Entry,
14153
- fileEntries?: FileEntry[],
14154
- ) => void,
15109
+ callback?: () => void,
14155
15110
  ): void;
14156
15111
 
14157
15112
  /**
14158
- * Ask the user to choose a file or directory.
15113
+ * Unmounts a file system with the given `fileSystemId`. It must be called after {@link onUnmountRequested} is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error).
15114
+ *
15115
+ * In case of an error, {@link runtime.lastError} will be set with a corresponding error code.
15116
+ *
15117
+ * @chrome-returns-extra since Chrome 96
15118
+ * @returns A generic result callback to indicate success or failure.
14159
15119
  */
14160
- export function chooseEntry(
15120
+ export function unmount(
14161
15121
 
14162
- callback: (
14163
- entry?: Entry,
14164
- fileEntries?: FileEntry[],
14165
- ) => void,
14166
- ): void;
15122
+ options: UnmountOptions,
15123
+ ): Promise<void>;
14167
15124
 
14168
15125
  /**
14169
- * Returns the file entry with the given id if it can be restored. This call will fail with a runtime error otherwise.
15126
+ * Unmounts a file system with the given `fileSystemId`. It must be called after {@link onUnmountRequested} is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error).
15127
+ *
15128
+ * In case of an error, {@link runtime.lastError} will be set with a corresponding error code.
14170
15129
  */
14171
- export function restoreEntry(
15130
+ export function unmount(
14172
15131
 
14173
- id: string,
15132
+ options: UnmountOptions,
14174
15133
 
14175
- callback: (
14176
- entry: Entry,
14177
- ) => void,
15134
+ callback?: () => void,
14178
15135
  ): void;
14179
15136
 
14180
15137
  /**
14181
- * Returns whether the app has permission to restore the entry with the given id.
15138
+ * Returns all file systems mounted by the extension.
14182
15139
  *
14183
- * @chrome-returns-extra since Chrome 117
15140
+ * @chrome-returns-extra since Chrome 96
15141
+ * @returns Callback to receive the result of {@link getAll} function.
14184
15142
  */
14185
- export function isRestorable(
14186
-
14187
- id: string,
14188
- ): Promise<boolean>;
15143
+ export function getAll(): Promise<FileSystemInfo[]>;
14189
15144
 
14190
15145
  /**
14191
- * Returns whether the app has permission to restore the entry with the given id.
15146
+ * Returns all file systems mounted by the extension.
14192
15147
  */
14193
- export function isRestorable(
14194
-
14195
- id: string,
15148
+ export function getAll(
14196
15149
 
14197
15150
  callback?: (
14198
- isRestorable: boolean,
15151
+ fileSystems: FileSystemInfo[],
14199
15152
  ) => void,
14200
15153
  ): void;
14201
15154
 
14202
15155
  /**
14203
- * Returns an id that can be passed to restoreEntry to regain access to a given file entry. Only the 500 most recently used entries are retained, where calls to retainEntry and restoreEntry count as use. If the app has the 'retainEntries' permission under 'fileSystem', entries are retained indefinitely. Otherwise, entries are retained only while the app is running and across restarts.
14204
- */
14205
- export function retainEntry(
14206
-
14207
- entry: Entry,
14208
- ): string;
14209
-
14210
- /**
14211
- * Requests access to a file system for a volume represented by `options.volumeId`. If `options.writable` is set to true, then the file system will be writable. Otherwise, it will be read-only. The `writable` option requires the `"fileSystem": {"write"}` permission in the manifest. Available to kiosk apps running in kiosk session only. For manual-launch kiosk mode, a confirmation dialog will be shown on top of the active app window. In case of an error, `fileSystem` will be undefined, and `chrome.runtime.lastError` will be set.
15156
+ * Returns information about a file system with the passed `fileSystemId`.
14212
15157
  *
14213
- * @chrome-returns-extra since Chrome 117
14214
- * @since Chrome 44
15158
+ * @chrome-returns-extra since Chrome 96
15159
+ * @returns Callback to receive the result of {@link get} function.
14215
15160
  */
14216
- export function requestFileSystem(
15161
+ export function get(
14217
15162
 
14218
- options: RequestFileSystemOptions,
14219
- ): Promise<FileSystem | undefined>;
15163
+ fileSystemId: string,
15164
+ ): Promise<FileSystemInfo>;
14220
15165
 
14221
15166
  /**
14222
- * Requests access to a file system for a volume represented by `options.volumeId`. If `options.writable` is set to true, then the file system will be writable. Otherwise, it will be read-only. The `writable` option requires the `"fileSystem": {"write"}` permission in the manifest. Available to kiosk apps running in kiosk session only. For manual-launch kiosk mode, a confirmation dialog will be shown on top of the active app window. In case of an error, `fileSystem` will be undefined, and `chrome.runtime.lastError` will be set.
14223
- *
14224
- * @since Chrome 44
15167
+ * Returns information about a file system with the passed `fileSystemId`.
14225
15168
  */
14226
- export function requestFileSystem(
15169
+ export function get(
14227
15170
 
14228
- options: RequestFileSystemOptions,
15171
+ fileSystemId: string,
14229
15172
 
14230
15173
  callback?: (
14231
- fileSystem?: FileSystem,
15174
+ fileSystem: FileSystemInfo,
14232
15175
  ) => void,
14233
15176
  ): void;
14234
15177
 
14235
15178
  /**
14236
- * Returns a list of volumes available for `requestFileSystem()`. The `"fileSystem": {"requestFileSystem"}` manifest permission is required. Available to kiosk apps running in the kiosk session only. In case of an error, `volumes` will be undefined, and `chrome.runtime.lastError` will be set.
15179
+ * Notifies about changes in the watched directory at `observedPath` in `recursive` mode. If the file system is mounted with `supportsNotifyTag`, then `tag` must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with {@link getAll}.
14237
15180
  *
14238
- * @chrome-returns-extra since Chrome 117
14239
- * @since Chrome 44
15181
+ * To use, the `file_system_provider.notify` manifest option must be set to true.
15182
+ *
15183
+ * Value of `tag` can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call {@link notify} for all changes which happened since the change tagged as "123". It cannot be an empty string.
15184
+ *
15185
+ * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number.
15186
+ *
15187
+ * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore.
15188
+ *
15189
+ * In case of an error, {@link runtime.lastError} will be set will a corresponding error code.
15190
+ *
15191
+ * @chrome-returns-extra since Chrome 96
15192
+ * @returns A generic result callback to indicate success or failure.
15193
+ * @since Chrome 45
14240
15194
  */
14241
- export function getVolumeList(): Promise<Volume[] | undefined>;
15195
+ export function notify(
15196
+
15197
+ options: NotifyOptions,
15198
+ ): Promise<void>;
14242
15199
 
14243
15200
  /**
14244
- * Returns a list of volumes available for `requestFileSystem()`. The `"fileSystem": {"requestFileSystem"}` manifest permission is required. Available to kiosk apps running in the kiosk session only. In case of an error, `volumes` will be undefined, and `chrome.runtime.lastError` will be set.
15201
+ * Notifies about changes in the watched directory at `observedPath` in `recursive` mode. If the file system is mounted with `supportsNotifyTag`, then `tag` must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with {@link getAll}.
14245
15202
  *
14246
- * @since Chrome 44
15203
+ * To use, the `file_system_provider.notify` manifest option must be set to true.
15204
+ *
15205
+ * Value of `tag` can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call {@link notify} for all changes which happened since the change tagged as "123". It cannot be an empty string.
15206
+ *
15207
+ * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number.
15208
+ *
15209
+ * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore.
15210
+ *
15211
+ * In case of an error, {@link runtime.lastError} will be set will a corresponding error code.
15212
+ *
15213
+ * @since Chrome 45
14247
15214
  */
14248
- export function getVolumeList(
15215
+ export function notify(
14249
15216
 
14250
- callback?: (
14251
- volumes?: Volume[],
14252
- ) => void,
15217
+ options: NotifyOptions,
15218
+
15219
+ callback?: () => void,
14253
15220
  ): void;
14254
15221
  }
14255
15222
 
@@ -18281,99 +19248,6 @@ declare namespace chrome {
18281
19248
  ): void;
18282
19249
  }
18283
19250
 
18284
- /**
18285
- * Schemas for structured manifest entries
18286
- */
18287
- export namespace manifestTypes {
18288
-
18289
- /**
18290
- * Chrome settings which can be overriden by an extension.
18291
- */
18292
- export interface ChromeSettingsOverrides {
18293
-
18294
- /**
18295
- * New value for the homepage.
18296
- */
18297
- homepage?: string;
18298
-
18299
- /**
18300
- * A search engine
18301
- */
18302
- search_provider?: {
18303
-
18304
- /**
18305
- * Name of the search engine displayed to user. This may only be omitted if _prepopulated\_id_ is set.
18306
- */
18307
- name?: string,
18308
-
18309
- /**
18310
- * Omnibox keyword for the search engine. This may only be omitted if _prepopulated\_id_ is set.
18311
- */
18312
- keyword?: string,
18313
-
18314
- /**
18315
- * An icon URL for the search engine. This may only be omitted if _prepopulated\_id_ is set.
18316
- */
18317
- favicon_url?: string,
18318
-
18319
- /**
18320
- * An search URL used by the search engine.
18321
- */
18322
- search_url: string,
18323
-
18324
- /**
18325
- * Encoding of the search term. This may only be omitted if _prepopulated\_id_ is set.
18326
- */
18327
- encoding?: string,
18328
-
18329
- /**
18330
- * If omitted, this engine does not support suggestions.
18331
- */
18332
- suggest_url?: string,
18333
-
18334
- /**
18335
- * If omitted, this engine does not support image search.
18336
- */
18337
- image_url?: string,
18338
-
18339
- /**
18340
- * The string of post parameters to search\_url
18341
- */
18342
- search_url_post_params?: string,
18343
-
18344
- /**
18345
- * The string of post parameters to suggest\_url
18346
- */
18347
- suggest_url_post_params?: string,
18348
-
18349
- /**
18350
- * The string of post parameters to image\_url
18351
- */
18352
- image_url_post_params?: string,
18353
-
18354
- /**
18355
- * A list of URL patterns that can be used, in addition to `search_url`.
18356
- */
18357
- alternate_urls?: string[],
18358
-
18359
- /**
18360
- * An ID of the built-in search engine in Chrome.
18361
- */
18362
- prepopulated_id?: number,
18363
-
18364
- /**
18365
- * Specifies if the search provider should be default.
18366
- */
18367
- is_default: boolean,
18368
- };
18369
-
18370
- /**
18371
- * An array of length one containing a URL to be used as the startup page.
18372
- */
18373
- startup_pages?: string[];
18374
- }
18375
- }
18376
-
18377
19251
  /**
18378
19252
  * Use the `chrome.mdns` API to discover services over mDNS. This comprises a subset of the features of the NSD spec: http://www.w3.org/TR/discovery-api/
18379
19253
  *