-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# @types/chrome extensions | ||
|
||
This needs to be polished, and submitted to [@types/chrome](https://www.npmjs.com/package/@types/chrome) at some point. | ||
|
||
See also: [DefinitelyTyped#65809](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/65809) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//////////////////// | ||
// InstanceID | ||
// THIS IS NEW, BASED ON https://developer.chrome.com/docs/extensions/reference/instanceID | ||
//////////////////// | ||
/** | ||
* The chrome.instanceID namespace exists to access the instance ID service, in chrome. | ||
* Availability: Since Chrome 44. | ||
*/ | ||
declare namespace chrome.instanceID { | ||
export interface TokenRefreshEvent | ||
extends chrome.events.Event<(token: string) => void> {} | ||
|
||
/** | ||
* Return a token that allows the authorized entity to access the service defined by scope. | ||
* @param getTokenParams Parameters for getToken. | ||
* @param callback The callback parameter looks like: | ||
* function(token: string) {...}; | ||
* Parameter token: A token assigned by the requested service. | ||
*/ | ||
export function getToken( | ||
getTokenParams: { | ||
authorizedEntity: string; | ||
scope: string; | ||
}, | ||
callback: (token: string) => void | ||
): void; | ||
|
||
/** | ||
* Fired when all the granted tokens need to be refreshed. | ||
*/ | ||
export var onTokenRefresh: TokenRefreshEvent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "@tix-factory/type-extensions", | ||
"version": "0.0.237", | ||
"description": "Additions that should really be in @types/chrome", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome", | ||
"main": "", | ||
"types": "index.d.ts", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@types/chrome": "0.0.237" | ||
}, | ||
"typeScriptVersion": "4.3" | ||
} |