@types/chrome 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chrome/README.md +1 -1
- chrome/index.d.ts +103 -52
- chrome/package.json +2 -2
chrome/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
|
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: Fri, 09 Oct 2026 18:42:20 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
|
@@ -1972,37 +1972,48 @@ declare namespace chrome {
|
|
|
1972
1972
|
* Properties of the new context menu item.
|
|
1973
1973
|
* @since Chrome 123
|
|
1974
1974
|
*/
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
1975
|
+
type CreateProperties =
|
|
1976
|
+
& ({
|
|
1977
|
+
/** The initial state of a checkbox or radio button: `true` for selected, `false` for unselected. Only one radio button can be selected at a time in a given group. */
|
|
1978
|
+
checked?: boolean;
|
|
1979
|
+
/** List of contexts this menu item will appear in. Defaults to `['page']`. */
|
|
1980
|
+
contexts?: [`${ContextType}`, ...`${ContextType}`[]];
|
|
1981
|
+
/** Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see Match Patterns. */
|
|
1982
|
+
documentUrlPatterns?: string[];
|
|
1983
|
+
/** Whether this context menu item is enabled or disabled. Defaults to `true`. */
|
|
1984
|
+
enabled?: boolean;
|
|
1985
|
+
/** The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. */
|
|
1986
|
+
id?: string;
|
|
1987
|
+
/** The ID of a parent menu item; this makes the item a child of a previously added item. */
|
|
1988
|
+
parentId?: number | string;
|
|
1989
|
+
/** Similar to `documentUrlPatterns`, filters based on the `src` attribute of `img`, `audio`, and `video` tags and the `href` attribute of `a` tags. */
|
|
1990
|
+
targetUrlPatterns?: string[];
|
|
1991
|
+
/** Whether the item is visible in the menu. */
|
|
1992
|
+
visible?: boolean;
|
|
1993
|
+
/**
|
|
1994
|
+
* A function that is called back when the menu item is clicked. This is not available inside of a service worker; instead, you should register a listener for {@link contextMenus.onClicked}.
|
|
1995
|
+
* @param info Information about the item clicked and the context where the click happened.
|
|
1996
|
+
* @param tab The details of the tab where the click took place. This parameter is not present for platform apps.
|
|
1997
|
+
*/
|
|
1998
|
+
onclick?: (
|
|
1999
|
+
info: OnClickData,
|
|
2000
|
+
tab: tabs.Tab,
|
|
2001
|
+
) => void;
|
|
2002
|
+
})
|
|
2003
|
+
& (
|
|
2004
|
+
| {
|
|
2005
|
+
/** The type of menu item. Defaults to `normal`. */
|
|
2006
|
+
type: `${ItemType.SEPARATOR}`;
|
|
2007
|
+
/** The text to display in the item; this is _required_ unless `type` is `separator`. When the context is `selection`, use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */
|
|
2008
|
+
title?: string;
|
|
2009
|
+
}
|
|
2010
|
+
| {
|
|
2011
|
+
/** The type of menu item. Defaults to `normal`. */
|
|
2012
|
+
type?: `${Exclude<ItemType, ItemType.SEPARATOR>}`;
|
|
2013
|
+
/** The text to display in the item; this is _required_ unless `type` is `separator`. When the context is `selection`, use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */
|
|
2014
|
+
title: string;
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2006
2017
|
|
|
2007
2018
|
/**
|
|
2008
2019
|
* The type of menu item.
|
|
@@ -4060,9 +4071,25 @@ declare namespace chrome {
|
|
|
4060
4071
|
size?: 16 | 32 | undefined;
|
|
4061
4072
|
}
|
|
4062
4073
|
|
|
4074
|
+
type DownloadSortableKey = keyof Pick<
|
|
4075
|
+
DownloadItem,
|
|
4076
|
+
| "url"
|
|
4077
|
+
| "bytesReceived"
|
|
4078
|
+
| "danger"
|
|
4079
|
+
| "finalUrl"
|
|
4080
|
+
| "totalBytes"
|
|
4081
|
+
| "filename"
|
|
4082
|
+
| "paused"
|
|
4083
|
+
| "state"
|
|
4084
|
+
| "mime"
|
|
4085
|
+
| "startTime"
|
|
4086
|
+
| "endTime"
|
|
4087
|
+
| "exists"
|
|
4088
|
+
>;
|
|
4089
|
+
|
|
4063
4090
|
interface DownloadQuery {
|
|
4064
4091
|
/** Set elements of this array to {@link DownloadItem} properties in order to sort search results. For example, setting `orderBy=['startTime']` sorts the {@link DownloadItem} by their start time in ascending order. To specify descending order, prefix with a hyphen: '-startTime'. */
|
|
4065
|
-
orderBy?:
|
|
4092
|
+
orderBy?: Array<DownloadSortableKey | `-${DownloadSortableKey}`> | undefined;
|
|
4066
4093
|
/** Limits results to {@link DownloadItem} whose `url` matches the given regular expression. */
|
|
4067
4094
|
urlRegex?: string | undefined;
|
|
4068
4095
|
/** Limits results to {@link DownloadItem} that ended before the given ms in ISO 8601 format. */
|
|
@@ -4081,12 +4108,12 @@ declare namespace chrome {
|
|
|
4081
4108
|
* The absolute URL that this download is being made from, after all redirects.
|
|
4082
4109
|
* @since Chrome 54
|
|
4083
4110
|
*/
|
|
4084
|
-
finalUrl?: string;
|
|
4111
|
+
finalUrl?: string | undefined;
|
|
4085
4112
|
/**
|
|
4086
4113
|
* Limits results to {@link DownloadItem} whose `finalUrl` matches the given regular expression.
|
|
4087
4114
|
* @since Chrome 54
|
|
4088
4115
|
*/
|
|
4089
|
-
finalUrlRegex?: string;
|
|
4116
|
+
finalUrlRegex?: string | undefined;
|
|
4090
4117
|
/** This array of search terms limits results to {@link DownloadItem} whose `filename` or `url` or `finalUrl` contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash. */
|
|
4091
4118
|
query?: string[] | undefined;
|
|
4092
4119
|
/** Limits results to {@link DownloadItem} whose `totalBytes` is less than the given integer. */
|
|
@@ -4163,7 +4190,7 @@ declare namespace chrome {
|
|
|
4163
4190
|
function getFileIcon(downloadId: number, callback: (iconURL?: string) => void): void;
|
|
4164
4191
|
function getFileIcon(
|
|
4165
4192
|
downloadId: number,
|
|
4166
|
-
options: GetFileIconOptions,
|
|
4193
|
+
options: GetFileIconOptions | undefined,
|
|
4167
4194
|
callback: (iconURL?: string) => void,
|
|
4168
4195
|
): void;
|
|
4169
4196
|
|
|
@@ -4644,7 +4671,7 @@ declare namespace chrome {
|
|
|
4644
4671
|
/** Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */
|
|
4645
4672
|
urlSuffix?: string | undefined;
|
|
4646
4673
|
/** Matches if the port of the URL is contained in any of the specified port lists. For example `[80, 443, [1000, 1200]]` matches all requests on port 80, 443 and in the range 1000-1200. */
|
|
4647
|
-
ports?: Array<number | number
|
|
4674
|
+
ports?: Array<number | [number, number]> | undefined;
|
|
4648
4675
|
/** Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */
|
|
4649
4676
|
originAndPathMatches?: string | undefined;
|
|
4650
4677
|
}
|
|
@@ -8480,7 +8507,7 @@ declare namespace chrome {
|
|
|
8480
8507
|
/** Printer capabilities in [CDD format](https://developers.google.com/cloud-print/docs/cdd#cdd-example). The property may be missing. */
|
|
8481
8508
|
capabilities?: { [key: string]: unknown };
|
|
8482
8509
|
/** The status of the printer. */
|
|
8483
|
-
status: PrinterStatus
|
|
8510
|
+
status: `${PrinterStatus}`;
|
|
8484
8511
|
}
|
|
8485
8512
|
|
|
8486
8513
|
/** Status of the print job. */
|
|
@@ -8567,7 +8594,7 @@ declare namespace chrome {
|
|
|
8567
8594
|
/** The id of created print job. This is a unique identifier among all print jobs on the device. If status is not OK, jobId will be null. */
|
|
8568
8595
|
jobId: string | null;
|
|
8569
8596
|
/** The status of the request. */
|
|
8570
|
-
status: SubmitJobStatus
|
|
8597
|
+
status: `${SubmitJobStatus}`;
|
|
8571
8598
|
}
|
|
8572
8599
|
|
|
8573
8600
|
/** The status of submitJob request. */
|
|
@@ -8672,7 +8699,7 @@ declare namespace chrome {
|
|
|
8672
8699
|
/** Displayed name of the printer. */
|
|
8673
8700
|
name: string;
|
|
8674
8701
|
/** The source of the printer. */
|
|
8675
|
-
source: PrinterSource
|
|
8702
|
+
source: `${PrinterSource}`;
|
|
8676
8703
|
/** The full path for the printer. Contains protocol, hostname, port, and queue. */
|
|
8677
8704
|
uri: string;
|
|
8678
8705
|
}
|
|
@@ -8700,15 +8727,15 @@ declare namespace chrome {
|
|
|
8700
8727
|
* The status of the printer.
|
|
8701
8728
|
* @since Chrome 85
|
|
8702
8729
|
*/
|
|
8703
|
-
printer_status:
|
|
8730
|
+
printer_status: `${printing.PrinterStatus}`;
|
|
8704
8731
|
/** The settings of the print job. */
|
|
8705
8732
|
settings: PrintSettings;
|
|
8706
8733
|
/** Source showing who initiated the print job. */
|
|
8707
|
-
source: PrintJobSource
|
|
8734
|
+
source: `${PrintJobSource}`;
|
|
8708
8735
|
/** ID of source. Null if source is PRINT_PREVIEW or ANDROID_APP. */
|
|
8709
8736
|
sourceId: string | null;
|
|
8710
8737
|
/** The final status of the job. */
|
|
8711
|
-
status: PrintJobStatus
|
|
8738
|
+
status: `${PrintJobStatus}`;
|
|
8712
8739
|
/** The title of the document which was printed. */
|
|
8713
8740
|
title: string;
|
|
8714
8741
|
}
|
|
@@ -8737,11 +8764,11 @@ declare namespace chrome {
|
|
|
8737
8764
|
|
|
8738
8765
|
interface PrintSettings {
|
|
8739
8766
|
/** The requested color mode. */
|
|
8740
|
-
color: ColorMode
|
|
8767
|
+
color: `${ColorMode}`;
|
|
8741
8768
|
/** The requested number of copies. */
|
|
8742
8769
|
copies: number;
|
|
8743
8770
|
/** The requested duplex mode. */
|
|
8744
|
-
duplex: DuplexMode
|
|
8771
|
+
duplex: `${DuplexMode}`;
|
|
8745
8772
|
/** The requested media size. */
|
|
8746
8773
|
mediaSize: MediaSize;
|
|
8747
8774
|
}
|
|
@@ -8772,6 +8799,7 @@ declare namespace chrome {
|
|
|
8772
8799
|
* @since Chrome 151
|
|
8773
8800
|
*/
|
|
8774
8801
|
enum AutofillBlockedType {
|
|
8802
|
+
ALL = "all",
|
|
8775
8803
|
CONTACT_INFO = "contact_info",
|
|
8776
8804
|
PAYMENTS = "payments",
|
|
8777
8805
|
IDENTITY_DOCS = "identity_docs",
|
|
@@ -8915,14 +8943,6 @@ declare namespace chrome {
|
|
|
8915
8943
|
*/
|
|
8916
8944
|
referrersEnabled: chrome.types.ChromeSetting<boolean>;
|
|
8917
8945
|
|
|
8918
|
-
/**
|
|
8919
|
-
* If disabled, Related Website Sets is deactivated.
|
|
8920
|
-
* The value of this preference is of type boolean, and the default value is `true`.
|
|
8921
|
-
* Extensions may only disable this API by setting the value to `false`. If you try setting this API to `true`, it will throw an error.
|
|
8922
|
-
* @since Chrome 121
|
|
8923
|
-
*/
|
|
8924
|
-
relatedWebsiteSetsEnabled: chrome.types.ChromeSetting<boolean>;
|
|
8925
|
-
|
|
8926
8946
|
/**
|
|
8927
8947
|
* If disabled, Chrome blocks third-party sites from setting cookies. The value of this preference is of type boolean, and the default value is `true`. Extensions may not enable this API in Incognito mode, where third-party cookies are blocked and can only be allowed at the site level. If you try setting this API to true in Incognito, it will throw an error.
|
|
8928
8948
|
*
|
|
@@ -10172,6 +10192,12 @@ declare namespace chrome {
|
|
|
10172
10192
|
*/
|
|
10173
10193
|
const onConnectNative: events.Event<(port: Port) => void>;
|
|
10174
10194
|
|
|
10195
|
+
/**
|
|
10196
|
+
* Fired when an extension goes from being in a disabled state to an enabled state.
|
|
10197
|
+
* @since Chrome 155
|
|
10198
|
+
*/
|
|
10199
|
+
const onEnabled: events.Event<() => void>;
|
|
10200
|
+
|
|
10175
10201
|
/** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */
|
|
10176
10202
|
const onSuspend: events.Event<() => void>;
|
|
10177
10203
|
|
|
@@ -11668,6 +11694,15 @@ declare namespace chrome {
|
|
|
11668
11694
|
* @deprecated since Chrome 33. Please use {@link CreateProperties.active active}.
|
|
11669
11695
|
*/
|
|
11670
11696
|
selected?: boolean | undefined;
|
|
11697
|
+
/**
|
|
11698
|
+
* The ID of an existing tab to create a split view with. If specified, the split-with tab must meet the following conditions:
|
|
11699
|
+
* * It must not be an already split tab.
|
|
11700
|
+
* * It must be in the same window as the newly created tab.
|
|
11701
|
+
* * If `windowId` is specified, it must be the same as the split-with tab's window ID.
|
|
11702
|
+
* * If `index` is specified, it must be an index adjacent to the split-with tab and will affect the relative positioning of the newly created tab.
|
|
11703
|
+
* @since Chrome 155
|
|
11704
|
+
*/
|
|
11705
|
+
splitWithTabId?: number | undefined;
|
|
11671
11706
|
}
|
|
11672
11707
|
|
|
11673
11708
|
interface MoveProperties {
|
|
@@ -11994,6 +12029,22 @@ declare namespace chrome {
|
|
|
11994
12029
|
function create(createProperties: CreateProperties): Promise<Tab>;
|
|
11995
12030
|
function create(createProperties: CreateProperties, callback: (tab: Tab) => void): void;
|
|
11996
12031
|
|
|
12032
|
+
/**
|
|
12033
|
+
* Splits two existing tabs into a Split View.
|
|
12034
|
+
* @param tabIds An array of exactly two tab IDs to pair into a Split View. All tabs must meet the following conditions: They must be adjacent. They must not already be in a split view. They must have matching `windowId`, `pinned`, and `groupId` states.
|
|
12035
|
+
* @since Chrome 155
|
|
12036
|
+
*/
|
|
12037
|
+
function createSplit(tabIds: [number, number]): Promise<number>;
|
|
12038
|
+
function createSplit(tabIds: [number, number], callback: (splitViewId: number) => void): void;
|
|
12039
|
+
|
|
12040
|
+
/**
|
|
12041
|
+
* Separates the tabs in a Split View into independent tabs.
|
|
12042
|
+
* @param splitViewId The ID of the Split View to separate.
|
|
12043
|
+
* @since Chrome 155
|
|
12044
|
+
*/
|
|
12045
|
+
function unsplit(splitViewId: number): Promise<void>;
|
|
12046
|
+
function unsplit(splitViewId: number, callback: () => void): void;
|
|
12047
|
+
|
|
11997
12048
|
/**
|
|
11998
12049
|
* Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
|
|
11999
12050
|
* @param tabId The tab ID to move.
|
chrome/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/chrome",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "TypeScript definitions for chrome",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"@types/har-format": "*"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {},
|
|
57
|
-
"typesPublisherContentHash": "
|
|
57
|
+
"typesPublisherContentHash": "76fc785c0457b56ff51aaa280f9fb73bfa3ddf45f56ffd68266aabb276cfd9d6",
|
|
58
58
|
"typeScriptVersion": "5.6"
|
|
59
59
|
}
|