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