@types/chrome 0.0.213 → 0.0.215
Sign up to get free protection for your applications and to get access to all the features.
- chrome/README.md +2 -2
- chrome/index.d.ts +30 -2
- chrome/package.json +7 -2
chrome/README.md
CHANGED
@@ -8,9 +8,9 @@ This package contains type definitions for Chrome extension development (http://
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Sat, 18 Feb 2023 02:32:32 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
* Global values: `chrome`
|
14
14
|
|
15
15
|
# Credits
|
16
|
-
These definitions were written by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10), [sreimer15](https://github.com/sreimer15), [MatCarlson](https://github.com/MatCarlson), [ekinsol](https://github.com/ekinsol), [Brian Wilson](https://github.com/echoabstract), [Sebastiaan Pasma](https://github.com/spasma), [bdbai](https://github.com/bdbai), [pokutuna](https://github.com/pokutuna), [Jason Xian](https://github.com/JasonXian), [userTim](https://github.com/usertim), [Idan Zeierman](https://github.com/idan315), [Nicolas Rodriguez](https://github.com/nicolas377),
|
16
|
+
These definitions were written by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10), [sreimer15](https://github.com/sreimer15), [MatCarlson](https://github.com/MatCarlson), [ekinsol](https://github.com/ekinsol), [Brian Wilson](https://github.com/echoabstract), [Sebastiaan Pasma](https://github.com/spasma), [bdbai](https://github.com/bdbai), [pokutuna](https://github.com/pokutuna), [Jason Xian](https://github.com/JasonXian), [userTim](https://github.com/usertim), [Idan Zeierman](https://github.com/idan315), [Nicolas Rodriguez](https://github.com/nicolas377), [Ido Salomon](https://github.com/idosal), and [Federico Brigante](https://github.com/fregante).
|
chrome/index.d.ts
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
// Idan Zeierman <https://github.com/idan315>
|
15
15
|
// Nicolas Rodriguez <https://github.com/nicolas377>
|
16
16
|
// Ido Salomon <https://github.com/idosal>
|
17
|
+
// Federico Brigante <https://github.com/fregante>
|
17
18
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
18
19
|
// TypeScript Version: 2.4
|
19
20
|
|
@@ -4784,17 +4785,32 @@ declare namespace chrome.identity {
|
|
4784
4785
|
|
4785
4786
|
export interface SignInChangeEvent extends chrome.events.Event<(account: AccountInfo, signedIn: boolean) => void> { }
|
4786
4787
|
|
4788
|
+
export interface GetAuthTokenResult {
|
4789
|
+
/**
|
4790
|
+
* Optional.
|
4791
|
+
* A list of OAuth2 scopes granted to the extension.
|
4792
|
+
*/
|
4793
|
+
grantedScopes?: string[]
|
4794
|
+
/**
|
4795
|
+
* Optional.
|
4796
|
+
* The specific token associated with the request.
|
4797
|
+
*/
|
4798
|
+
token?: string
|
4799
|
+
}
|
4800
|
+
|
4787
4801
|
/**
|
4788
4802
|
* Resets the state of the Identity API:
|
4789
4803
|
*
|
4790
4804
|
* * Removes all OAuth2 access tokens from the token cache
|
4791
4805
|
* * Removes user's account preferences
|
4792
4806
|
* * De-authorizes the user from all auth flows
|
4807
|
+
* If `callback` is not provided, the function returns a Promise when the state has been cleared.
|
4793
4808
|
* @since Chrome 87.
|
4794
4809
|
* @param callback Called when the state has been cleared.
|
4795
4810
|
* The parameter should be a function that looks like this:
|
4796
4811
|
* () => {...};
|
4797
4812
|
*/
|
4813
|
+
export function clearAllCachedAuthTokens(): Promise<void>;
|
4798
4814
|
export function clearAllCachedAuthTokens(callback: () => void): void;
|
4799
4815
|
|
4800
4816
|
/**
|
@@ -4802,18 +4818,21 @@ declare namespace chrome.identity {
|
|
4802
4818
|
* getAccounts is only supported on dev channel.
|
4803
4819
|
* Dev channel only.
|
4804
4820
|
*/
|
4821
|
+
export function getAccounts(): Promise<AccountInfo[]>;
|
4805
4822
|
export function getAccounts(callback: (accounts: AccountInfo[]) => void): void;
|
4806
4823
|
|
4807
4824
|
/**
|
4808
4825
|
* Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json.
|
4809
4826
|
* The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration.
|
4810
4827
|
* For a good user experience it is important interactive token requests 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, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched.
|
4828
|
+
* If `callback` is not provided, the function returns a Promise that resolves with the token.
|
4811
4829
|
* @param details Token options.
|
4812
4830
|
* @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error.
|
4813
4831
|
* If you specify the callback parameter, it should be a function that looks like this:
|
4814
4832
|
* function(string token) {...};
|
4815
4833
|
*/
|
4816
|
-
export function getAuthToken(details: TokenDetails
|
4834
|
+
export function getAuthToken(details: TokenDetails): Promise<GetAuthTokenResult>;
|
4835
|
+
export function getAuthToken(details: TokenDetails, callback: (token?: string, grantedScopes?: string[]) => void): void;
|
4817
4836
|
|
4818
4837
|
/**
|
4819
4838
|
* Retrieves email address and obfuscated gaia id of the user signed into a profile.
|
@@ -4831,12 +4850,14 @@ declare namespace chrome.identity {
|
|
4831
4850
|
/**
|
4832
4851
|
* Removes an OAuth2 access token from the Identity API's token cache.
|
4833
4852
|
* 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.
|
4853
|
+
* If `callback` is not provided, the function returns a Promise when the state has been removed from the cache.
|
4834
4854
|
* @param details Token information.
|
4835
4855
|
* @param callback Called when the token has been removed from the cache.
|
4836
4856
|
* If you specify the callback parameter, it should be a function that looks like this:
|
4837
4857
|
* function() {...};
|
4838
4858
|
*/
|
4839
|
-
export function removeCachedAuthToken(details: TokenInformation
|
4859
|
+
export function removeCachedAuthToken(details: TokenInformation): Promise<void>;
|
4860
|
+
export function removeCachedAuthToken(details: TokenInformation, callback: () => void): void;
|
4840
4861
|
|
4841
4862
|
/**
|
4842
4863
|
* Starts an auth flow at the specified URL.
|
@@ -6707,6 +6728,13 @@ declare namespace chrome.search {
|
|
6707
6728
|
* function() => {...}
|
6708
6729
|
*/
|
6709
6730
|
export function query(options: QueryInfo, callback: () => void): void;
|
6731
|
+
|
6732
|
+
/**
|
6733
|
+
* Used to query the default search provider. In case of an error, runtime.lastError will be set.
|
6734
|
+
* @param options search configuration options.
|
6735
|
+
* @return The `query` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
6736
|
+
*/
|
6737
|
+
export function query(options: QueryInfo): Promise<void>;
|
6710
6738
|
}
|
6711
6739
|
|
6712
6740
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.215",
|
4
4
|
"description": "TypeScript definitions for Chrome extension development",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -74,6 +74,11 @@
|
|
74
74
|
"name": "Ido Salomon",
|
75
75
|
"url": "https://github.com/idosal",
|
76
76
|
"githubUsername": "idosal"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"name": "Federico Brigante",
|
80
|
+
"url": "https://github.com/fregante",
|
81
|
+
"githubUsername": "fregante"
|
77
82
|
}
|
78
83
|
],
|
79
84
|
"main": "",
|
@@ -88,6 +93,6 @@
|
|
88
93
|
"@types/filesystem": "*",
|
89
94
|
"@types/har-format": "*"
|
90
95
|
},
|
91
|
-
"typesPublisherContentHash": "
|
96
|
+
"typesPublisherContentHash": "032cae83d3b198051639b62967f4c3447fc569b785fa8927d30f5f3813685604",
|
92
97
|
"typeScriptVersion": "4.2"
|
93
98
|
}
|