chrome-types 0.1.76 → 0.1.80

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 +95 -8
  2. package/index.d.ts +95 -8
  3. package/package.json +2 -2
package/_all.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2021 Google LLC
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // Generated on Tue Dec 28 2021 22:28:31 GMT+0000 (Coordinated Universal Time)
18
- // Built at 7965be8be52e2689ad17e4cdf599aa2fc88fb968
17
+ // Generated on Wed Jan 05 2022 22:28:25 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 60c8b84b630f57cf62e3da6009aedfd0f35b90f0
19
19
 
20
20
  // Includes all types, including MV2 + Platform Apps APIs.
21
21
 
@@ -7301,6 +7301,13 @@ declare namespace chrome {
7301
7301
  */
7302
7302
  all_frames?: boolean;
7303
7303
 
7304
+ /**
7305
+ * Whether the script should inject into any frames where the URL belongs to a scheme that would never match a specified Match Pattern, including about:, data:, blob:, and filesystem: schemes. In these cases, in order to determine if the script should inject, the origin of the URL is checked. If the origin is `null` (as is the case for data: URLs), then the "initiator" or "creator" origin is used (i.e., the origin of the frame that created or navigated this frame). Note that this may not be the parent frame, if the frame was navigated by another frame in the document hierarchy.
7306
+ *
7307
+ * @since Pending
7308
+ */
7309
+ match_origin_as_fallback?: boolean;
7310
+
7304
7311
  /**
7305
7312
  * Whether the script should inject into an about:blank frame where the parent or opener frame matches one of the patterns declared in matches. Defaults to false.
7306
7313
  */
@@ -8755,6 +8762,7 @@ declare namespace chrome {
8755
8762
  * Declarative event action that shows the extension's {@link pageAction page action} while the corresponding conditions are met. This action can be used without [host permissions](https://developer.chrome.com/docs/extensions/declare_permissions#host-permissions), but the extension must have a page action. If the extension has the [activeTab](https://developer.chrome.com/docs/extensions/activeTab) permission, clicking the page action grants access to the active tab.
8756
8763
  *
8757
8764
  * @deprecated Please use {@link declarativeContent.ShowAction}.
8765
+ * @chrome-deprecated-since Chrome 97
8758
8766
  */
8759
8767
  export class ShowPageAction {
8760
8768
  constructor(arg: ShowPageAction);
@@ -8763,7 +8771,7 @@ declare namespace chrome {
8763
8771
  /**
8764
8772
  * Declarative event action that shows the extension's toolbar action ({@link pageAction page action} or {@link browserAction browser action}) while the corresponding conditions are met. This action can be used without [host permissions](https://developer.chrome.com/docs/extensions/declare_permissions#host-permissions). If the extension has the [activeTab](https://developer.chrome.com/docs/extensions/activeTab) permission, clicking the page action grants access to the active tab.
8765
8773
  *
8766
- * @since Pending
8774
+ * @since Chrome 97
8767
8775
  */
8768
8776
  export class ShowAction {
8769
8777
  constructor(arg: ShowAction);
@@ -12047,7 +12055,7 @@ declare namespace chrome {
12047
12055
  *
12048
12056
  * Keys generated on a specific `Token` cannot be used with any other Tokens, nor can they be used with `window.crypto.subtle`. Equally, `Key` objects created with `window.crypto.subtle` cannot be used with this interface.
12049
12057
  *
12050
- * @since Pending
12058
+ * @since Chrome 97
12051
12059
  */
12052
12060
  softwareBackedSubtleCrypto: SubtleCrypto;
12053
12061
  }
@@ -15846,6 +15854,13 @@ declare namespace chrome {
15846
15854
  */
15847
15855
  export type LanguageCode = string;
15848
15856
 
15857
+ /**
15858
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use {@link i18n.getUILanguage}.
15859
+ *
15860
+ * @chrome-returns-extra since Pending
15861
+ */
15862
+ export function getAcceptLanguages(): Promise<LanguageCode[]>;
15863
+
15849
15864
  /**
15850
15865
  * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use {@link i18n.getUILanguage}.
15851
15866
  */
@@ -15854,7 +15869,7 @@ declare namespace chrome {
15854
15869
  /**
15855
15870
  * @param languages Array of LanguageCode
15856
15871
  */
15857
- callback: (
15872
+ callback?: (
15858
15873
  languages: LanguageCode[],
15859
15874
  ) => void,
15860
15875
  ): void;
@@ -15892,6 +15907,37 @@ declare namespace chrome {
15892
15907
  */
15893
15908
  export function getUILanguage(): string;
15894
15909
 
15910
+ /**
15911
+ * Detects the language of the provided text using CLD.
15912
+ *
15913
+ * @chrome-returns-extra since Pending
15914
+ * @param text User input string to be translated.
15915
+ * @since Chrome 47
15916
+ */
15917
+ export function detectLanguage(
15918
+
15919
+ text: string,
15920
+ ): Promise<{
15921
+
15922
+ /**
15923
+ * CLD detected language reliability
15924
+ */
15925
+ isReliable: boolean,
15926
+
15927
+ /**
15928
+ * array of detectedLanguage
15929
+ */
15930
+ languages: {
15931
+
15932
+ language: LanguageCode,
15933
+
15934
+ /**
15935
+ * The percentage of the detected language
15936
+ */
15937
+ percentage: number,
15938
+ }[],
15939
+ }>;
15940
+
15895
15941
  /**
15896
15942
  * Detects the language of the provided text using CLD.
15897
15943
  *
@@ -15905,7 +15951,7 @@ declare namespace chrome {
15905
15951
  /**
15906
15952
  * @param result LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage
15907
15953
  */
15908
- callback: (
15954
+ callback?: (
15909
15955
  result: {
15910
15956
 
15911
15957
  /**
@@ -22509,6 +22555,17 @@ declare namespace chrome {
22509
22555
  ) => void,
22510
22556
  ): void;
22511
22557
 
22558
+ /**
22559
+ * Open your Extension's options page, if possible.
22560
+ *
22561
+ * The precise behavior may depend on your manifest's `[options_ui](https://developer.chrome.com/docs/extensions/optionsV2)` or `[options_page](https://developer.chrome.com/docs/extensions/options)` key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.
22562
+ *
22563
+ * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set {@link lastError}.
22564
+ *
22565
+ * @chrome-returns-extra since Pending
22566
+ */
22567
+ export function openOptionsPage(): Promise<void>;
22568
+
22512
22569
  /**
22513
22570
  * Open your Extension's options page, if possible.
22514
22571
  *
@@ -22539,6 +22596,17 @@ declare namespace chrome {
22539
22596
  path: string,
22540
22597
  ): string;
22541
22598
 
22599
+ /**
22600
+ * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
22601
+ *
22602
+ * @chrome-returns-extra since Pending
22603
+ * @param url URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
22604
+ */
22605
+ export function setUninstallURL(
22606
+
22607
+ url: string,
22608
+ ): Promise<void>;
22609
+
22542
22610
  /**
22543
22611
  * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
22544
22612
  *
@@ -22590,6 +22658,18 @@ declare namespace chrome {
22590
22658
  */
22591
22659
  export function restart(): void;
22592
22660
 
22661
+ /**
22662
+ * Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
22663
+ *
22664
+ * @chrome-returns-extra since Pending
22665
+ * @param seconds Time to wait in seconds before rebooting the device, or -1 to cancel a scheduled reboot.
22666
+ * @since Chrome 53
22667
+ */
22668
+ export function restartAfterDelay(
22669
+
22670
+ seconds: number,
22671
+ ): Promise<void>;
22672
+
22593
22673
  /**
22594
22674
  * Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
22595
22675
  *
@@ -22773,6 +22853,13 @@ declare namespace chrome {
22773
22853
  ) => void,
22774
22854
  ): void;
22775
22855
 
22856
+ /**
22857
+ * Returns information about the current platform.
22858
+ *
22859
+ * @chrome-returns-extra since Pending
22860
+ */
22861
+ export function getPlatformInfo(): Promise<PlatformInfo>;
22862
+
22776
22863
  /**
22777
22864
  * Returns information about the current platform.
22778
22865
  *
@@ -22780,7 +22867,7 @@ declare namespace chrome {
22780
22867
  */
22781
22868
  export function getPlatformInfo(
22782
22869
 
22783
- callback: (
22870
+ callback?: (
22784
22871
  platformInfo: PlatformInfo,
22785
22872
  ) => void,
22786
22873
  ): void;
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2021 Google LLC
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- // Generated on Tue Dec 28 2021 22:28:26 GMT+0000 (Coordinated Universal Time)
18
- // Built at 7965be8be52e2689ad17e4cdf599aa2fc88fb968
17
+ // Generated on Wed Jan 05 2022 22:28:21 GMT+0000 (Coordinated Universal Time)
18
+ // Built at 60c8b84b630f57cf62e3da6009aedfd0f35b90f0
19
19
 
20
20
  // Includes MV3+ APIs only.
21
21
 
@@ -3868,6 +3868,13 @@ declare namespace chrome {
3868
3868
  */
3869
3869
  all_frames?: boolean;
3870
3870
 
3871
+ /**
3872
+ * Whether the script should inject into any frames where the URL belongs to a scheme that would never match a specified Match Pattern, including about:, data:, blob:, and filesystem: schemes. In these cases, in order to determine if the script should inject, the origin of the URL is checked. If the origin is `null` (as is the case for data: URLs), then the "initiator" or "creator" origin is used (i.e., the origin of the frame that created or navigated this frame). Note that this may not be the parent frame, if the frame was navigated by another frame in the document hierarchy.
3873
+ *
3874
+ * @since Pending
3875
+ */
3876
+ match_origin_as_fallback?: boolean;
3877
+
3871
3878
  /**
3872
3879
  * Whether the script should inject into an about:blank frame where the parent or opener frame matches one of the patterns declared in matches. Defaults to false.
3873
3880
  */
@@ -5322,6 +5329,7 @@ declare namespace chrome {
5322
5329
  * Declarative event action that shows the extension's {@link pageAction page action} while the corresponding conditions are met. This action can be used without [host permissions](https://developer.chrome.com/docs/extensions/declare_permissions#host-permissions), but the extension must have a page action. If the extension has the [activeTab](https://developer.chrome.com/docs/extensions/activeTab) permission, clicking the page action grants access to the active tab.
5323
5330
  *
5324
5331
  * @deprecated Please use {@link declarativeContent.ShowAction}.
5332
+ * @chrome-deprecated-since Chrome 97
5325
5333
  */
5326
5334
  export class ShowPageAction {
5327
5335
  constructor(arg: ShowPageAction);
@@ -5330,7 +5338,7 @@ declare namespace chrome {
5330
5338
  /**
5331
5339
  * Declarative event action that shows the extension's toolbar action ({@link pageAction page action} or {@link browserAction browser action}) while the corresponding conditions are met. This action can be used without [host permissions](https://developer.chrome.com/docs/extensions/declare_permissions#host-permissions). If the extension has the [activeTab](https://developer.chrome.com/docs/extensions/activeTab) permission, clicking the page action grants access to the active tab.
5332
5340
  *
5333
- * @since Pending
5341
+ * @since Chrome 97
5334
5342
  */
5335
5343
  export class ShowAction {
5336
5344
  constructor(arg: ShowAction);
@@ -8018,7 +8026,7 @@ declare namespace chrome {
8018
8026
  *
8019
8027
  * Keys generated on a specific `Token` cannot be used with any other Tokens, nor can they be used with `window.crypto.subtle`. Equally, `Key` objects created with `window.crypto.subtle` cannot be used with this interface.
8020
8028
  *
8021
- * @since Pending
8029
+ * @since Chrome 97
8022
8030
  */
8023
8031
  softwareBackedSubtleCrypto: SubtleCrypto;
8024
8032
  }
@@ -11147,6 +11155,13 @@ declare namespace chrome {
11147
11155
  */
11148
11156
  export type LanguageCode = string;
11149
11157
 
11158
+ /**
11159
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use {@link i18n.getUILanguage}.
11160
+ *
11161
+ * @chrome-returns-extra since Pending
11162
+ */
11163
+ export function getAcceptLanguages(): Promise<LanguageCode[]>;
11164
+
11150
11165
  /**
11151
11166
  * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use {@link i18n.getUILanguage}.
11152
11167
  */
@@ -11155,7 +11170,7 @@ declare namespace chrome {
11155
11170
  /**
11156
11171
  * @param languages Array of LanguageCode
11157
11172
  */
11158
- callback: (
11173
+ callback?: (
11159
11174
  languages: LanguageCode[],
11160
11175
  ) => void,
11161
11176
  ): void;
@@ -11193,6 +11208,37 @@ declare namespace chrome {
11193
11208
  */
11194
11209
  export function getUILanguage(): string;
11195
11210
 
11211
+ /**
11212
+ * Detects the language of the provided text using CLD.
11213
+ *
11214
+ * @chrome-returns-extra since Pending
11215
+ * @param text User input string to be translated.
11216
+ * @since Chrome 47
11217
+ */
11218
+ export function detectLanguage(
11219
+
11220
+ text: string,
11221
+ ): Promise<{
11222
+
11223
+ /**
11224
+ * CLD detected language reliability
11225
+ */
11226
+ isReliable: boolean,
11227
+
11228
+ /**
11229
+ * array of detectedLanguage
11230
+ */
11231
+ languages: {
11232
+
11233
+ language: LanguageCode,
11234
+
11235
+ /**
11236
+ * The percentage of the detected language
11237
+ */
11238
+ percentage: number,
11239
+ }[],
11240
+ }>;
11241
+
11196
11242
  /**
11197
11243
  * Detects the language of the provided text using CLD.
11198
11244
  *
@@ -11206,7 +11252,7 @@ declare namespace chrome {
11206
11252
  /**
11207
11253
  * @param result LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage
11208
11254
  */
11209
- callback: (
11255
+ callback?: (
11210
11256
  result: {
11211
11257
 
11212
11258
  /**
@@ -15391,6 +15437,17 @@ declare namespace chrome {
15391
15437
  ) => void,
15392
15438
  ): void;
15393
15439
 
15440
+ /**
15441
+ * Open your Extension's options page, if possible.
15442
+ *
15443
+ * The precise behavior may depend on your manifest's `[options_ui](https://developer.chrome.com/docs/extensions/optionsV2)` or `[options_page](https://developer.chrome.com/docs/extensions/options)` key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.
15444
+ *
15445
+ * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set {@link lastError}.
15446
+ *
15447
+ * @chrome-returns-extra since Pending
15448
+ */
15449
+ export function openOptionsPage(): Promise<void>;
15450
+
15394
15451
  /**
15395
15452
  * Open your Extension's options page, if possible.
15396
15453
  *
@@ -15421,6 +15478,17 @@ declare namespace chrome {
15421
15478
  path: string,
15422
15479
  ): string;
15423
15480
 
15481
+ /**
15482
+ * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
15483
+ *
15484
+ * @chrome-returns-extra since Pending
15485
+ * @param url URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
15486
+ */
15487
+ export function setUninstallURL(
15488
+
15489
+ url: string,
15490
+ ): Promise<void>;
15491
+
15424
15492
  /**
15425
15493
  * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
15426
15494
  *
@@ -15472,6 +15540,18 @@ declare namespace chrome {
15472
15540
  */
15473
15541
  export function restart(): void;
15474
15542
 
15543
+ /**
15544
+ * Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
15545
+ *
15546
+ * @chrome-returns-extra since Pending
15547
+ * @param seconds Time to wait in seconds before rebooting the device, or -1 to cancel a scheduled reboot.
15548
+ * @since Chrome 53
15549
+ */
15550
+ export function restartAfterDelay(
15551
+
15552
+ seconds: number,
15553
+ ): Promise<void>;
15554
+
15475
15555
  /**
15476
15556
  * Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
15477
15557
  *
@@ -15655,6 +15735,13 @@ declare namespace chrome {
15655
15735
  ) => void,
15656
15736
  ): void;
15657
15737
 
15738
+ /**
15739
+ * Returns information about the current platform.
15740
+ *
15741
+ * @chrome-returns-extra since Pending
15742
+ */
15743
+ export function getPlatformInfo(): Promise<PlatformInfo>;
15744
+
15658
15745
  /**
15659
15746
  * Returns information about the current platform.
15660
15747
  *
@@ -15662,7 +15749,7 @@ declare namespace chrome {
15662
15749
  */
15663
15750
  export function getPlatformInfo(
15664
15751
 
15665
- callback: (
15752
+ callback?: (
15666
15753
  platformInfo: PlatformInfo,
15667
15754
  ) => void,
15668
15755
  ): void;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "name": "chrome-types",
7
7
  "config": {
8
- "build-hash": "41b904c21a85313d"
8
+ "build-hash": "d7a76cef828e4762"
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.76"
19
+ "version": "0.1.80"
20
20
  }