@types/chrome 0.0.209 → 0.0.210
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 +195 -116
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ 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: Mon, 23 Jan 2023 22:02:42 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
|
|
chrome/index.d.ts
CHANGED
@@ -2119,7 +2119,7 @@ declare module chrome {
|
|
2119
2119
|
* @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages.
|
2120
2120
|
* @return The `attach` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
2121
2121
|
*/
|
2122
|
-
|
2122
|
+
export function attach(target: Debuggee, requiredVersion: string): Promise<void>;
|
2123
2123
|
/**
|
2124
2124
|
* Attaches debugger to the given target.
|
2125
2125
|
* @param target Debugging target to which you want to attach.
|
@@ -3046,7 +3046,7 @@ declare namespace chrome.downloads {
|
|
3046
3046
|
|
3047
3047
|
export interface DownloadDeterminingFilenameEvent
|
3048
3048
|
extends chrome.events.Event<
|
3049
|
-
|
3049
|
+
(downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void
|
3050
3050
|
> { }
|
3051
3051
|
|
3052
3052
|
/**
|
@@ -3580,8 +3580,8 @@ declare namespace chrome.extension {
|
|
3580
3580
|
|
3581
3581
|
export interface OnRequestEvent
|
3582
3582
|
extends chrome.events.Event<
|
3583
|
-
|
3584
|
-
|
3583
|
+
| ((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)
|
3584
|
+
| ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)
|
3585
3585
|
> { }
|
3586
3586
|
|
3587
3587
|
/**
|
@@ -3954,115 +3954,115 @@ declare namespace chrome.fileSystemProvider {
|
|
3954
3954
|
|
3955
3955
|
export interface RequestedEvent
|
3956
3956
|
extends chrome.events.Event<
|
3957
|
-
|
3957
|
+
(options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void
|
3958
3958
|
> { }
|
3959
3959
|
|
3960
3960
|
export interface MetadataRequestedEvent
|
3961
3961
|
extends chrome.events.Event<
|
3962
|
-
|
3963
|
-
|
3964
|
-
|
3965
|
-
|
3966
|
-
|
3962
|
+
(
|
3963
|
+
options: MetadataRequestedEventOptions,
|
3964
|
+
successCallback: (metadata: EntryMetadata) => void,
|
3965
|
+
errorCallback: (error: string) => void,
|
3966
|
+
) => void
|
3967
3967
|
> { }
|
3968
3968
|
|
3969
3969
|
export interface DirectoryPathRequestedEvent
|
3970
3970
|
extends chrome.events.Event<
|
3971
|
-
|
3972
|
-
|
3973
|
-
|
3974
|
-
|
3975
|
-
|
3971
|
+
(
|
3972
|
+
options: DirectoryPathRequestedEventOptions,
|
3973
|
+
successCallback: (entries: EntryMetadata[], hasMore: boolean) => void,
|
3974
|
+
errorCallback: (error: string) => void,
|
3975
|
+
) => void
|
3976
3976
|
> { }
|
3977
3977
|
|
3978
3978
|
export interface OpenFileRequestedEvent
|
3979
3979
|
extends chrome.events.Event<
|
3980
|
-
|
3981
|
-
|
3982
|
-
|
3983
|
-
|
3984
|
-
|
3980
|
+
(
|
3981
|
+
options: OpenFileRequestedEventOptions,
|
3982
|
+
successCallback: Function,
|
3983
|
+
errorCallback: (error: string) => void,
|
3984
|
+
) => void
|
3985
3985
|
> { }
|
3986
3986
|
|
3987
3987
|
export interface OpenedFileRequestedEvent
|
3988
3988
|
extends chrome.events.Event<
|
3989
|
-
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
|
3989
|
+
(
|
3990
|
+
options: OpenedFileRequestedEventOptions,
|
3991
|
+
successCallback: Function,
|
3992
|
+
errorCallback: (error: string) => void,
|
3993
|
+
) => void
|
3994
3994
|
> { }
|
3995
3995
|
|
3996
3996
|
export interface OpenedFileOffsetRequestedEvent
|
3997
3997
|
extends chrome.events.Event<
|
3998
|
-
|
3999
|
-
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
3998
|
+
(
|
3999
|
+
options: OpenedFileOffsetRequestedEventOptions,
|
4000
|
+
successCallback: (data: ArrayBuffer, hasMore: boolean) => void,
|
4001
|
+
errorCallback: (error: string) => void,
|
4002
|
+
) => void
|
4003
4003
|
> { }
|
4004
4004
|
|
4005
4005
|
export interface DirectoryPathRecursiveRequestedEvent
|
4006
4006
|
extends chrome.events.Event<
|
4007
|
-
|
4008
|
-
|
4009
|
-
|
4010
|
-
|
4011
|
-
|
4007
|
+
(
|
4008
|
+
options: DirectoryPathRecursiveRequestedEventOptions,
|
4009
|
+
successCallback: Function,
|
4010
|
+
errorCallback: (error: string) => void,
|
4011
|
+
) => void
|
4012
4012
|
> { }
|
4013
4013
|
|
4014
4014
|
export interface EntryPathRecursiveRequestedEvent
|
4015
4015
|
extends chrome.events.Event<
|
4016
|
-
|
4017
|
-
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4016
|
+
(
|
4017
|
+
options: EntryPathRecursiveRequestedEventOptions,
|
4018
|
+
successCallback: Function,
|
4019
|
+
errorCallback: (error: string) => void,
|
4020
|
+
) => void
|
4021
4021
|
> { }
|
4022
4022
|
|
4023
4023
|
export interface FilePathRequestedEvent
|
4024
4024
|
extends chrome.events.Event<
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4029
|
-
|
4025
|
+
(
|
4026
|
+
options: FilePathRequestedEventOptions,
|
4027
|
+
successCallback: Function,
|
4028
|
+
errorCallback: (error: string) => void,
|
4029
|
+
) => void
|
4030
4030
|
> { }
|
4031
4031
|
|
4032
4032
|
export interface SourceTargetPathRequestedEvent
|
4033
4033
|
extends chrome.events.Event<
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4037
|
-
|
4038
|
-
|
4034
|
+
(
|
4035
|
+
options: SourceTargetPathRequestedEventOptions,
|
4036
|
+
successCallback: Function,
|
4037
|
+
errorCallback: (error: string) => void,
|
4038
|
+
) => void
|
4039
4039
|
> { }
|
4040
4040
|
|
4041
4041
|
export interface FilePathLengthRequestedEvent
|
4042
4042
|
extends chrome.events.Event<
|
4043
|
-
|
4044
|
-
|
4045
|
-
|
4046
|
-
|
4047
|
-
|
4043
|
+
(
|
4044
|
+
options: FilePathLengthRequestedEventOptions,
|
4045
|
+
successCallback: Function,
|
4046
|
+
errorCallback: (error: string) => void,
|
4047
|
+
) => void
|
4048
4048
|
> { }
|
4049
4049
|
|
4050
4050
|
export interface OpenedFileIoRequestedEvent
|
4051
4051
|
extends chrome.events.Event<
|
4052
|
-
|
4053
|
-
|
4054
|
-
|
4055
|
-
|
4056
|
-
|
4052
|
+
(
|
4053
|
+
options: OpenedFileIoRequestedEventOptions,
|
4054
|
+
successCallback: Function,
|
4055
|
+
errorCallback: (error: string) => void,
|
4056
|
+
) => void
|
4057
4057
|
> { }
|
4058
4058
|
|
4059
4059
|
export interface OperationRequestedEvent
|
4060
4060
|
extends chrome.events.Event<
|
4061
|
-
|
4062
|
-
|
4063
|
-
|
4064
|
-
|
4065
|
-
|
4061
|
+
(
|
4062
|
+
options: OperationRequestedEventOptions,
|
4063
|
+
successCallback: Function,
|
4064
|
+
errorCallback: (error: string) => void,
|
4065
|
+
) => void
|
4066
4066
|
> { }
|
4067
4067
|
|
4068
4068
|
export interface OptionlessRequestedEvent
|
@@ -4188,12 +4188,12 @@ declare namespace chrome.fontSettings {
|
|
4188
4188
|
export interface FontDetails {
|
4189
4189
|
/** The generic font family for the font. */
|
4190
4190
|
genericFamily:
|
4191
|
-
|
4192
|
-
|
4193
|
-
|
4194
|
-
|
4195
|
-
|
4196
|
-
|
4191
|
+
| 'cursive'
|
4192
|
+
| 'fantasy'
|
4193
|
+
| 'fixed'
|
4194
|
+
| 'sansserif'
|
4195
|
+
| 'serif'
|
4196
|
+
| 'standard';
|
4197
4197
|
/** Optional. The script for the font. If omitted, the global script font setting is affected. */
|
4198
4198
|
script?: string | undefined;
|
4199
4199
|
}
|
@@ -6001,6 +6001,85 @@ declare namespace chrome.notifications {
|
|
6001
6001
|
export function getPermissionLevel(callback: (level: string) => void): void;
|
6002
6002
|
}
|
6003
6003
|
|
6004
|
+
////////////////////
|
6005
|
+
// Offscreen
|
6006
|
+
////////////////////
|
6007
|
+
/**
|
6008
|
+
* Use the offscreen API to create and manage offscreen documents.
|
6009
|
+
* Availability: @since Chrome 109. Manifest v3.
|
6010
|
+
* Permissions: "offscreen"
|
6011
|
+
*/
|
6012
|
+
declare namespace chrome.offscreen {
|
6013
|
+
/** The reason(s) the extension is creating the offscreen document. */
|
6014
|
+
export enum Reason {
|
6015
|
+
/** A reason used for testing purposes only. */
|
6016
|
+
TESTING,
|
6017
|
+
/** The offscreen document is responsible for playing audio. */
|
6018
|
+
AUDIO_PLAYBACK,
|
6019
|
+
/** The offscreen document needs to embed and script an iframe in order to modify the iframe's content. */
|
6020
|
+
IFRAME_SCRIPTING,
|
6021
|
+
/** The offscreen document needs to embed an iframe and scrape its DOM to extract information. */
|
6022
|
+
DOM_SCRAPING,
|
6023
|
+
/** The offscreen document needs to interact with Blob objects (including URL.createObjectURL()). */
|
6024
|
+
BLOBS,
|
6025
|
+
/** The offscreen document needs to use the DOMParser API. */
|
6026
|
+
DOM_PARSER,
|
6027
|
+
/** The offscreen document needs to interact with media streams from user media (e.g. getUserMedia()). */
|
6028
|
+
USER_MEDIA,
|
6029
|
+
/** The offscreen document needs to interact with media streams from display media (e.g. getDisplayMedia()). */
|
6030
|
+
DISPLAY_MEDIA,
|
6031
|
+
/** The offscreen document needs to use WebRTC APIs. */
|
6032
|
+
WEB_RTC,
|
6033
|
+
/** The offscreen document needs to interact with the clipboard APIs(e.g. Navigator.clipboard). */
|
6034
|
+
CLIPBOARD
|
6035
|
+
}
|
6036
|
+
|
6037
|
+
/** The parameters describing the offscreen document to create. */
|
6038
|
+
export interface CreateParameters {
|
6039
|
+
/** The reason(s) the extension is creating the offscreen document. */
|
6040
|
+
reasons: Reason[];
|
6041
|
+
/** The (relative) URL to load in the document. */
|
6042
|
+
url: string;
|
6043
|
+
/** A developer-provided string that explains, in more detail, the need for the background context. The user agent _may_ use this in display to the user. */
|
6044
|
+
justification: string;
|
6045
|
+
}
|
6046
|
+
|
6047
|
+
/**
|
6048
|
+
* Creates a new offscreen document for the extension.
|
6049
|
+
* @param parameters The parameters describing the offscreen document to create.
|
6050
|
+
* @return The `createDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
|
6051
|
+
*/
|
6052
|
+
export function createDocument(parameters: CreateParameters): Promise<void>;
|
6053
|
+
/**
|
6054
|
+
* Creates a new offscreen document for the extension.
|
6055
|
+
* @param parameters The parameters describing the offscreen document to create.
|
6056
|
+
* @param callback Invoked when the offscreen document is created and has completed its initial page load.
|
6057
|
+
*/
|
6058
|
+
export function createDocument(parameters: CreateParameters, callback: () => void): void;
|
6059
|
+
|
6060
|
+
/**
|
6061
|
+
* Closes the currently-open offscreen document for the extension.
|
6062
|
+
* @return The `closeDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
|
6063
|
+
*/
|
6064
|
+
export function closeDocument(): Promise<void>;
|
6065
|
+
/**
|
6066
|
+
* Closes the currently-open offscreen document for the extension.
|
6067
|
+
* @param callback Invoked when the offscreen document has been closed.
|
6068
|
+
*/
|
6069
|
+
export function closeDocument(callback: () => void): void;
|
6070
|
+
|
6071
|
+
/**
|
6072
|
+
* Determines whether the extension has an active document.
|
6073
|
+
* @return The `hasDocument` method provides its result via callback or returned as a `Promise` (MV3 only).
|
6074
|
+
*/
|
6075
|
+
export function hasDocument(): Promise<boolean>;
|
6076
|
+
/**
|
6077
|
+
* Determines whether the extension has an active document.
|
6078
|
+
* @param callback Invoked with the result of whether the extension has an active offscreen document.
|
6079
|
+
*/
|
6080
|
+
export function hasDocument(callback: (result: boolean) => void): void;
|
6081
|
+
}
|
6082
|
+
|
6004
6083
|
////////////////////
|
6005
6084
|
// Omnibox
|
6006
6085
|
////////////////////
|
@@ -6424,7 +6503,7 @@ declare namespace chrome.printerProvider {
|
|
6424
6503
|
|
6425
6504
|
export interface CapabilityRequestedEvent
|
6426
6505
|
extends chrome.events.Event<
|
6427
|
-
|
6506
|
+
(printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void
|
6428
6507
|
> { }
|
6429
6508
|
|
6430
6509
|
export interface PrintRequestedEvent
|
@@ -7051,7 +7130,7 @@ declare namespace chrome.runtime {
|
|
7051
7130
|
|
7052
7131
|
export interface ExtensionMessageEvent
|
7053
7132
|
extends chrome.events.Event<
|
7054
|
-
|
7133
|
+
(message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void
|
7055
7134
|
> { }
|
7056
7135
|
|
7057
7136
|
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { }
|
@@ -7337,12 +7416,12 @@ declare namespace chrome.runtime {
|
|
7337
7416
|
|
7338
7417
|
// Optional
|
7339
7418
|
background?:
|
7340
|
-
|
7341
|
-
|
7342
|
-
|
7343
|
-
|
7344
|
-
|
7345
|
-
|
7419
|
+
| {
|
7420
|
+
scripts?: string[] | undefined;
|
7421
|
+
page?: string | undefined;
|
7422
|
+
persistent?: boolean | undefined;
|
7423
|
+
}
|
7424
|
+
| undefined;
|
7346
7425
|
content_security_policy?: string | undefined;
|
7347
7426
|
optional_permissions?: string[] | undefined;
|
7348
7427
|
permissions?: string[] | undefined;
|
@@ -7356,11 +7435,11 @@ declare namespace chrome.runtime {
|
|
7356
7435
|
// Optional
|
7357
7436
|
action?: ManifestAction | undefined;
|
7358
7437
|
background?:
|
7359
|
-
|
7360
|
-
|
7361
|
-
|
7362
|
-
|
7363
|
-
|
7438
|
+
| {
|
7439
|
+
service_worker: string;
|
7440
|
+
type?: 'module'; // If the service worker uses ES modules
|
7441
|
+
}
|
7442
|
+
| undefined;
|
7364
7443
|
content_security_policy?: {
|
7365
7444
|
extension_pages?: string;
|
7366
7445
|
sandbox?: string;
|
@@ -7657,7 +7736,7 @@ declare namespace chrome.scripting {
|
|
7657
7736
|
} | ({
|
7658
7737
|
/* A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of files and function must be specified. */
|
7659
7738
|
func: () => Result;
|
7660
|
-
}
|
7739
|
+
} | {
|
7661
7740
|
/* A JavaScript function to inject. This function will be serialized, and then deserialized for injection. This means that any bound parameters and execution context will be lost. Exactly one of files and function must be specified. */
|
7662
7741
|
func: (...args: Args) => Result;
|
7663
7742
|
/* The arguments to carry into a provided function. This is only valid if the func parameter is specified. These arguments must be JSON-serializable. */
|
@@ -8052,7 +8131,7 @@ declare namespace chrome.storage {
|
|
8052
8131
|
}
|
8053
8132
|
|
8054
8133
|
export interface StorageAreaChangedEvent
|
8055
|
-
|
8134
|
+
extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void> { }
|
8056
8135
|
|
8057
8136
|
type AreaName = keyof Pick<typeof chrome.storage, 'sync' | 'local' | 'managed' | 'session'>;
|
8058
8137
|
export interface StorageChangedEvent
|
@@ -10131,7 +10210,7 @@ declare namespace chrome.tabs {
|
|
10131
10210
|
* Permissions: "tabGroups"
|
10132
10211
|
* @since Chrome 89. Manifest V3 and above.
|
10133
10212
|
*/
|
10134
|
-
|
10213
|
+
declare namespace chrome.tabGroups {
|
10135
10214
|
|
10136
10215
|
/** An ID that represents the absence of a group. */
|
10137
10216
|
export var TAB_GROUP_ID_NONE: -1;
|
@@ -10435,7 +10514,7 @@ declare namespace chrome.ttsEngine {
|
|
10435
10514
|
|
10436
10515
|
export interface TtsEngineSpeakEvent
|
10437
10516
|
extends chrome.events.Event<
|
10438
|
-
|
10517
|
+
(utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void
|
10439
10518
|
> { }
|
10440
10519
|
|
10441
10520
|
/** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */
|
@@ -11115,7 +11194,7 @@ declare namespace chrome.webRequest {
|
|
11115
11194
|
|
11116
11195
|
export interface WebAuthenticationChallengeEvent
|
11117
11196
|
extends chrome.events.EventWithRequiredFilterInAddListener<
|
11118
|
-
|
11197
|
+
(details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void
|
11119
11198
|
> {
|
11120
11199
|
addListener(
|
11121
11200
|
callback: (
|
@@ -11412,18 +11491,18 @@ declare namespace chrome.windows {
|
|
11412
11491
|
|
11413
11492
|
export interface WindowIdEvent
|
11414
11493
|
extends chrome.events.Event<(windowId: number) => void> {
|
11415
|
-
|
11416
|
-
|
11417
|
-
|
11418
|
-
|
11494
|
+
addListener(
|
11495
|
+
callback: (windowId: number) => void,
|
11496
|
+
filters?: WindowEventFilter,
|
11497
|
+
): void;
|
11419
11498
|
}
|
11420
11499
|
|
11421
11500
|
export interface WindowReferenceEvent
|
11422
11501
|
extends chrome.events.Event<(window: Window) => void> {
|
11423
|
-
|
11424
|
-
|
11425
|
-
|
11426
|
-
|
11502
|
+
addListener(
|
11503
|
+
callback: (window: Window) => void,
|
11504
|
+
filters?: WindowEventFilter,
|
11505
|
+
): void;
|
11427
11506
|
}
|
11428
11507
|
|
11429
11508
|
/**
|
@@ -11935,25 +12014,25 @@ declare namespace chrome.declarativeNetRequest {
|
|
11935
12014
|
*/
|
11936
12015
|
urlFilter?: string | undefined;
|
11937
12016
|
} & (
|
11938
|
-
|
11939
|
-
|
11940
|
-
|
11941
|
-
|
11942
|
-
|
11943
|
-
|
11944
|
-
|
11945
|
-
|
11946
|
-
|
11947
|
-
|
11948
|
-
|
11949
|
-
|
11950
|
-
|
11951
|
-
|
11952
|
-
|
11953
|
-
|
11954
|
-
|
11955
|
-
|
11956
|
-
|
12017
|
+
| {
|
12018
|
+
/**
|
12019
|
+
* List of resource types which the rule won't match.
|
12020
|
+
* Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
|
12021
|
+
* and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
|
12022
|
+
* If neither of them is specified, all resource types except "main_frame" are blocked.
|
12023
|
+
*/
|
12024
|
+
excludedResourceTypes?: ResourceType[] | undefined;
|
12025
|
+
}
|
12026
|
+
| {
|
12027
|
+
/**
|
12028
|
+
* List of resource types which the rule can match.
|
12029
|
+
* An empty list is not allowed.
|
12030
|
+
*
|
12031
|
+
* Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
|
12032
|
+
*/
|
12033
|
+
resourceTypes?: ResourceType[] | undefined;
|
12034
|
+
}
|
12035
|
+
);
|
11957
12036
|
|
11958
12037
|
export interface MatchedRule {
|
11959
12038
|
/** A matching rule's ID. */
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.210",
|
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",
|
@@ -88,6 +88,6 @@
|
|
88
88
|
"@types/filesystem": "*",
|
89
89
|
"@types/har-format": "*"
|
90
90
|
},
|
91
|
-
"typesPublisherContentHash": "
|
91
|
+
"typesPublisherContentHash": "1b96144927e9fdbe3bbaea4b866d276a1c4a71b590a0c7df9b7662de34a0a16e",
|
92
92
|
"typeScriptVersion": "4.2"
|
93
93
|
}
|