chrome-types 0.1.206 → 0.1.207

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 +162 -23
  2. package/index.d.ts +136 -8
  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 Thu Jun 15 2023 22:28:37 GMT+0000 (Coordinated Universal Time)
18
- // Built at 26b7cebb1faf03567f8383e851819d2e63c91e9e
17
+ // Generated on Tue Jun 20 2023 22:30:02 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 02414af8e71af39ab91eaedd45e18bc09437d537
19
19
 
20
20
  // Includes all types, including MV2 + Platform Apps APIs.
21
21
 
@@ -14335,6 +14335,17 @@ declare namespace chrome {
14335
14335
  },
14336
14336
  ) => void>;
14337
14337
 
14338
+ /**
14339
+ * Registers the application with FCM. The registration ID will be returned by the `callback`. If `register` is called again with the same list of `senderIds`, the same registration ID will be returned.
14340
+ *
14341
+ * @chrome-returns-extra since Pending
14342
+ * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs.
14343
+ */
14344
+ export function register(
14345
+
14346
+ senderIds: string[],
14347
+ ): Promise<string>;
14348
+
14338
14349
  /**
14339
14350
  * Registers the application with FCM. The registration ID will be returned by the `callback`. If `register` is called again with the same list of `senderIds`, the same registration ID will be returned.
14340
14351
  *
@@ -14348,11 +14359,18 @@ declare namespace chrome {
14348
14359
  /**
14349
14360
  * @param registrationId A registration ID assigned to the application by the FCM.
14350
14361
  */
14351
- callback: (
14362
+ callback?: (
14352
14363
  registrationId: string,
14353
14364
  ) => void,
14354
14365
  ): void;
14355
14366
 
14367
+ /**
14368
+ * Unregisters the application from FCM.
14369
+ *
14370
+ * @chrome-returns-extra since Pending
14371
+ */
14372
+ export function unregister(): Promise<void>;
14373
+
14356
14374
  /**
14357
14375
  * Unregisters the application from FCM.
14358
14376
  *
@@ -14360,9 +14378,41 @@ declare namespace chrome {
14360
14378
  */
14361
14379
  export function unregister(
14362
14380
 
14363
- callback: () => void,
14381
+ callback?: () => void,
14364
14382
  ): void;
14365
14383
 
14384
+ /**
14385
+ * Sends a message according to its contents.
14386
+ *
14387
+ * @chrome-returns-extra since Pending
14388
+ * @param message A message to send to the other party via FCM.
14389
+ */
14390
+ export function send(
14391
+
14392
+ message: {
14393
+
14394
+ /**
14395
+ * The ID of the server to send the message to as assigned by [Google API Console](https://console.cloud.google.com/apis/dashboard).
14396
+ */
14397
+ destinationId: string,
14398
+
14399
+ /**
14400
+ * The ID of the message. It must be unique for each message in scope of the applications. See the [Cloud Messaging documentation](https://firebase.google.com/docs/cloud-messaging/js/client) for advice for picking and handling an ID.
14401
+ */
14402
+ messageId: string,
14403
+
14404
+ /**
14405
+ * Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The default value of time-to-live is 86,400 seconds (1 day) and the maximum value is 2,419,200 seconds (28 days).
14406
+ */
14407
+ timeToLive?: number,
14408
+
14409
+ /**
14410
+ * Message data to send to the server. Case-insensitive `goog.` and `google`, as well as case-sensitive `collapse_key` are disallowed as key prefixes. Sum of all key/value pairs should not exceed {@link gcm.MAX_MESSAGE_SIZE}.
14411
+ */
14412
+ data: {[name: string]: string},
14413
+ },
14414
+ ): Promise<string>;
14415
+
14366
14416
  /**
14367
14417
  * Sends a message according to its contents.
14368
14418
  *
@@ -14397,7 +14447,7 @@ declare namespace chrome {
14397
14447
  /**
14398
14448
  * @param messageId The ID of the message that the callback was issued for.
14399
14449
  */
14400
- callback: (
14450
+ callback?: (
14401
14451
  messageId: string,
14402
14452
  ) => void,
14403
14453
  ): void;
@@ -17970,22 +18020,22 @@ declare namespace chrome {
17970
18020
 
17971
18021
  /**
17972
18022
  * Get the media galleries configured in this user agent. If none are configured or available, the callback will receive an empty array.
18023
+ *
18024
+ * @chrome-returns-extra since Pending
17973
18025
  */
17974
18026
  export function getMediaFileSystems(
17975
18027
 
17976
- details: MediaFileSystemsDetails,
17977
-
17978
- callback: (
17979
- mediaFileSystems: DOMFileSystem[],
17980
- ) => void,
17981
- ): void;
18028
+ details?: MediaFileSystemsDetails,
18029
+ ): Promise<DOMFileSystem[]>;
17982
18030
 
17983
18031
  /**
17984
18032
  * Get the media galleries configured in this user agent. If none are configured or available, the callback will receive an empty array.
17985
18033
  */
17986
18034
  export function getMediaFileSystems(
17987
18035
 
17988
- callback: (
18036
+ details?: MediaFileSystemsDetails,
18037
+
18038
+ callback?: (
17989
18039
  mediaFileSystems: DOMFileSystem[],
17990
18040
  ) => void,
17991
18041
  ): void;
@@ -18011,17 +18061,15 @@ declare namespace chrome {
18011
18061
 
18012
18062
  /**
18013
18063
  * Gets the media-specific metadata for a media file. This should work for files in media galleries as well as other DOM filesystems.
18064
+ *
18065
+ * @chrome-returns-extra since Pending
18014
18066
  */
18015
18067
  export function getMetadata(
18016
18068
 
18017
18069
  mediaFile: Blob,
18018
18070
 
18019
- options: MediaMetadataOptions,
18020
-
18021
- callback: (
18022
- metadata: MediaMetadata,
18023
- ) => void,
18024
- ): void;
18071
+ options?: MediaMetadataOptions,
18072
+ ): Promise<MediaMetadata>;
18025
18073
 
18026
18074
  /**
18027
18075
  * Gets the media-specific metadata for a media file. This should work for files in media galleries as well as other DOM filesystems.
@@ -18030,19 +18078,31 @@ declare namespace chrome {
18030
18078
 
18031
18079
  mediaFile: Blob,
18032
18080
 
18033
- callback: (
18081
+ options?: MediaMetadataOptions,
18082
+
18083
+ callback?: (
18034
18084
  metadata: MediaMetadata,
18035
18085
  ) => void,
18036
18086
  ): void;
18037
18087
 
18038
18088
  /**
18039
18089
  * Adds a gallery watch for the gallery with the specified gallery ID. The given callback is then fired with a success or failure result.
18090
+ *
18091
+ * @chrome-returns-extra since Pending
18040
18092
  */
18041
18093
  export function addGalleryWatch(
18042
18094
 
18043
18095
  galleryId: string,
18096
+ ): Promise<AddGalleryWatchResult>;
18044
18097
 
18045
- callback: (
18098
+ /**
18099
+ * Adds a gallery watch for the gallery with the specified gallery ID. The given callback is then fired with a success or failure result.
18100
+ */
18101
+ export function addGalleryWatch(
18102
+
18103
+ galleryId: string,
18104
+
18105
+ callback?: (
18046
18106
  result: AddGalleryWatchResult,
18047
18107
  ) => void,
18048
18108
  ): void;
@@ -20104,6 +20164,35 @@ declare namespace chrome {
20104
20164
  */
20105
20165
  export const onShowSettings: events.Event<() => void>;
20106
20166
 
20167
+ /**
20168
+ * Creates and displays a notification.
20169
+ *
20170
+ * @chrome-returns-extra since Pending
20171
+ * @param notificationId
20172
+
20173
+ Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. The identifier may not be longer than 500 characters.
20174
+
20175
+ The `notificationId` parameter is required before Chrome 42.
20176
+ * @param options Contents of the notification.
20177
+ */
20178
+ export function create(
20179
+
20180
+ notificationId: string,
20181
+
20182
+ options: NotificationOptions,
20183
+ ): Promise<string>;
20184
+
20185
+ /**
20186
+ * Creates and displays a notification.
20187
+ *
20188
+ * @chrome-returns-extra since Pending
20189
+ * @param options Contents of the notification.
20190
+ */
20191
+ export function create(
20192
+
20193
+ options: NotificationOptions,
20194
+ ): Promise<string>;
20195
+
20107
20196
  /**
20108
20197
  * Creates and displays a notification.
20109
20198
  *
@@ -20149,6 +20238,20 @@ declare namespace chrome {
20149
20238
  ) => void,
20150
20239
  ): void;
20151
20240
 
20241
+ /**
20242
+ * Updates an existing notification.
20243
+ *
20244
+ * @chrome-returns-extra since Pending
20245
+ * @param notificationId The id of the notification to be updated. This is returned by {@link notifications.create} method.
20246
+ * @param options Contents of the notification to update to.
20247
+ */
20248
+ export function update(
20249
+
20250
+ notificationId: string,
20251
+
20252
+ options: NotificationOptions,
20253
+ ): Promise<boolean>;
20254
+
20152
20255
  /**
20153
20256
  * Updates an existing notification.
20154
20257
  *
@@ -20171,6 +20274,17 @@ declare namespace chrome {
20171
20274
  ) => void,
20172
20275
  ): void;
20173
20276
 
20277
+ /**
20278
+ * Clears the specified notification.
20279
+ *
20280
+ * @chrome-returns-extra since Pending
20281
+ * @param notificationId The id of the notification to be cleared. This is returned by {@link notifications.create} method.
20282
+ */
20283
+ export function clear(
20284
+
20285
+ notificationId: string,
20286
+ ): Promise<boolean>;
20287
+
20174
20288
  /**
20175
20289
  * Clears the specified notification.
20176
20290
  *
@@ -20190,6 +20304,13 @@ declare namespace chrome {
20190
20304
  ) => void,
20191
20305
  ): void;
20192
20306
 
20307
+ /**
20308
+ * Retrieves all the notifications of this app or extension.
20309
+ *
20310
+ * @chrome-returns-extra since Pending
20311
+ */
20312
+ export function getAll(): Promise<{[name: string]: any}>;
20313
+
20193
20314
  /**
20194
20315
  * Retrieves all the notifications of this app or extension.
20195
20316
  *
@@ -20197,11 +20318,18 @@ declare namespace chrome {
20197
20318
  */
20198
20319
  export function getAll(
20199
20320
 
20200
- callback: (
20321
+ callback?: (
20201
20322
  notifications: {[name: string]: any},
20202
20323
  ) => void,
20203
20324
  ): void;
20204
20325
 
20326
+ /**
20327
+ * Retrieves whether the user has enabled notifications from this app or extension.
20328
+ *
20329
+ * @chrome-returns-extra since Pending
20330
+ */
20331
+ export function getPermissionLevel(): Promise<PermissionLevel>;
20332
+
20205
20333
  /**
20206
20334
  * Retrieves whether the user has enabled notifications from this app or extension.
20207
20335
  *
@@ -20209,7 +20337,7 @@ declare namespace chrome {
20209
20337
  */
20210
20338
  export function getPermissionLevel(
20211
20339
 
20212
- callback: (
20340
+ callback?: (
20213
20341
  level: PermissionLevel,
20214
20342
  ) => void,
20215
20343
  ): void;
@@ -31591,13 +31719,24 @@ declare namespace chrome {
31591
31719
  /**
31592
31720
  * Tries to reset the USB device. If the reset fails, the given connection handle will be closed and the USB device will appear to be disconnected then reconnected. In this case {@link getDevices} or {@link findDevices} must be called again to acquire the device.
31593
31721
  *
31722
+ * @chrome-returns-extra since Pending
31594
31723
  * @param handle A connection handle to reset.
31595
31724
  */
31596
31725
  export function resetDevice(
31597
31726
 
31598
31727
  handle: ConnectionHandle,
31728
+ ): Promise<boolean>;
31599
31729
 
31600
- callback: (
31730
+ /**
31731
+ * Tries to reset the USB device. If the reset fails, the given connection handle will be closed and the USB device will appear to be disconnected then reconnected. In this case {@link getDevices} or {@link findDevices} must be called again to acquire the device.
31732
+ *
31733
+ * @param handle A connection handle to reset.
31734
+ */
31735
+ export function resetDevice(
31736
+
31737
+ handle: ConnectionHandle,
31738
+
31739
+ callback?: (
31601
31740
  success: boolean,
31602
31741
  ) => void,
31603
31742
  ): void;
package/index.d.ts CHANGED
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // Generated on Thu Jun 15 2023 22:28:32 GMT+0000 (Coordinated Universal Time)
18
- // Built at 26b7cebb1faf03567f8383e851819d2e63c91e9e
17
+ // Generated on Tue Jun 20 2023 22:29:56 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 02414af8e71af39ab91eaedd45e18bc09437d537
19
19
 
20
20
  // Includes MV3+ APIs only.
21
21
 
@@ -10133,6 +10133,17 @@ declare namespace chrome {
10133
10133
  },
10134
10134
  ) => void>;
10135
10135
 
10136
+ /**
10137
+ * Registers the application with FCM. The registration ID will be returned by the `callback`. If `register` is called again with the same list of `senderIds`, the same registration ID will be returned.
10138
+ *
10139
+ * @chrome-returns-extra since Pending
10140
+ * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs.
10141
+ */
10142
+ export function register(
10143
+
10144
+ senderIds: string[],
10145
+ ): Promise<string>;
10146
+
10136
10147
  /**
10137
10148
  * Registers the application with FCM. The registration ID will be returned by the `callback`. If `register` is called again with the same list of `senderIds`, the same registration ID will be returned.
10138
10149
  *
@@ -10146,11 +10157,18 @@ declare namespace chrome {
10146
10157
  /**
10147
10158
  * @param registrationId A registration ID assigned to the application by the FCM.
10148
10159
  */
10149
- callback: (
10160
+ callback?: (
10150
10161
  registrationId: string,
10151
10162
  ) => void,
10152
10163
  ): void;
10153
10164
 
10165
+ /**
10166
+ * Unregisters the application from FCM.
10167
+ *
10168
+ * @chrome-returns-extra since Pending
10169
+ */
10170
+ export function unregister(): Promise<void>;
10171
+
10154
10172
  /**
10155
10173
  * Unregisters the application from FCM.
10156
10174
  *
@@ -10158,9 +10176,41 @@ declare namespace chrome {
10158
10176
  */
10159
10177
  export function unregister(
10160
10178
 
10161
- callback: () => void,
10179
+ callback?: () => void,
10162
10180
  ): void;
10163
10181
 
10182
+ /**
10183
+ * Sends a message according to its contents.
10184
+ *
10185
+ * @chrome-returns-extra since Pending
10186
+ * @param message A message to send to the other party via FCM.
10187
+ */
10188
+ export function send(
10189
+
10190
+ message: {
10191
+
10192
+ /**
10193
+ * The ID of the server to send the message to as assigned by [Google API Console](https://console.cloud.google.com/apis/dashboard).
10194
+ */
10195
+ destinationId: string,
10196
+
10197
+ /**
10198
+ * The ID of the message. It must be unique for each message in scope of the applications. See the [Cloud Messaging documentation](https://firebase.google.com/docs/cloud-messaging/js/client) for advice for picking and handling an ID.
10199
+ */
10200
+ messageId: string,
10201
+
10202
+ /**
10203
+ * Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The default value of time-to-live is 86,400 seconds (1 day) and the maximum value is 2,419,200 seconds (28 days).
10204
+ */
10205
+ timeToLive?: number,
10206
+
10207
+ /**
10208
+ * Message data to send to the server. Case-insensitive `goog.` and `google`, as well as case-sensitive `collapse_key` are disallowed as key prefixes. Sum of all key/value pairs should not exceed {@link gcm.MAX_MESSAGE_SIZE}.
10209
+ */
10210
+ data: {[name: string]: string},
10211
+ },
10212
+ ): Promise<string>;
10213
+
10164
10214
  /**
10165
10215
  * Sends a message according to its contents.
10166
10216
  *
@@ -10195,7 +10245,7 @@ declare namespace chrome {
10195
10245
  /**
10196
10246
  * @param messageId The ID of the message that the callback was issued for.
10197
10247
  */
10198
- callback: (
10248
+ callback?: (
10199
10249
  messageId: string,
10200
10250
  ) => void,
10201
10251
  ): void;
@@ -15281,6 +15331,35 @@ declare namespace chrome {
15281
15331
  */
15282
15332
  export const onShowSettings: events.Event<() => void>;
15283
15333
 
15334
+ /**
15335
+ * Creates and displays a notification.
15336
+ *
15337
+ * @chrome-returns-extra since Pending
15338
+ * @param notificationId
15339
+
15340
+ Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. The identifier may not be longer than 500 characters.
15341
+
15342
+ The `notificationId` parameter is required before Chrome 42.
15343
+ * @param options Contents of the notification.
15344
+ */
15345
+ export function create(
15346
+
15347
+ notificationId: string,
15348
+
15349
+ options: NotificationOptions,
15350
+ ): Promise<string>;
15351
+
15352
+ /**
15353
+ * Creates and displays a notification.
15354
+ *
15355
+ * @chrome-returns-extra since Pending
15356
+ * @param options Contents of the notification.
15357
+ */
15358
+ export function create(
15359
+
15360
+ options: NotificationOptions,
15361
+ ): Promise<string>;
15362
+
15284
15363
  /**
15285
15364
  * Creates and displays a notification.
15286
15365
  *
@@ -15326,6 +15405,20 @@ declare namespace chrome {
15326
15405
  ) => void,
15327
15406
  ): void;
15328
15407
 
15408
+ /**
15409
+ * Updates an existing notification.
15410
+ *
15411
+ * @chrome-returns-extra since Pending
15412
+ * @param notificationId The id of the notification to be updated. This is returned by {@link notifications.create} method.
15413
+ * @param options Contents of the notification to update to.
15414
+ */
15415
+ export function update(
15416
+
15417
+ notificationId: string,
15418
+
15419
+ options: NotificationOptions,
15420
+ ): Promise<boolean>;
15421
+
15329
15422
  /**
15330
15423
  * Updates an existing notification.
15331
15424
  *
@@ -15348,6 +15441,17 @@ declare namespace chrome {
15348
15441
  ) => void,
15349
15442
  ): void;
15350
15443
 
15444
+ /**
15445
+ * Clears the specified notification.
15446
+ *
15447
+ * @chrome-returns-extra since Pending
15448
+ * @param notificationId The id of the notification to be cleared. This is returned by {@link notifications.create} method.
15449
+ */
15450
+ export function clear(
15451
+
15452
+ notificationId: string,
15453
+ ): Promise<boolean>;
15454
+
15351
15455
  /**
15352
15456
  * Clears the specified notification.
15353
15457
  *
@@ -15367,6 +15471,13 @@ declare namespace chrome {
15367
15471
  ) => void,
15368
15472
  ): void;
15369
15473
 
15474
+ /**
15475
+ * Retrieves all the notifications of this app or extension.
15476
+ *
15477
+ * @chrome-returns-extra since Pending
15478
+ */
15479
+ export function getAll(): Promise<{[name: string]: any}>;
15480
+
15370
15481
  /**
15371
15482
  * Retrieves all the notifications of this app or extension.
15372
15483
  *
@@ -15374,11 +15485,18 @@ declare namespace chrome {
15374
15485
  */
15375
15486
  export function getAll(
15376
15487
 
15377
- callback: (
15488
+ callback?: (
15378
15489
  notifications: {[name: string]: any},
15379
15490
  ) => void,
15380
15491
  ): void;
15381
15492
 
15493
+ /**
15494
+ * Retrieves whether the user has enabled notifications from this app or extension.
15495
+ *
15496
+ * @chrome-returns-extra since Pending
15497
+ */
15498
+ export function getPermissionLevel(): Promise<PermissionLevel>;
15499
+
15382
15500
  /**
15383
15501
  * Retrieves whether the user has enabled notifications from this app or extension.
15384
15502
  *
@@ -15386,7 +15504,7 @@ declare namespace chrome {
15386
15504
  */
15387
15505
  export function getPermissionLevel(
15388
15506
 
15389
- callback: (
15507
+ callback?: (
15390
15508
  level: PermissionLevel,
15391
15509
  ) => void,
15392
15510
  ): void;
@@ -24803,8 +24921,18 @@ declare namespace chrome {
24803
24921
  export function resetDevice(
24804
24922
 
24805
24923
  handle: ConnectionHandle,
24924
+ ): Promise<boolean>;
24806
24925
 
24807
- callback: (
24926
+ /**
24927
+ * Tries to reset the USB device. If the reset fails, the given connection handle will be closed and the USB device will appear to be disconnected then reconnected. In this case {@link getDevices} or {@link findDevices} must be called again to acquire the device.
24928
+ *
24929
+ * @param handle A connection handle to reset.
24930
+ */
24931
+ export function resetDevice(
24932
+
24933
+ handle: ConnectionHandle,
24934
+
24935
+ callback?: (
24808
24936
  success: boolean,
24809
24937
  ) => void,
24810
24938
  ): void;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "name": "chrome-types",
7
7
  "config": {
8
- "build-hash": "e821a8ef452e479e"
8
+ "build-hash": "0edf70fe9e89c745"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
@@ -16,5 +16,5 @@
16
16
  "url": "https://github.com/GoogleChrome/chrome-types/issues"
17
17
  },
18
18
  "homepage": "https://github.com/GoogleChrome/chrome-types",
19
- "version": "0.1.206"
19
+ "version": "0.1.207"
20
20
  }