@types/chrome 0.1.7 → 0.1.8
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 +40 -74
- 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, 08 Sep 2025
|
11
|
+
* Last updated: Mon, 08 Sep 2025 17:02:22 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
@@ -2832,12 +2832,6 @@ declare namespace chrome {
|
|
2832
2832
|
* Manifest: "devtools_page"
|
2833
2833
|
*/
|
2834
2834
|
export namespace devtools.panels {
|
2835
|
-
export interface PanelShownEvent extends chrome.events.Event<(window: Window) => void> {}
|
2836
|
-
|
2837
|
-
export interface PanelHiddenEvent extends chrome.events.Event<() => void> {}
|
2838
|
-
|
2839
|
-
export interface PanelSearchEvent extends chrome.events.Event<(action: string, queryString?: string) => void> {}
|
2840
|
-
|
2841
2835
|
/** Represents a panel created by an extension. */
|
2842
2836
|
export interface ExtensionPanel {
|
2843
2837
|
/**
|
@@ -2848,15 +2842,13 @@ declare namespace chrome {
|
|
2848
2842
|
*/
|
2849
2843
|
createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button;
|
2850
2844
|
/** Fired when the user switches to the panel. */
|
2851
|
-
onShown:
|
2845
|
+
onShown: events.Event<(window: Window) => void>;
|
2852
2846
|
/** Fired when the user switches away from the panel. */
|
2853
|
-
onHidden:
|
2847
|
+
onHidden: events.Event<() => void>;
|
2854
2848
|
/** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */
|
2855
|
-
onSearch:
|
2849
|
+
onSearch: events.Event<(action: string, queryString?: string) => void>;
|
2856
2850
|
}
|
2857
2851
|
|
2858
|
-
export interface ButtonClickedEvent extends chrome.events.Event<() => void> {}
|
2859
|
-
|
2860
2852
|
/** A button created by the extension. */
|
2861
2853
|
export interface Button {
|
2862
2854
|
/**
|
@@ -2867,38 +2859,31 @@ declare namespace chrome {
|
|
2867
2859
|
*/
|
2868
2860
|
update(iconPath?: string | null, tooltipText?: string | null, disabled?: boolean | null): void;
|
2869
2861
|
/** Fired when the button is clicked. */
|
2870
|
-
onClicked:
|
2862
|
+
onClicked: events.Event<() => void>;
|
2871
2863
|
}
|
2872
2864
|
|
2873
|
-
export interface SelectionChangedEvent extends chrome.events.Event<() => void> {}
|
2874
|
-
|
2875
2865
|
/** Represents the Elements panel. */
|
2876
2866
|
export interface ElementsPanel {
|
2877
2867
|
/**
|
2878
2868
|
* Creates a pane within panel's sidebar.
|
2879
2869
|
* @param title Text that is displayed in sidebar caption.
|
2880
|
-
* @param callback A callback invoked when the sidebar is created.
|
2881
2870
|
*/
|
2882
2871
|
createSidebarPane(
|
2883
2872
|
title: string,
|
2884
2873
|
callback?: (
|
2885
|
-
/** An ExtensionSidebarPane object for created sidebar pane */
|
2874
|
+
/** An ExtensionSidebarPane object for created sidebar pane. */
|
2886
2875
|
result: ExtensionSidebarPane,
|
2887
2876
|
) => void,
|
2888
2877
|
): void;
|
2889
2878
|
/** Fired when an object is selected in the panel. */
|
2890
|
-
onSelectionChanged:
|
2879
|
+
onSelectionChanged: events.Event<() => void>;
|
2891
2880
|
}
|
2892
2881
|
|
2893
|
-
/**
|
2894
|
-
* @since Chrome 41
|
2895
|
-
* Represents the Sources panel.
|
2896
|
-
*/
|
2882
|
+
/** Represents the Sources panel. */
|
2897
2883
|
export interface SourcesPanel {
|
2898
2884
|
/**
|
2899
2885
|
* Creates a pane within panel's sidebar.
|
2900
2886
|
* @param title Text that is displayed in sidebar caption.
|
2901
|
-
* @param callback A callback invoked when the sidebar is created.
|
2902
2887
|
*/
|
2903
2888
|
createSidebarPane(
|
2904
2889
|
title: string,
|
@@ -2908,115 +2893,96 @@ declare namespace chrome {
|
|
2908
2893
|
) => void,
|
2909
2894
|
): void;
|
2910
2895
|
/** Fired when an object is selected in the panel. */
|
2911
|
-
onSelectionChanged:
|
2896
|
+
onSelectionChanged: events.Event<() => void>;
|
2912
2897
|
}
|
2913
2898
|
|
2914
|
-
export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: Window) => void> {}
|
2915
|
-
|
2916
|
-
export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {}
|
2917
|
-
|
2918
2899
|
/** A sidebar created by the extension. */
|
2919
2900
|
export interface ExtensionSidebarPane {
|
2920
2901
|
/**
|
2921
2902
|
* Sets the height of the sidebar.
|
2922
|
-
* @param height A CSS-like size specification, such as
|
2903
|
+
* @param height A CSS-like size specification, such as `100px` or `12ex`.
|
2923
2904
|
*/
|
2924
2905
|
setHeight(height: string): void;
|
2925
2906
|
/**
|
2926
2907
|
* Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
|
2927
2908
|
* @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
|
2928
2909
|
* @param rootTitle An optional title for the root of the expression tree.
|
2929
|
-
* @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
|
2930
|
-
*/
|
2931
|
-
setExpression(expression: string, rootTitle?: string, callback?: () => void): void;
|
2932
|
-
/**
|
2933
|
-
* Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
|
2934
|
-
* @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
|
2935
|
-
* @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
|
2936
2910
|
*/
|
2937
2911
|
setExpression(expression: string, callback?: () => void): void;
|
2912
|
+
setExpression(expression: string, rootTitle: string | undefined, callback?: () => void): void;
|
2938
2913
|
/**
|
2939
2914
|
* Sets a JSON-compliant object to be displayed in the sidebar pane.
|
2940
2915
|
* @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
|
2941
2916
|
* @param rootTitle An optional title for the root of the expression tree.
|
2942
|
-
* @param callback A callback invoked after the sidebar is updated with the object.
|
2943
|
-
*/
|
2944
|
-
setObject(jsonObject: { [key: string]: unknown }, rootTitle?: string, callback?: () => void): void;
|
2945
|
-
/**
|
2946
|
-
* Sets a JSON-compliant object to be displayed in the sidebar pane.
|
2947
|
-
* @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
|
2948
|
-
* @param callback A callback invoked after the sidebar is updated with the object.
|
2949
2917
|
*/
|
2950
2918
|
setObject(jsonObject: { [key: string]: unknown }, callback?: () => void): void;
|
2919
|
+
setObject(
|
2920
|
+
jsonObject: { [key: string]: unknown },
|
2921
|
+
rootTitle: string | undefined,
|
2922
|
+
callback?: () => void,
|
2923
|
+
): void;
|
2951
2924
|
/**
|
2952
2925
|
* Sets an HTML page to be displayed in the sidebar pane.
|
2953
2926
|
* @param path Relative path of an extension page to display within the sidebar.
|
2954
2927
|
*/
|
2955
2928
|
setPage(path: string): void;
|
2956
2929
|
/** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */
|
2957
|
-
onShown:
|
2930
|
+
onShown: events.Event<(window: Window) => void>;
|
2958
2931
|
/** Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane. */
|
2959
|
-
onHidden:
|
2932
|
+
onHidden: events.Event<() => void>;
|
2960
2933
|
}
|
2961
2934
|
|
2962
2935
|
/** Elements panel. */
|
2963
|
-
export
|
2964
|
-
|
2965
|
-
|
2966
|
-
|
2967
|
-
*/
|
2968
|
-
export var sources: SourcesPanel;
|
2936
|
+
export const elements: ElementsPanel;
|
2937
|
+
|
2938
|
+
/** Sources panel. */
|
2939
|
+
export const sources: SourcesPanel;
|
2969
2940
|
|
2970
2941
|
/**
|
2971
2942
|
* Creates an extension panel.
|
2972
2943
|
* @param title Title that is displayed next to the extension icon in the Developer Tools toolbar.
|
2973
2944
|
* @param iconPath Path of the panel's icon relative to the extension directory.
|
2974
2945
|
* @param pagePath Path of the panel's HTML page relative to the extension directory.
|
2975
|
-
* @param callback A function that is called when the panel is created.
|
2976
|
-
* Parameter panel: An ExtensionPanel object representing the created panel.
|
2977
2946
|
*/
|
2978
2947
|
export function create(
|
2979
2948
|
title: string,
|
2980
2949
|
iconPath: string,
|
2981
2950
|
pagePath: string,
|
2982
|
-
callback?: (
|
2951
|
+
callback?: (
|
2952
|
+
/** An ExtensionPanel object representing the created panel. */
|
2953
|
+
panel: ExtensionPanel,
|
2954
|
+
) => void,
|
2983
2955
|
): void;
|
2984
|
-
|
2985
|
-
|
2986
|
-
* @param callback A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called.
|
2987
|
-
* Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked.
|
2988
|
-
* Parameter lineNumber: Specifies the line number within the resource that was clicked.
|
2989
|
-
*/
|
2956
|
+
|
2957
|
+
/** Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter. */
|
2990
2958
|
export function setOpenResourceHandler(
|
2991
|
-
callback?: (
|
2959
|
+
callback?: (
|
2960
|
+
/** A {@link devtools.inspectedWindow.Resource} object for the resource that was clicked. */
|
2961
|
+
resource: chrome.devtools.inspectedWindow.Resource,
|
2962
|
+
/** Specifies the line number within the resource that was clicked. */
|
2963
|
+
lineNumber: number,
|
2964
|
+
) => void,
|
2992
2965
|
): void;
|
2966
|
+
|
2993
2967
|
/**
|
2994
|
-
* @since Chrome 38
|
2995
|
-
* Requests DevTools to open a URL in a Developer Tools panel.
|
2996
|
-
* @param url The URL of the resource to open.
|
2997
|
-
* @param lineNumber Specifies the line number to scroll to when the resource is loaded.
|
2998
|
-
* @param callback A function that is called when the resource has been successfully loaded.
|
2999
|
-
*/
|
3000
|
-
export function openResource(url: string, lineNumber: number, callback?: () => void): void;
|
3001
|
-
/**
|
3002
|
-
* @since Chrome 96
|
3003
2968
|
* Requests DevTools to open a URL in a Developer Tools panel.
|
3004
2969
|
* @param url The URL of the resource to open.
|
3005
2970
|
* @param lineNumber Specifies the line number to scroll to when the resource is loaded.
|
3006
2971
|
* @param columnNumber Specifies the column number to scroll to when the resource is loaded.
|
3007
|
-
* @param callback A function that is called when the resource has been successfully loaded.
|
3008
2972
|
*/
|
2973
|
+
export function openResource(url: string, lineNumber: number, callback?: () => void): void;
|
3009
2974
|
export function openResource(
|
3010
2975
|
url: string,
|
3011
2976
|
lineNumber: number,
|
3012
|
-
columnNumber: number,
|
3013
|
-
callback?: (
|
2977
|
+
columnNumber: number | undefined,
|
2978
|
+
callback?: () => void,
|
3014
2979
|
): void;
|
2980
|
+
|
3015
2981
|
/**
|
3016
|
-
* @since Chrome 59
|
3017
2982
|
* The name of the color theme set in user's DevTools settings.
|
2983
|
+
* @since Chrome 59
|
3018
2984
|
*/
|
3019
|
-
export
|
2985
|
+
export const themeName: "default" | "dark";
|
3020
2986
|
}
|
3021
2987
|
|
3022
2988
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.8",
|
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": "dc5d11f343dffc5c150c5a5c06f8e3b76c47aec59a91ba0ff73658f439f5b217",
|
98
98
|
"typeScriptVersion": "5.2"
|
99
99
|
}
|