@types/chrome 0.1.26 → 0.1.27
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 +135 -111
- 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: Mon, 27 Oct 2025
|
|
11
|
+
* Last updated: Mon, 27 Oct 2025 20:34:59 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
|
@@ -12470,27 +12470,35 @@ declare namespace chrome {
|
|
|
12470
12470
|
* @since Chrome 43
|
|
12471
12471
|
*/
|
|
12472
12472
|
export namespace wallpaper {
|
|
12473
|
+
/**
|
|
12474
|
+
* The supported wallpaper layouts.
|
|
12475
|
+
* @since Chrome 44
|
|
12476
|
+
*/
|
|
12477
|
+
export enum WallpaperLayout {
|
|
12478
|
+
STRETCH = "STRETCH",
|
|
12479
|
+
CENTER = "CENTER",
|
|
12480
|
+
CENTER_CROPPED = "CENTER_CROPPED",
|
|
12481
|
+
}
|
|
12482
|
+
|
|
12473
12483
|
export interface WallpaperDetails {
|
|
12474
|
-
/**
|
|
12484
|
+
/** The jpeg or png encoded wallpaper image as an ArrayBuffer. */
|
|
12475
12485
|
data?: ArrayBuffer | undefined;
|
|
12476
|
-
/**
|
|
12486
|
+
/** The URL of the wallpaper to be set (can be relative). */
|
|
12477
12487
|
url?: string | undefined;
|
|
12478
|
-
/**
|
|
12479
|
-
|
|
12480
|
-
* One of: "STRETCH", "CENTER", or "CENTER_CROPPED"
|
|
12481
|
-
*/
|
|
12482
|
-
layout: "STRETCH" | "CENTER" | "CENTER_CROPPED";
|
|
12488
|
+
/** The supported wallpaper layouts. */
|
|
12489
|
+
layout: `${WallpaperLayout}`;
|
|
12483
12490
|
/** The file name of the saved wallpaper. */
|
|
12484
12491
|
filename: string;
|
|
12485
|
-
/**
|
|
12492
|
+
/** True if a 128x60 thumbnail should be generated. Layout and ratio are not supported yet. */
|
|
12486
12493
|
thumbnail?: boolean | undefined;
|
|
12487
12494
|
}
|
|
12488
12495
|
|
|
12489
12496
|
/**
|
|
12490
12497
|
* Sets wallpaper to the image at url or wallpaperData with the specified layout
|
|
12491
|
-
*
|
|
12492
|
-
*
|
|
12498
|
+
*
|
|
12499
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12493
12500
|
*/
|
|
12501
|
+
export function setWallpaper(details: WallpaperDetails): Promise<ArrayBuffer | undefined>;
|
|
12494
12502
|
export function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: ArrayBuffer) => void): void;
|
|
12495
12503
|
}
|
|
12496
12504
|
|
|
@@ -14441,133 +14449,165 @@ declare namespace chrome {
|
|
|
14441
14449
|
* @since Chrome 120, MV3
|
|
14442
14450
|
*/
|
|
14443
14451
|
export namespace userScripts {
|
|
14444
|
-
/**
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14452
|
+
/** The JavaScript world for a user script to execute within. */
|
|
14453
|
+
export enum ExecutionWorld {
|
|
14454
|
+
/** Specifies the execution environment of the DOM, which is the execution environment shared with the host page's JavaScript. */
|
|
14455
|
+
MAIN = "MAIN",
|
|
14456
|
+
/** Specifies the execution environment that is specific to user scripts and is exempt from the page's CSP. */
|
|
14457
|
+
USER_SCRIPT = "USER_SCRIPT",
|
|
14458
|
+
}
|
|
14448
14459
|
|
|
14449
14460
|
/** @since Chrome 135 */
|
|
14450
|
-
export
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14461
|
+
export type InjectionResult<T = unknown> =
|
|
14462
|
+
& {
|
|
14463
|
+
/** The document associated with the injection. */
|
|
14464
|
+
documentId: string;
|
|
14465
|
+
/** The frame associated with the injection. */
|
|
14466
|
+
frameId: number;
|
|
14467
|
+
}
|
|
14468
|
+
& (
|
|
14469
|
+
| {
|
|
14470
|
+
/** The error, if any */
|
|
14471
|
+
error?: never;
|
|
14472
|
+
/** The result of the script execution. */
|
|
14473
|
+
result: T;
|
|
14474
|
+
}
|
|
14475
|
+
| {
|
|
14476
|
+
/** The error, if any */
|
|
14477
|
+
error: string;
|
|
14478
|
+
/** The result of the script execution. */
|
|
14479
|
+
result?: never;
|
|
14480
|
+
}
|
|
14481
|
+
);
|
|
14460
14482
|
|
|
14461
14483
|
export interface WorldProperties {
|
|
14462
14484
|
/** Specifies the world csp. The default is the `ISOLATED` world csp. */
|
|
14463
|
-
csp?: string;
|
|
14464
|
-
/** Specifies whether messaging APIs are exposed. The default is false
|
|
14465
|
-
messaging?: boolean;
|
|
14485
|
+
csp?: string | undefined;
|
|
14486
|
+
/** Specifies whether messaging APIs are exposed. The default is `false`.*/
|
|
14487
|
+
messaging?: boolean | undefined;
|
|
14466
14488
|
/**
|
|
14467
14489
|
* Specifies the ID of the specific user script world to update. If not provided, updates the properties of the default user script world. Values with leading underscores (`_`) are reserved.
|
|
14468
14490
|
* @since Chrome 133
|
|
14469
14491
|
*/
|
|
14470
|
-
worldId?: string;
|
|
14492
|
+
worldId?: string | undefined;
|
|
14471
14493
|
}
|
|
14472
14494
|
|
|
14473
14495
|
export interface UserScriptFilter {
|
|
14474
|
-
|
|
14496
|
+
/** {@link getScripts} only returns scripts with the IDs specified in this list. */
|
|
14497
|
+
ids?: string[] | undefined;
|
|
14475
14498
|
}
|
|
14476
14499
|
|
|
14477
|
-
/** @since Chrome 135 */
|
|
14478
|
-
export
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14500
|
+
// /** @since Chrome 135 */
|
|
14501
|
+
export type InjectionTarget =
|
|
14502
|
+
& {
|
|
14503
|
+
/** The ID of the tab into which to inject. */
|
|
14504
|
+
tabId: number;
|
|
14505
|
+
}
|
|
14506
|
+
& (
|
|
14507
|
+
| {
|
|
14508
|
+
/** Whether the script should inject into all frames within the tab. Defaults to false. */
|
|
14509
|
+
allFrames?: boolean | undefined;
|
|
14510
|
+
/** The IDs of specific documentIds to inject into. */
|
|
14511
|
+
documentIds?: never;
|
|
14512
|
+
/** The IDs of specific frames to inject into. */
|
|
14513
|
+
frameIds?: never;
|
|
14514
|
+
}
|
|
14515
|
+
| {
|
|
14516
|
+
/** Whether the script should inject into all frames within the tab. Defaults to false. */
|
|
14517
|
+
allFrames?: false | undefined;
|
|
14518
|
+
/** The IDs of specific documentIds to inject into. */
|
|
14519
|
+
documentIds?: never;
|
|
14520
|
+
/** The IDs of specific frames to inject into. */
|
|
14521
|
+
frameIds: number[] | undefined;
|
|
14522
|
+
}
|
|
14523
|
+
| {
|
|
14524
|
+
/** Whether the script should inject into all frames within the tab. Defaults to false. */
|
|
14525
|
+
allFrames?: false | undefined;
|
|
14526
|
+
/** The IDs of specific documentIds to inject into. */
|
|
14527
|
+
documentIds?: string[] | undefined;
|
|
14528
|
+
/** The IDs of specific frames to inject into. */
|
|
14529
|
+
frameIds?: never;
|
|
14530
|
+
}
|
|
14531
|
+
);
|
|
14488
14532
|
|
|
14489
14533
|
export interface RegisteredUserScript {
|
|
14490
14534
|
/** If true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched. */
|
|
14491
|
-
allFrames?: boolean;
|
|
14535
|
+
allFrames?: boolean | undefined;
|
|
14492
14536
|
/** Specifies wildcard patterns for pages this user script will NOT be injected into. */
|
|
14493
|
-
excludeGlobs?: string[];
|
|
14537
|
+
excludeGlobs?: string[] | undefined;
|
|
14494
14538
|
/**Excludes pages that this user script would otherwise be injected into. See Match Patterns for more details on the syntax of these strings. */
|
|
14495
|
-
excludeMatches?: string[];
|
|
14539
|
+
excludeMatches?: string[] | undefined;
|
|
14496
14540
|
/** The ID of the user script specified in the API call. This property must not start with a '_' as it's reserved as a prefix for generated script IDs. */
|
|
14497
14541
|
id: string;
|
|
14498
14542
|
/** Specifies wildcard patterns for pages this user script will be injected into. */
|
|
14499
|
-
includeGlobs?: string[];
|
|
14543
|
+
includeGlobs?: string[] | undefined;
|
|
14500
14544
|
/** The list of ScriptSource objects defining sources of scripts to be injected into matching pages. This property must be specified for {@link register}, and when specified it must be a non-empty array.*/
|
|
14501
14545
|
js: ScriptSource[];
|
|
14502
|
-
/** Specifies which pages this user script will be injected into. See Match Patterns for more details on the syntax of these strings. This property must be specified for
|
|
14503
|
-
matches?: string[];
|
|
14504
|
-
/** Specifies when JavaScript files are injected into the web page. The preferred and default value is document_idle */
|
|
14505
|
-
runAt?: extensionTypes.RunAt;
|
|
14546
|
+
/** Specifies which pages this user script will be injected into. See Match Patterns for more details on the syntax of these strings. This property must be specified for {@link register}. */
|
|
14547
|
+
matches?: string[] | undefined;
|
|
14548
|
+
/** Specifies when JavaScript files are injected into the web page. The preferred and default value is `document_idle` */
|
|
14549
|
+
runAt?: extensionTypes.RunAt | undefined;
|
|
14506
14550
|
/** The JavaScript execution environment to run the script in. The default is `USER_SCRIPT` */
|
|
14507
|
-
world?: ExecutionWorld;
|
|
14551
|
+
world?: `${ExecutionWorld}` | undefined;
|
|
14508
14552
|
/**
|
|
14509
14553
|
* Specifies the user script world ID to execute in. If omitted, the script will execute in the default user script world. Only valid if `world` is omitted or is `USER_SCRIPT`. Values with leading underscores (`_`) are reserved.
|
|
14510
14554
|
* @since Chrome 133
|
|
14511
14555
|
*/
|
|
14512
|
-
worldId?: string;
|
|
14556
|
+
worldId?: string | undefined;
|
|
14513
14557
|
}
|
|
14514
14558
|
|
|
14515
14559
|
/** @since Chrome 135 */
|
|
14516
14560
|
export interface UserScriptInjection {
|
|
14517
14561
|
/** Whether the injection should be triggered in the target as soon as possible. Note that this is not a guarantee that injection will occur prior to page load, as the page may have already loaded by the time the script reaches the target. */
|
|
14518
|
-
injectImmediately?: boolean;
|
|
14562
|
+
injectImmediately?: boolean | undefined;
|
|
14519
14563
|
/** The list of ScriptSource objects defining sources of scripts to be injected into the target. */
|
|
14520
|
-
js: ScriptSource[];
|
|
14564
|
+
js: [ScriptSource, ...ScriptSource[]];
|
|
14521
14565
|
/** Details specifying the target into which to inject the script. */
|
|
14522
14566
|
target: InjectionTarget;
|
|
14523
14567
|
/** The JavaScript "world" to run the script in. The default is `USER_SCRIPT`. */
|
|
14524
|
-
world?: ExecutionWorld;
|
|
14568
|
+
world?: `${ExecutionWorld}` | undefined;
|
|
14525
14569
|
/** Specifies the user script world ID to execute in. If omitted, the script will execute in the default user script world. Only valid if `world` is omitted or is `USER_SCRIPT`. Values with leading underscores (`_`) are reserved. */
|
|
14526
|
-
worldId?: string;
|
|
14570
|
+
worldId?: string | undefined;
|
|
14527
14571
|
}
|
|
14528
14572
|
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
/**
|
|
14536
|
-
|
|
14537
|
-
|
|
14573
|
+
export type ScriptSource = {
|
|
14574
|
+
/** A string containing the JavaScript code to inject. */
|
|
14575
|
+
code: string;
|
|
14576
|
+
/** The path of the JavaScript file to inject relative to the extension's root directory. */
|
|
14577
|
+
file?: undefined;
|
|
14578
|
+
} | {
|
|
14579
|
+
/** A string containing the JavaScript code to inject. */
|
|
14580
|
+
code?: undefined;
|
|
14581
|
+
/** The path of the JavaScript file to inject relative to the extension's root directory. */
|
|
14582
|
+
file: string;
|
|
14583
|
+
};
|
|
14538
14584
|
|
|
14539
14585
|
/**
|
|
14540
14586
|
* Configures the `USER_SCRIPT` execution environment.
|
|
14541
14587
|
*
|
|
14542
|
-
*
|
|
14543
|
-
* @
|
|
14588
|
+
* Can return its result via Promise.
|
|
14589
|
+
* @param properties Contains the user script world configuration.
|
|
14544
14590
|
*/
|
|
14545
14591
|
export function configureWorld(properties: WorldProperties): Promise<void>;
|
|
14546
|
-
/**
|
|
14547
|
-
* Configures the `USER_SCRIPT` execution environment.
|
|
14548
|
-
*
|
|
14549
|
-
* @param properties - Contains the user script world configuration.
|
|
14550
|
-
* @param callback - Callback function to be executed after configuring the world.
|
|
14551
|
-
*/
|
|
14552
14592
|
export function configureWorld(properties: WorldProperties, callback: () => void): void;
|
|
14553
14593
|
|
|
14554
14594
|
/**
|
|
14555
14595
|
* Returns all dynamically-registered user scripts for this extension.
|
|
14556
14596
|
*
|
|
14557
|
-
*
|
|
14558
|
-
* @
|
|
14597
|
+
* Can return its result via Promise.
|
|
14598
|
+
* @param filter If specified, this method returns only the user scripts that match it.
|
|
14559
14599
|
*/
|
|
14560
14600
|
export function getScripts(filter?: UserScriptFilter): Promise<RegisteredUserScript[]>;
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
|
|
14566
|
-
*/
|
|
14567
|
-
export function getScripts(filter: UserScriptFilter, callback: (scripts: RegisteredUserScript[]) => void): void;
|
|
14601
|
+
export function getScripts(callback: (scripts: RegisteredUserScript[]) => void): void;
|
|
14602
|
+
export function getScripts(
|
|
14603
|
+
filter: UserScriptFilter | undefined,
|
|
14604
|
+
callback: (scripts: RegisteredUserScript[]) => void,
|
|
14605
|
+
): void;
|
|
14568
14606
|
|
|
14569
14607
|
/**
|
|
14570
14608
|
* Retrieves all registered world configurations.
|
|
14609
|
+
*
|
|
14610
|
+
* Can return its result via Promise.
|
|
14571
14611
|
* @since Chrome 133
|
|
14572
14612
|
*/
|
|
14573
14613
|
export function getWorldConfigurations(): Promise<WorldProperties[]>;
|
|
@@ -14575,24 +14615,23 @@ declare namespace chrome {
|
|
|
14575
14615
|
|
|
14576
14616
|
/**
|
|
14577
14617
|
* Injects a script into a target context. By default, the script will be run at `document_idle`, or immediately if the page has already loaded. If the `injectImmediately` property is set, the script will inject without waiting, even if the page has not finished loading. If the script evaluates to a promise, the browser will wait for the promise to settle and return the resulting value.
|
|
14618
|
+
*
|
|
14619
|
+
* Can return its result via Promise.
|
|
14578
14620
|
* @since Chrome 135
|
|
14579
14621
|
*/
|
|
14580
|
-
export function execute(injection: UserScriptInjection): Promise<InjectionResult[]>;
|
|
14581
|
-
export function execute(
|
|
14622
|
+
export function execute<T>(injection: UserScriptInjection): Promise<InjectionResult<T>[]>;
|
|
14623
|
+
export function execute<T>(
|
|
14624
|
+
injection: UserScriptInjection,
|
|
14625
|
+
callback: (result: InjectionResult<T>[]) => void,
|
|
14626
|
+
): void;
|
|
14582
14627
|
|
|
14583
14628
|
/**
|
|
14584
14629
|
* Registers one or more user scripts for this extension.
|
|
14585
14630
|
*
|
|
14631
|
+
* Can return its result via Promise.
|
|
14586
14632
|
* @param scripts - Contains a list of user scripts to be registered.
|
|
14587
|
-
* @returns A Promise that resolves with the same type that is passed to the callback.
|
|
14588
14633
|
*/
|
|
14589
14634
|
export function register(scripts: RegisteredUserScript[]): Promise<void>;
|
|
14590
|
-
/**
|
|
14591
|
-
* Registers one or more user scripts for this extension.
|
|
14592
|
-
*
|
|
14593
|
-
* @param scripts - Contains a list of user scripts to be registered.
|
|
14594
|
-
* @param callback - Callback function to be executed after registering user scripts.
|
|
14595
|
-
*/
|
|
14596
14635
|
export function register(scripts: RegisteredUserScript[], callback: () => void): void;
|
|
14597
14636
|
|
|
14598
14637
|
/**
|
|
@@ -14600,41 +14639,26 @@ declare namespace chrome {
|
|
|
14600
14639
|
* @param worldId The ID of the user script world to reset. If omitted, resets the default world's configuration.
|
|
14601
14640
|
*/
|
|
14602
14641
|
export function resetWorldConfiguration(worldId?: string): Promise<void>;
|
|
14603
|
-
export function resetWorldConfiguration(worldId: string, callback: () => void): void;
|
|
14604
14642
|
export function resetWorldConfiguration(callback: () => void): void;
|
|
14643
|
+
export function resetWorldConfiguration(worldId: string | undefined, callback: () => void): void;
|
|
14605
14644
|
|
|
14606
14645
|
/**
|
|
14607
14646
|
* Unregisters all dynamically-registered user scripts for this extension.
|
|
14608
14647
|
*
|
|
14609
|
-
*
|
|
14610
|
-
* @
|
|
14648
|
+
* Can return its result via Promise.
|
|
14649
|
+
* @param filter If specified, this method unregisters only the user scripts that match it.
|
|
14611
14650
|
*/
|
|
14612
14651
|
export function unregister(filter?: UserScriptFilter): Promise<void>;
|
|
14613
|
-
|
|
14614
|
-
|
|
14615
|
-
*
|
|
14616
|
-
* @param filter - If specified, this method unregisters only the user scripts that match it.
|
|
14617
|
-
* @param callback - Callback function to be executed after unregistering user scripts.
|
|
14618
|
-
*/
|
|
14619
|
-
export function unregister(filter: UserScriptFilter, callback: () => void): void;
|
|
14652
|
+
export function unregister(callback: () => void): void;
|
|
14653
|
+
export function unregister(filter: UserScriptFilter | undefined, callback: () => void): void;
|
|
14620
14654
|
|
|
14621
14655
|
/**
|
|
14622
14656
|
* Updates one or more user scripts for this extension.
|
|
14623
14657
|
*
|
|
14624
|
-
*
|
|
14625
|
-
*
|
|
14626
|
-
* the IDs specified do not correspond to a fully registered script, then no scripts are updated.
|
|
14627
|
-
* @returns A Promise that resolves with the same type that is passed to the callback.
|
|
14658
|
+
* Can return its result via Promise.
|
|
14659
|
+
* @param scripts Contains a list of user scripts to be updated. A property is only updated for the existing script if it is specified in this object. If there are errors during script parsing/file validation, or if the IDs specified do not correspond to a fully registered script, then no scripts are updated.
|
|
14628
14660
|
*/
|
|
14629
14661
|
export function update(scripts: RegisteredUserScript[]): Promise<void>;
|
|
14630
|
-
/**
|
|
14631
|
-
* Updates one or more user scripts for this extension.
|
|
14632
|
-
*
|
|
14633
|
-
* @param scripts - Contains a list of user scripts to be updated. A property is only updated for the existing script
|
|
14634
|
-
* if it is specified in this object. If there are errors during script parsing/file validation, or if
|
|
14635
|
-
* the IDs specified do not correspond to a fully registered script, then no scripts are updated.
|
|
14636
|
-
* @param callback - Callback function to be executed after updating user scripts.
|
|
14637
|
-
*/
|
|
14638
14662
|
export function update(scripts: RegisteredUserScript[], callback: () => void): void;
|
|
14639
14663
|
}
|
|
14640
14664
|
}
|
chrome/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/chrome",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "TypeScript definitions for chrome",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,6 +94,6 @@
|
|
|
94
94
|
"@types/har-format": "*"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {},
|
|
97
|
-
"typesPublisherContentHash": "
|
|
97
|
+
"typesPublisherContentHash": "855bc18cd67fbe7ca35c8d69bffa87a3a938f61821b97032b7fc5ef9613bd1ce",
|
|
98
98
|
"typeScriptVersion": "5.2"
|
|
99
99
|
}
|