@types/chrome 0.0.256 → 0.0.258
Sign up to get free protection for your applications and to get access to all the features.
- chrome/README.md +1 -1
- chrome/index.d.ts +153 -0
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (http://developer.chrome.com/e
|
|
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: Wed, 17 Jan 2024 07:06:54 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
@@ -5394,6 +5394,86 @@ declare namespace chrome.input.ime {
|
|
5394
5394
|
export var onReset: InputResetEvent;
|
5395
5395
|
}
|
5396
5396
|
|
5397
|
+
/**
|
5398
|
+
* Use chrome.instanceID to access the Instance ID service.
|
5399
|
+
* Permissions: "gcm"
|
5400
|
+
* @since Chrome 44.
|
5401
|
+
*/
|
5402
|
+
declare namespace chrome.instanceID {
|
5403
|
+
export interface TokenRefreshEvent extends chrome.events.Event<() => void> {}
|
5404
|
+
|
5405
|
+
/**
|
5406
|
+
* Resets the app instance identifier and revokes all tokens associated with it.
|
5407
|
+
*
|
5408
|
+
* The `deleteID()` method doesn't return any value, but can be used with a callback or asynchronously,
|
5409
|
+
* with a Promise (MV3 only).
|
5410
|
+
*/
|
5411
|
+
export function deleteID(): Promise<void>;
|
5412
|
+
export function deleteID(callback: () => void): void;
|
5413
|
+
|
5414
|
+
interface DeleteTokenParams {
|
5415
|
+
/**
|
5416
|
+
* Identifies the entity that is authorized to access resources associated with this Instance ID.
|
5417
|
+
* It can be a project ID from Google developer console.
|
5418
|
+
*/
|
5419
|
+
authorizedEntity: string;
|
5420
|
+
/**
|
5421
|
+
* Identifies authorized actions that the authorized entity can take.
|
5422
|
+
* In other words, the scope that is used to obtain the token.
|
5423
|
+
* E.g. for sending GCM messages, `GCM` scope should be used.
|
5424
|
+
*/
|
5425
|
+
scope: string;
|
5426
|
+
}
|
5427
|
+
/**
|
5428
|
+
* Revoked a granted token.
|
5429
|
+
*
|
5430
|
+
* The `deleteToken()` method doesn't return any value, but can be used with a callback or
|
5431
|
+
* asynchronously, with a Promise (MV3 only).
|
5432
|
+
*/
|
5433
|
+
export function deleteToken(deleteTokenParams: DeleteTokenParams): Promise<void>;
|
5434
|
+
export function deleteToken(
|
5435
|
+
deleteTokenParams: DeleteTokenParams,
|
5436
|
+
callback: () => void,
|
5437
|
+
): void;
|
5438
|
+
|
5439
|
+
/**
|
5440
|
+
* Retrieves the time when the InstanceID has been generated.
|
5441
|
+
*
|
5442
|
+
* @return The time when the Instance ID has been generated, represented in milliseconds since the epoch.
|
5443
|
+
* It can return via a callback or asynchronously, with a Promise (MV3 only).
|
5444
|
+
*/
|
5445
|
+
export function getCreationTime(): Promise<number>;
|
5446
|
+
export function getCreationTime(callback: (creationTime: number) => void): void;
|
5447
|
+
|
5448
|
+
/**
|
5449
|
+
* Retrieves an identifier for the app instance.
|
5450
|
+
* The same ID will be returned as long as the application identity has not been revoked or expired.
|
5451
|
+
*
|
5452
|
+
* @return An Instance ID assigned to the app instance. Can be returned by a callback or a Promise (MV3 only).
|
5453
|
+
*/
|
5454
|
+
export function getID(): Promise<string>;
|
5455
|
+
export function getID(callback: (instanceID: string) => void): void;
|
5456
|
+
|
5457
|
+
interface GetTokenParams extends DeleteTokenParams {
|
5458
|
+
/**
|
5459
|
+
* Allows including a small number of string key/value pairs that will be associated with the token
|
5460
|
+
* and may be used in processing the request.
|
5461
|
+
*
|
5462
|
+
* @deprecated Since Chrome 89. `options` are deprecated and will be ignored.
|
5463
|
+
*/
|
5464
|
+
options?: { [key: string]: string };
|
5465
|
+
}
|
5466
|
+
/**
|
5467
|
+
* Return a token that allows the authorized entity to access the service defined by scope.
|
5468
|
+
*
|
5469
|
+
* @return A token assigned by the requested service. Can be returned by a callback or a Promise (MV3 only).
|
5470
|
+
*/
|
5471
|
+
export function getToken(getTokenParams: GetTokenParams): Promise<string>;
|
5472
|
+
export function getToken(getTokenParams: GetTokenParams, callback: (token: string) => void): void;
|
5473
|
+
|
5474
|
+
export var onTokenRefresh: TokenRefreshEvent;
|
5475
|
+
}
|
5476
|
+
|
5397
5477
|
////////////////////
|
5398
5478
|
// LoginState
|
5399
5479
|
////////////////////
|
@@ -6957,6 +7037,14 @@ declare namespace chrome.runtime {
|
|
6957
7037
|
export type PlatformArch = "arm" | "arm64" | "x86-32" | "x86-64" | "mips" | "mips64";
|
6958
7038
|
/** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformNaclArch */
|
6959
7039
|
export type PlatformNaclArch = "arm" | "x86-32" | "x86-64" | "mips" | "mips64";
|
7040
|
+
/** https://developer.chrome.com/docs/extensions/reference/api/runtime#type-ContextFilter */
|
7041
|
+
export enum ContextType {
|
7042
|
+
TAB = "TAB",
|
7043
|
+
POPUP = "POPUP",
|
7044
|
+
BACKGROUND = "BACKGROUND",
|
7045
|
+
OFFSCREEN_DOCUMENT = "OFFSCREEN_DOCUMENT",
|
7046
|
+
SIDE_PANEL = "SIDE_PANEL",
|
7047
|
+
}
|
6960
7048
|
/** https://developer.chrome.com/docs/extensions/reference/runtime/#type-OnInstalledReason */
|
6961
7049
|
export enum OnInstalledReason {
|
6962
7050
|
INSTALL = "install",
|
@@ -6970,6 +7058,22 @@ declare namespace chrome.runtime {
|
|
6970
7058
|
message?: string | undefined;
|
6971
7059
|
}
|
6972
7060
|
|
7061
|
+
/**
|
7062
|
+
* A filter to match against certain extension contexts. Matching contexts must match all specified filters; any filter that is not specified matches all available contexts. Thus, a filter of `{}` will match all available contexts.
|
7063
|
+
* @since Chrome 114.
|
7064
|
+
*/
|
7065
|
+
export interface ContextFilter {
|
7066
|
+
contextIds?: string[] | undefined;
|
7067
|
+
contextTypes?: ContextType[] | undefined;
|
7068
|
+
documentIds?: string[] | undefined;
|
7069
|
+
documentOrigins?: string[] | undefined;
|
7070
|
+
documentUrls?: string[] | undefined;
|
7071
|
+
frameIds?: number[] | undefined;
|
7072
|
+
incognito?: boolean | undefined;
|
7073
|
+
tabIds?: number[] | undefined;
|
7074
|
+
windowIds?: number[] | undefined;
|
7075
|
+
}
|
7076
|
+
|
6973
7077
|
export interface ConnectInfo {
|
6974
7078
|
name?: string | undefined;
|
6975
7079
|
includeTlsChannelId?: boolean | undefined;
|
@@ -6993,6 +7097,40 @@ declare namespace chrome.runtime {
|
|
6993
7097
|
id?: string | undefined;
|
6994
7098
|
}
|
6995
7099
|
|
7100
|
+
/**
|
7101
|
+
* A context hosting extension content.
|
7102
|
+
* @since Chrome 114.
|
7103
|
+
*/
|
7104
|
+
export interface ExtensionContext {
|
7105
|
+
/** A unique identifier for this context */
|
7106
|
+
contextId: string;
|
7107
|
+
/** The type of context this corresponds to. */
|
7108
|
+
contextType: ContextType;
|
7109
|
+
/**
|
7110
|
+
* Optional.
|
7111
|
+
* A UUID for the document associated with this context, or undefined if this context is hosted not in a document.
|
7112
|
+
*/
|
7113
|
+
documentId?: string | undefined;
|
7114
|
+
/**
|
7115
|
+
* Optional.
|
7116
|
+
* The origin of the document associated with this context, or undefined if the context is not hosted in a document.
|
7117
|
+
*/
|
7118
|
+
documentOrigin?: string | undefined;
|
7119
|
+
/**
|
7120
|
+
* Optional.
|
7121
|
+
* The URL of the document associated with this context, or undefined if the context is not hosted in a document.
|
7122
|
+
*/
|
7123
|
+
documentUrl?: string | undefined;
|
7124
|
+
/** The ID of the frame for this context, or -1 if this context is not hosted in a frame. */
|
7125
|
+
frameId: number;
|
7126
|
+
/** Whether the context is associated with an incognito profile. */
|
7127
|
+
incognito: boolean;
|
7128
|
+
/** The ID of the tab for this context, or -1 if this context is not hosted in a tab. */
|
7129
|
+
tabId: number;
|
7130
|
+
/** The ID of the window for this context, or -1 if this context is not hosted in a window. */
|
7131
|
+
windowId: number;
|
7132
|
+
}
|
7133
|
+
|
6996
7134
|
export interface MessageOptions {
|
6997
7135
|
/** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */
|
6998
7136
|
includeTlsChannelId?: boolean | undefined;
|
@@ -7492,6 +7630,21 @@ declare namespace chrome.runtime {
|
|
7492
7630
|
export function connectNative(application: string): Port;
|
7493
7631
|
/** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */
|
7494
7632
|
export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void;
|
7633
|
+
/**
|
7634
|
+
* Fetches information about active contexts associated with this extension
|
7635
|
+
* @since Chrome 116 MV3.
|
7636
|
+
* @return Provides the matching context, if any via callback or returned as a `Promise` (MV3 only).
|
7637
|
+
* @param filter A filter to find matching contexts. A context matches if it matches all specified fields in the filter. Any unspecified field in the filter matches all contexts.
|
7638
|
+
*/
|
7639
|
+
export function getContexts(filter: ContextFilter): Promise<ExtensionContext[]>;
|
7640
|
+
/**
|
7641
|
+
* Fetches information about active contexts associated with this extension
|
7642
|
+
* @since Chrome 116 MV3.
|
7643
|
+
* @return Provides the matching context, if any via callback or returned as a `Promise` (MV3 only).
|
7644
|
+
* @param filter A filter to find matching contexts. A context matches if it matches all specified fields in the filter. Any unspecified field in the filter matches all contexts.
|
7645
|
+
* @param callback Called with results
|
7646
|
+
*/
|
7647
|
+
export function getContexts(filter: ContextFilter, callback: (contexts: ExtensionContext[]) => void): void;
|
7495
7648
|
/**
|
7496
7649
|
* Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file.
|
7497
7650
|
* @return The manifest details.
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.258",
|
4
4
|
"description": "TypeScript definitions for chrome",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -93,6 +93,6 @@
|
|
93
93
|
"@types/filesystem": "*",
|
94
94
|
"@types/har-format": "*"
|
95
95
|
},
|
96
|
-
"typesPublisherContentHash": "
|
96
|
+
"typesPublisherContentHash": "581693ead7a4b515a196100a0b909475c8e789d7eccb65e95f3bc6e2faedafc1",
|
97
97
|
"typeScriptVersion": "4.6"
|
98
98
|
}
|