@types/chrome 0.0.208 → 0.0.210

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +198 -116
  3. 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: Wed, 11 Jan 2023 03:02:50 GMT
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
- export function attach(target: Debuggee, requiredVersion: string): Promise<void>;
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
- (downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void
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
- | ((request: any, sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)
3584
- | ((sender: runtime.MessageSender, sendResponse: (response: any) => void) => void)
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
- (options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void
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
- options: MetadataRequestedEventOptions,
3964
- successCallback: (metadata: EntryMetadata) => void,
3965
- errorCallback: (error: string) => void,
3966
- ) => void
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
- options: DirectoryPathRequestedEventOptions,
3973
- successCallback: (entries: EntryMetadata[], hasMore: boolean) => void,
3974
- errorCallback: (error: string) => void,
3975
- ) => void
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
- options: OpenFileRequestedEventOptions,
3982
- successCallback: Function,
3983
- errorCallback: (error: string) => void,
3984
- ) => void
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
- options: OpenedFileRequestedEventOptions,
3991
- successCallback: Function,
3992
- errorCallback: (error: string) => void,
3993
- ) => void
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
- options: OpenedFileOffsetRequestedEventOptions,
4000
- successCallback: (data: ArrayBuffer, hasMore: boolean) => void,
4001
- errorCallback: (error: string) => void,
4002
- ) => void
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
- options: DirectoryPathRecursiveRequestedEventOptions,
4009
- successCallback: Function,
4010
- errorCallback: (error: string) => void,
4011
- ) => void
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
- options: EntryPathRecursiveRequestedEventOptions,
4018
- successCallback: Function,
4019
- errorCallback: (error: string) => void,
4020
- ) => void
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
- options: FilePathRequestedEventOptions,
4027
- successCallback: Function,
4028
- errorCallback: (error: string) => void,
4029
- ) => void
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
- options: SourceTargetPathRequestedEventOptions,
4036
- successCallback: Function,
4037
- errorCallback: (error: string) => void,
4038
- ) => void
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
- options: FilePathLengthRequestedEventOptions,
4045
- successCallback: Function,
4046
- errorCallback: (error: string) => void,
4047
- ) => void
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
- options: OpenedFileIoRequestedEventOptions,
4054
- successCallback: Function,
4055
- errorCallback: (error: string) => void,
4056
- ) => void
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
- options: OperationRequestedEventOptions,
4063
- successCallback: Function,
4064
- errorCallback: (error: string) => void,
4065
- ) => void
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
- | 'cursive'
4192
- | 'fantasy'
4193
- | 'fixed'
4194
- | 'sansserif'
4195
- | 'serif'
4196
- | 'standard';
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
  }
@@ -4825,6 +4825,9 @@ declare namespace chrome.identity {
4825
4825
  /** @since Chrome 84. */
4826
4826
  export function getProfileUserInfo(details: ProfileDetails, callback: (userInfo: UserInfo) => void): void;
4827
4827
 
4828
+ /** @since Chrome 84. */
4829
+ export function getProfileUserInfo(details: ProfileDetails): Promise<UserInfo>;
4830
+
4828
4831
  /**
4829
4832
  * Removes an OAuth2 access token from the Identity API's token cache.
4830
4833
  * 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.
@@ -5998,6 +6001,85 @@ declare namespace chrome.notifications {
5998
6001
  export function getPermissionLevel(callback: (level: string) => void): void;
5999
6002
  }
6000
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
+
6001
6083
  ////////////////////
6002
6084
  // Omnibox
6003
6085
  ////////////////////
@@ -6421,7 +6503,7 @@ declare namespace chrome.printerProvider {
6421
6503
 
6422
6504
  export interface CapabilityRequestedEvent
6423
6505
  extends chrome.events.Event<
6424
- (printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void
6506
+ (printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void
6425
6507
  > { }
6426
6508
 
6427
6509
  export interface PrintRequestedEvent
@@ -7048,7 +7130,7 @@ declare namespace chrome.runtime {
7048
7130
 
7049
7131
  export interface ExtensionMessageEvent
7050
7132
  extends chrome.events.Event<
7051
- (message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void
7133
+ (message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void
7052
7134
  > { }
7053
7135
 
7054
7136
  export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { }
@@ -7334,12 +7416,12 @@ declare namespace chrome.runtime {
7334
7416
 
7335
7417
  // Optional
7336
7418
  background?:
7337
- | {
7338
- scripts?: string[] | undefined;
7339
- page?: string | undefined;
7340
- persistent?: boolean | undefined;
7341
- }
7342
- | undefined;
7419
+ | {
7420
+ scripts?: string[] | undefined;
7421
+ page?: string | undefined;
7422
+ persistent?: boolean | undefined;
7423
+ }
7424
+ | undefined;
7343
7425
  content_security_policy?: string | undefined;
7344
7426
  optional_permissions?: string[] | undefined;
7345
7427
  permissions?: string[] | undefined;
@@ -7353,11 +7435,11 @@ declare namespace chrome.runtime {
7353
7435
  // Optional
7354
7436
  action?: ManifestAction | undefined;
7355
7437
  background?:
7356
- | {
7357
- service_worker: string;
7358
- type?: 'module'; // If the service worker uses ES modules
7359
- }
7360
- | undefined;
7438
+ | {
7439
+ service_worker: string;
7440
+ type?: 'module'; // If the service worker uses ES modules
7441
+ }
7442
+ | undefined;
7361
7443
  content_security_policy?: {
7362
7444
  extension_pages?: string;
7363
7445
  sandbox?: string;
@@ -7654,7 +7736,7 @@ declare namespace chrome.scripting {
7654
7736
  } | ({
7655
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. */
7656
7738
  func: () => Result;
7657
- } | {
7739
+ } | {
7658
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. */
7659
7741
  func: (...args: Args) => Result;
7660
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. */
@@ -8049,7 +8131,7 @@ declare namespace chrome.storage {
8049
8131
  }
8050
8132
 
8051
8133
  export interface StorageAreaChangedEvent
8052
- extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void> { }
8134
+ extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void> { }
8053
8135
 
8054
8136
  type AreaName = keyof Pick<typeof chrome.storage, 'sync' | 'local' | 'managed' | 'session'>;
8055
8137
  export interface StorageChangedEvent
@@ -10128,7 +10210,7 @@ declare namespace chrome.tabs {
10128
10210
  * Permissions: "tabGroups"
10129
10211
  * @since Chrome 89. Manifest V3 and above.
10130
10212
  */
10131
- declare namespace chrome.tabGroups {
10213
+ declare namespace chrome.tabGroups {
10132
10214
 
10133
10215
  /** An ID that represents the absence of a group. */
10134
10216
  export var TAB_GROUP_ID_NONE: -1;
@@ -10432,7 +10514,7 @@ declare namespace chrome.ttsEngine {
10432
10514
 
10433
10515
  export interface TtsEngineSpeakEvent
10434
10516
  extends chrome.events.Event<
10435
- (utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void
10517
+ (utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void
10436
10518
  > { }
10437
10519
 
10438
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. */
@@ -11112,7 +11194,7 @@ declare namespace chrome.webRequest {
11112
11194
 
11113
11195
  export interface WebAuthenticationChallengeEvent
11114
11196
  extends chrome.events.EventWithRequiredFilterInAddListener<
11115
- (details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void
11197
+ (details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void
11116
11198
  > {
11117
11199
  addListener(
11118
11200
  callback: (
@@ -11409,18 +11491,18 @@ declare namespace chrome.windows {
11409
11491
 
11410
11492
  export interface WindowIdEvent
11411
11493
  extends chrome.events.Event<(windowId: number) => void> {
11412
- addListener(
11413
- callback: (windowId: number) => void,
11414
- filters?: WindowEventFilter,
11415
- ): void;
11494
+ addListener(
11495
+ callback: (windowId: number) => void,
11496
+ filters?: WindowEventFilter,
11497
+ ): void;
11416
11498
  }
11417
11499
 
11418
11500
  export interface WindowReferenceEvent
11419
11501
  extends chrome.events.Event<(window: Window) => void> {
11420
- addListener(
11421
- callback: (window: Window) => void,
11422
- filters?: WindowEventFilter,
11423
- ): void;
11502
+ addListener(
11503
+ callback: (window: Window) => void,
11504
+ filters?: WindowEventFilter,
11505
+ ): void;
11424
11506
  }
11425
11507
 
11426
11508
  /**
@@ -11932,25 +12014,25 @@ declare namespace chrome.declarativeNetRequest {
11932
12014
  */
11933
12015
  urlFilter?: string | undefined;
11934
12016
  } & (
11935
- | {
11936
- /**
11937
- * List of resource types which the rule won't match.
11938
- * Only one of {@link chrome.declarativeNetRequest.RuleCondition.resourceTypes}
11939
- * and {@link chrome.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
11940
- * If neither of them is specified, all resource types except "main_frame" are blocked.
11941
- */
11942
- excludedResourceTypes?: ResourceType[] | undefined;
11943
- }
11944
- | {
11945
- /**
11946
- * List of resource types which the rule can match.
11947
- * An empty list is not allowed.
11948
- *
11949
- * Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
11950
- */
11951
- resourceTypes?: ResourceType[] | undefined;
11952
- }
11953
- );
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
+ );
11954
12036
 
11955
12037
  export interface MatchedRule {
11956
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.208",
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": "1dd33572b22a19b6f4a1a3e7bb5f09494130df8bf90a663a340676443c212b3b",
91
+ "typesPublisherContentHash": "1b96144927e9fdbe3bbaea4b866d276a1c4a71b590a0c7df9b7662de34a0a16e",
92
92
  "typeScriptVersion": "4.2"
93
93
  }