chrome-types 0.1.127 → 0.1.130

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 +101 -14
  2. package/index.d.ts +100 -13
  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 Mon Jul 18 2022 22:29:33 GMT+0000 (Coordinated Universal Time)
18
- // Built at 5a3f9deda7d79e7e5ecaa8a66730a87348a3e854
17
+ // Generated on Fri Jul 22 2022 22:29:32 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 685e5a75f8909c7e95143e95755e307331578249
19
19
 
20
20
  // Includes all types, including MV2 + Platform Apps APIs.
21
21
 
@@ -3544,7 +3544,7 @@ declare namespace chrome {
3544
3544
  transport?: Transport;
3545
3545
 
3546
3546
  /**
3547
- * The remaining battery of the device. TODO(https://crbug.com/973237): This field is only used by Chrome OS and it is different from others because it is not filled by the platform. In the future, when there is a unified Mojo service, this field will be moved to BluetoothDeviceInfo.
3547
+ * The remaining battery of the device.
3548
3548
  *
3549
3549
  * @since Chrome 77
3550
3550
  */
@@ -11759,6 +11759,17 @@ declare namespace chrome {
11759
11759
  size?: 16 | 32;
11760
11760
  }
11761
11761
 
11762
+ /**
11763
+ * @since Pending
11764
+ */
11765
+ export interface UiOptions {
11766
+
11767
+ /**
11768
+ * Enable or disable the download UI.
11769
+ */
11770
+ enabled: boolean;
11771
+ }
11772
+
11762
11773
  /**
11763
11774
  * This event fires with the {@link DownloadItem} object when a download begins.
11764
11775
  */
@@ -12038,6 +12049,31 @@ declare namespace chrome {
12038
12049
 
12039
12050
  enabled: boolean,
12040
12051
  ): void;
12052
+
12053
+ /**
12054
+ * Change the download UI of every window associated with the current browser profile. As long as at least one extension has set {@link UiOptions.enabled} to false, the download UI will be hidden. Setting {@link UiOptions.enabled} to true while at least one other extension has disabled it will return an error through {@link runtime.lastError}. Requires the `"downloads.ui"` permission in addition to the `"downloads"` permission.
12055
+ *
12056
+ * @param options Encapsulate a change to the download UI.
12057
+ * @since Pending
12058
+ */
12059
+ export function setUiOptions(
12060
+
12061
+ options: UiOptions,
12062
+ ): Promise<void>;
12063
+
12064
+ /**
12065
+ * Change the download UI of every window associated with the current browser profile. As long as at least one extension has set {@link UiOptions.enabled} to false, the download UI will be hidden. Setting {@link UiOptions.enabled} to true while at least one other extension has disabled it will return an error through {@link runtime.lastError}. Requires the `"downloads.ui"` permission in addition to the `"downloads"` permission.
12066
+ *
12067
+ * @param options Encapsulate a change to the download UI.
12068
+ * @param callback Called when the UI update is completed.
12069
+ * @since Pending
12070
+ */
12071
+ export function setUiOptions(
12072
+
12073
+ options: UiOptions,
12074
+
12075
+ callback?: () => void,
12076
+ ): void;
12041
12077
  }
12042
12078
 
12043
12079
  /**
@@ -16314,6 +16350,15 @@ declare namespace chrome {
16314
16350
  signedIn: boolean,
16315
16351
  ) => void>;
16316
16352
 
16353
+ /**
16354
+ * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
16355
+ *
16356
+ * `getAccounts` is only supported on dev channel.
16357
+ *
16358
+ * @chrome-returns-extra since Pending
16359
+ */
16360
+ export function getAccounts(): Promise<AccountInfo[]>;
16361
+
16317
16362
  /**
16318
16363
  * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
16319
16364
  *
@@ -16321,7 +16366,7 @@ declare namespace chrome {
16321
16366
  */
16322
16367
  export function getAccounts(
16323
16368
 
16324
- callback: (
16369
+ callback?: (
16325
16370
  accounts: AccountInfo[],
16326
16371
  ) => void,
16327
16372
  ): void;
@@ -16374,20 +16419,16 @@ declare namespace chrome {
16374
16419
  *
16375
16420
  * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
16376
16421
  *
16422
+ * @chrome-returns-extra since Pending
16377
16423
  * @param details Profile options.
16378
- * @param callback Called with the `ProfileUserInfo` of the primary Chrome account, of an empty `ProfileUserInfo` if the account with given `details` doesn't exist.
16379
16424
  */
16380
16425
  export function getProfileUserInfo(
16381
16426
 
16382
16427
  /**
16383
16428
  * @since Chrome 84
16384
16429
  */
16385
- details: ProfileDetails,
16386
-
16387
- callback: (
16388
- userInfo: ProfileUserInfo,
16389
- ) => void,
16390
- ): void;
16430
+ details?: ProfileDetails,
16431
+ ): Promise<ProfileUserInfo>;
16391
16432
 
16392
16433
  /**
16393
16434
  * Retrieves email address and obfuscated gaia id of the user signed into a profile.
@@ -16396,15 +16437,34 @@ declare namespace chrome {
16396
16437
  *
16397
16438
  * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
16398
16439
  *
16440
+ * @param details Profile options.
16399
16441
  * @param callback Called with the `ProfileUserInfo` of the primary Chrome account, of an empty `ProfileUserInfo` if the account with given `details` doesn't exist.
16400
16442
  */
16401
16443
  export function getProfileUserInfo(
16402
16444
 
16403
- callback: (
16445
+ /**
16446
+ * @since Chrome 84
16447
+ */
16448
+ details?: ProfileDetails,
16449
+
16450
+ callback?: (
16404
16451
  userInfo: ProfileUserInfo,
16405
16452
  ) => void,
16406
16453
  ): void;
16407
16454
 
16455
+ /**
16456
+ * Removes an OAuth2 access token from the Identity API's token cache.
16457
+ *
16458
+ * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with `getAuthToken`.
16459
+ *
16460
+ * @chrome-returns-extra since Pending
16461
+ * @param details Token information.
16462
+ */
16463
+ export function removeCachedAuthToken(
16464
+
16465
+ details: InvalidTokenDetails,
16466
+ ): Promise<void>;
16467
+
16408
16468
  /**
16409
16469
  * Removes an OAuth2 access token from the Identity API's token cache.
16410
16470
  *
@@ -16420,6 +16480,18 @@ declare namespace chrome {
16420
16480
  callback?: () => void,
16421
16481
  ): void;
16422
16482
 
16483
+ /**
16484
+ * Resets the state of the Identity API:
16485
+ *
16486
+ * * Removes all OAuth2 access tokens from the token cache
16487
+ * * Removes user's account preferences
16488
+ * * De-authorizes the user from all auth flows
16489
+ *
16490
+ * @chrome-returns-extra since Pending
16491
+ * @since Chrome 87
16492
+ */
16493
+ export function clearAllCachedAuthTokens(): Promise<void>;
16494
+
16423
16495
  /**
16424
16496
  * Resets the state of the Identity API:
16425
16497
  *
@@ -16432,9 +16504,24 @@ declare namespace chrome {
16432
16504
  */
16433
16505
  export function clearAllCachedAuthTokens(
16434
16506
 
16435
- callback: () => void,
16507
+ callback?: () => void,
16436
16508
  ): void;
16437
16509
 
16510
+ /**
16511
+ * Starts an auth flow at the specified URL.
16512
+ *
16513
+ * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern `https://<app-id>.chromiumapp.org/*`, the window will close, and the final redirect URL will be passed to the `callback` function.
16514
+ *
16515
+ * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.
16516
+ *
16517
+ * @chrome-returns-extra since Pending
16518
+ * @param details WebAuth flow options.
16519
+ */
16520
+ export function launchWebAuthFlow(
16521
+
16522
+ details: WebAuthFlowDetails,
16523
+ ): Promise<string | undefined>;
16524
+
16438
16525
  /**
16439
16526
  * Starts an auth flow at the specified URL.
16440
16527
  *
@@ -16449,7 +16536,7 @@ declare namespace chrome {
16449
16536
 
16450
16537
  details: WebAuthFlowDetails,
16451
16538
 
16452
- callback: (
16539
+ callback?: (
16453
16540
  responseUrl?: string,
16454
16541
  ) => void,
16455
16542
  ): void;
package/index.d.ts CHANGED
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // Generated on Mon Jul 18 2022 22:29:28 GMT+0000 (Coordinated Universal Time)
18
- // Built at 5a3f9deda7d79e7e5ecaa8a66730a87348a3e854
17
+ // Generated on Fri Jul 22 2022 22:29:27 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 685e5a75f8909c7e95143e95755e307331578249
19
19
 
20
20
  // Includes MV3+ APIs only.
21
21
 
@@ -7965,6 +7965,17 @@ declare namespace chrome {
7965
7965
  size?: 16 | 32;
7966
7966
  }
7967
7967
 
7968
+ /**
7969
+ * @since Pending
7970
+ */
7971
+ export interface UiOptions {
7972
+
7973
+ /**
7974
+ * Enable or disable the download UI.
7975
+ */
7976
+ enabled: boolean;
7977
+ }
7978
+
7968
7979
  /**
7969
7980
  * This event fires with the {@link DownloadItem} object when a download begins.
7970
7981
  */
@@ -8244,6 +8255,31 @@ declare namespace chrome {
8244
8255
 
8245
8256
  enabled: boolean,
8246
8257
  ): void;
8258
+
8259
+ /**
8260
+ * Change the download UI of every window associated with the current browser profile. As long as at least one extension has set {@link UiOptions.enabled} to false, the download UI will be hidden. Setting {@link UiOptions.enabled} to true while at least one other extension has disabled it will return an error through {@link runtime.lastError}. Requires the `"downloads.ui"` permission in addition to the `"downloads"` permission.
8261
+ *
8262
+ * @param options Encapsulate a change to the download UI.
8263
+ * @since Pending
8264
+ */
8265
+ export function setUiOptions(
8266
+
8267
+ options: UiOptions,
8268
+ ): Promise<void>;
8269
+
8270
+ /**
8271
+ * Change the download UI of every window associated with the current browser profile. As long as at least one extension has set {@link UiOptions.enabled} to false, the download UI will be hidden. Setting {@link UiOptions.enabled} to true while at least one other extension has disabled it will return an error through {@link runtime.lastError}. Requires the `"downloads.ui"` permission in addition to the `"downloads"` permission.
8272
+ *
8273
+ * @param options Encapsulate a change to the download UI.
8274
+ * @param callback Called when the UI update is completed.
8275
+ * @since Pending
8276
+ */
8277
+ export function setUiOptions(
8278
+
8279
+ options: UiOptions,
8280
+
8281
+ callback?: () => void,
8282
+ ): void;
8247
8283
  }
8248
8284
 
8249
8285
  /**
@@ -11850,6 +11886,15 @@ declare namespace chrome {
11850
11886
  signedIn: boolean,
11851
11887
  ) => void>;
11852
11888
 
11889
+ /**
11890
+ * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
11891
+ *
11892
+ * `getAccounts` is only supported on dev channel.
11893
+ *
11894
+ * @chrome-returns-extra since Pending
11895
+ */
11896
+ export function getAccounts(): Promise<AccountInfo[]>;
11897
+
11853
11898
  /**
11854
11899
  * Retrieves a list of AccountInfo objects describing the accounts present on the profile.
11855
11900
  *
@@ -11857,7 +11902,7 @@ declare namespace chrome {
11857
11902
  */
11858
11903
  export function getAccounts(
11859
11904
 
11860
- callback: (
11905
+ callback?: (
11861
11906
  accounts: AccountInfo[],
11862
11907
  ) => void,
11863
11908
  ): void;
@@ -11910,20 +11955,16 @@ declare namespace chrome {
11910
11955
  *
11911
11956
  * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
11912
11957
  *
11958
+ * @chrome-returns-extra since Pending
11913
11959
  * @param details Profile options.
11914
- * @param callback Called with the `ProfileUserInfo` of the primary Chrome account, of an empty `ProfileUserInfo` if the account with given `details` doesn't exist.
11915
11960
  */
11916
11961
  export function getProfileUserInfo(
11917
11962
 
11918
11963
  /**
11919
11964
  * @since Chrome 84
11920
11965
  */
11921
- details: ProfileDetails,
11922
-
11923
- callback: (
11924
- userInfo: ProfileUserInfo,
11925
- ) => void,
11926
- ): void;
11966
+ details?: ProfileDetails,
11967
+ ): Promise<ProfileUserInfo>;
11927
11968
 
11928
11969
  /**
11929
11970
  * Retrieves email address and obfuscated gaia id of the user signed into a profile.
@@ -11932,15 +11973,34 @@ declare namespace chrome {
11932
11973
  *
11933
11974
  * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile.
11934
11975
  *
11976
+ * @param details Profile options.
11935
11977
  * @param callback Called with the `ProfileUserInfo` of the primary Chrome account, of an empty `ProfileUserInfo` if the account with given `details` doesn't exist.
11936
11978
  */
11937
11979
  export function getProfileUserInfo(
11938
11980
 
11939
- callback: (
11981
+ /**
11982
+ * @since Chrome 84
11983
+ */
11984
+ details?: ProfileDetails,
11985
+
11986
+ callback?: (
11940
11987
  userInfo: ProfileUserInfo,
11941
11988
  ) => void,
11942
11989
  ): void;
11943
11990
 
11991
+ /**
11992
+ * Removes an OAuth2 access token from the Identity API's token cache.
11993
+ *
11994
+ * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with `getAuthToken`.
11995
+ *
11996
+ * @chrome-returns-extra since Pending
11997
+ * @param details Token information.
11998
+ */
11999
+ export function removeCachedAuthToken(
12000
+
12001
+ details: InvalidTokenDetails,
12002
+ ): Promise<void>;
12003
+
11944
12004
  /**
11945
12005
  * Removes an OAuth2 access token from the Identity API's token cache.
11946
12006
  *
@@ -11956,6 +12016,18 @@ declare namespace chrome {
11956
12016
  callback?: () => void,
11957
12017
  ): void;
11958
12018
 
12019
+ /**
12020
+ * Resets the state of the Identity API:
12021
+ *
12022
+ * * Removes all OAuth2 access tokens from the token cache
12023
+ * * Removes user's account preferences
12024
+ * * De-authorizes the user from all auth flows
12025
+ *
12026
+ * @chrome-returns-extra since Pending
12027
+ * @since Chrome 87
12028
+ */
12029
+ export function clearAllCachedAuthTokens(): Promise<void>;
12030
+
11959
12031
  /**
11960
12032
  * Resets the state of the Identity API:
11961
12033
  *
@@ -11968,9 +12040,24 @@ declare namespace chrome {
11968
12040
  */
11969
12041
  export function clearAllCachedAuthTokens(
11970
12042
 
11971
- callback: () => void,
12043
+ callback?: () => void,
11972
12044
  ): void;
11973
12045
 
12046
+ /**
12047
+ * Starts an auth flow at the specified URL.
12048
+ *
12049
+ * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern `https://<app-id>.chromiumapp.org/*`, the window will close, and the final redirect URL will be passed to the `callback` function.
12050
+ *
12051
+ * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.
12052
+ *
12053
+ * @chrome-returns-extra since Pending
12054
+ * @param details WebAuth flow options.
12055
+ */
12056
+ export function launchWebAuthFlow(
12057
+
12058
+ details: WebAuthFlowDetails,
12059
+ ): Promise<string | undefined>;
12060
+
11974
12061
  /**
11975
12062
  * Starts an auth flow at the specified URL.
11976
12063
  *
@@ -11985,7 +12072,7 @@ declare namespace chrome {
11985
12072
 
11986
12073
  details: WebAuthFlowDetails,
11987
12074
 
11988
- callback: (
12075
+ callback?: (
11989
12076
  responseUrl?: string,
11990
12077
  ) => void,
11991
12078
  ): void;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "name": "chrome-types",
7
7
  "config": {
8
- "build-hash": "283635a1aec31c5e"
8
+ "build-hash": "2e32c6686bea76c3"
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.127"
19
+ "version": "0.1.130"
20
20
  }