@types/chrome 0.1.7 → 0.1.9

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.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +54 -97
  3. 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 16:37:53 GMT
11
+ * Last updated: Mon, 08 Sep 2025 17:34:26 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
@@ -2772,41 +2772,32 @@ declare namespace chrome {
2772
2772
  * Manifest: "devtools_page"
2773
2773
  */
2774
2774
  export namespace devtools.network {
2775
- /** Represents a HAR entry for a specific finished request. */
2776
- export interface HAREntry extends HARFormatEntry {}
2777
- /** Represents a HAR log that contains all known network requests. */
2778
- export interface HARLog extends HARFormatLog {}
2779
2775
  /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */
2780
- export interface Request extends chrome.devtools.network.HAREntry {
2781
- /**
2782
- * Returns content of the response body.
2783
- * @param callback A function that receives the response body when the request completes.
2784
- */
2776
+ export interface Request extends HARFormatEntry {
2777
+ /** Returns content of the response body. */
2785
2778
  getContent(
2786
2779
  callback: (
2787
- /** Content of the response body (potentially encoded) */
2780
+ /** Content of the response body (potentially encoded). */
2788
2781
  content: string,
2789
- /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported */
2782
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */
2790
2783
  encoding: string,
2791
2784
  ) => void,
2792
2785
  ): void;
2793
2786
  }
2794
2787
 
2795
- export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> {}
2796
-
2797
- export interface NavigatedEvent extends chrome.events.Event<(url: string) => void> {}
2798
-
2799
- /**
2800
- * Returns HAR log that contains all known network requests.
2801
- * @param callback A function that receives the HAR log when the request completes.
2802
- * Parameter harLog: A HAR log. See HAR specification for details.
2803
- */
2804
- export function getHAR(callback: (harLog: HARLog) => void): void;
2788
+ /** Returns HAR log that contains all known network requests. */
2789
+ export function getHAR(
2790
+ callback: (
2791
+ /** A HAR log. See HAR specification for details. */
2792
+ harLog: HARFormatLog,
2793
+ ) => void,
2794
+ ): void;
2805
2795
 
2806
2796
  /** Fired when a network request is finished and all request data are available. */
2807
- export var onRequestFinished: RequestFinishedEvent;
2797
+ export const onRequestFinished: events.Event<(request: Request) => void>;
2798
+
2808
2799
  /** Fired when the inspected window navigates to a new page. */
2809
- export var onNavigated: NavigatedEvent;
2800
+ export const onNavigated: events.Event<(url: string) => void>;
2810
2801
  }
2811
2802
 
2812
2803
  ////////////////////
@@ -2832,12 +2823,6 @@ declare namespace chrome {
2832
2823
  * Manifest: "devtools_page"
2833
2824
  */
2834
2825
  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
2826
  /** Represents a panel created by an extension. */
2842
2827
  export interface ExtensionPanel {
2843
2828
  /**
@@ -2848,15 +2833,13 @@ declare namespace chrome {
2848
2833
  */
2849
2834
  createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button;
2850
2835
  /** Fired when the user switches to the panel. */
2851
- onShown: PanelShownEvent;
2836
+ onShown: events.Event<(window: Window) => void>;
2852
2837
  /** Fired when the user switches away from the panel. */
2853
- onHidden: PanelHiddenEvent;
2838
+ onHidden: events.Event<() => void>;
2854
2839
  /** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */
2855
- onSearch: PanelSearchEvent;
2840
+ onSearch: events.Event<(action: string, queryString?: string) => void>;
2856
2841
  }
2857
2842
 
2858
- export interface ButtonClickedEvent extends chrome.events.Event<() => void> {}
2859
-
2860
2843
  /** A button created by the extension. */
2861
2844
  export interface Button {
2862
2845
  /**
@@ -2867,38 +2850,31 @@ declare namespace chrome {
2867
2850
  */
2868
2851
  update(iconPath?: string | null, tooltipText?: string | null, disabled?: boolean | null): void;
2869
2852
  /** Fired when the button is clicked. */
2870
- onClicked: ButtonClickedEvent;
2853
+ onClicked: events.Event<() => void>;
2871
2854
  }
2872
2855
 
2873
- export interface SelectionChangedEvent extends chrome.events.Event<() => void> {}
2874
-
2875
2856
  /** Represents the Elements panel. */
2876
2857
  export interface ElementsPanel {
2877
2858
  /**
2878
2859
  * Creates a pane within panel's sidebar.
2879
2860
  * @param title Text that is displayed in sidebar caption.
2880
- * @param callback A callback invoked when the sidebar is created.
2881
2861
  */
2882
2862
  createSidebarPane(
2883
2863
  title: string,
2884
2864
  callback?: (
2885
- /** An ExtensionSidebarPane object for created sidebar pane */
2865
+ /** An ExtensionSidebarPane object for created sidebar pane. */
2886
2866
  result: ExtensionSidebarPane,
2887
2867
  ) => void,
2888
2868
  ): void;
2889
2869
  /** Fired when an object is selected in the panel. */
2890
- onSelectionChanged: SelectionChangedEvent;
2870
+ onSelectionChanged: events.Event<() => void>;
2891
2871
  }
2892
2872
 
2893
- /**
2894
- * @since Chrome 41
2895
- * Represents the Sources panel.
2896
- */
2873
+ /** Represents the Sources panel. */
2897
2874
  export interface SourcesPanel {
2898
2875
  /**
2899
2876
  * Creates a pane within panel's sidebar.
2900
2877
  * @param title Text that is displayed in sidebar caption.
2901
- * @param callback A callback invoked when the sidebar is created.
2902
2878
  */
2903
2879
  createSidebarPane(
2904
2880
  title: string,
@@ -2908,115 +2884,96 @@ declare namespace chrome {
2908
2884
  ) => void,
2909
2885
  ): void;
2910
2886
  /** Fired when an object is selected in the panel. */
2911
- onSelectionChanged: SelectionChangedEvent;
2887
+ onSelectionChanged: events.Event<() => void>;
2912
2888
  }
2913
2889
 
2914
- export interface ExtensionSidebarPaneShownEvent extends chrome.events.Event<(window: Window) => void> {}
2915
-
2916
- export interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event<() => void> {}
2917
-
2918
2890
  /** A sidebar created by the extension. */
2919
2891
  export interface ExtensionSidebarPane {
2920
2892
  /**
2921
2893
  * Sets the height of the sidebar.
2922
- * @param height A CSS-like size specification, such as '100px' or '12ex'.
2894
+ * @param height A CSS-like size specification, such as `100px` or `12ex`.
2923
2895
  */
2924
2896
  setHeight(height: string): void;
2925
2897
  /**
2926
2898
  * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
2927
2899
  * @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
2900
  * @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
2901
  */
2937
2902
  setExpression(expression: string, callback?: () => void): void;
2903
+ setExpression(expression: string, rootTitle: string | undefined, callback?: () => void): void;
2938
2904
  /**
2939
2905
  * Sets a JSON-compliant object to be displayed in the sidebar pane.
2940
2906
  * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
2941
2907
  * @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
2908
  */
2950
2909
  setObject(jsonObject: { [key: string]: unknown }, callback?: () => void): void;
2910
+ setObject(
2911
+ jsonObject: { [key: string]: unknown },
2912
+ rootTitle: string | undefined,
2913
+ callback?: () => void,
2914
+ ): void;
2951
2915
  /**
2952
2916
  * Sets an HTML page to be displayed in the sidebar pane.
2953
2917
  * @param path Relative path of an extension page to display within the sidebar.
2954
2918
  */
2955
2919
  setPage(path: string): void;
2956
2920
  /** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */
2957
- onShown: ExtensionSidebarPaneShownEvent;
2921
+ onShown: events.Event<(window: Window) => void>;
2958
2922
  /** 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: ExtensionSidebarPaneHiddenEvent;
2923
+ onHidden: events.Event<() => void>;
2960
2924
  }
2961
2925
 
2962
2926
  /** Elements panel. */
2963
- export var elements: ElementsPanel;
2964
- /**
2965
- * @since Chrome 38
2966
- * Sources panel.
2967
- */
2968
- export var sources: SourcesPanel;
2927
+ export const elements: ElementsPanel;
2928
+
2929
+ /** Sources panel. */
2930
+ export const sources: SourcesPanel;
2969
2931
 
2970
2932
  /**
2971
2933
  * Creates an extension panel.
2972
2934
  * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar.
2973
2935
  * @param iconPath Path of the panel's icon relative to the extension directory.
2974
2936
  * @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
2937
  */
2978
2938
  export function create(
2979
2939
  title: string,
2980
2940
  iconPath: string,
2981
2941
  pagePath: string,
2982
- callback?: (panel: ExtensionPanel) => void,
2942
+ callback?: (
2943
+ /** An ExtensionPanel object representing the created panel. */
2944
+ panel: ExtensionPanel,
2945
+ ) => void,
2983
2946
  ): void;
2984
- /**
2985
- * 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.
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
- */
2947
+
2948
+ /** 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
2949
  export function setOpenResourceHandler(
2991
- callback?: (resource: chrome.devtools.inspectedWindow.Resource, lineNumber: number) => void,
2950
+ callback?: (
2951
+ /** A {@link devtools.inspectedWindow.Resource} object for the resource that was clicked. */
2952
+ resource: chrome.devtools.inspectedWindow.Resource,
2953
+ /** Specifies the line number within the resource that was clicked. */
2954
+ lineNumber: number,
2955
+ ) => void,
2992
2956
  ): void;
2957
+
2993
2958
  /**
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
2959
  * Requests DevTools to open a URL in a Developer Tools panel.
3004
2960
  * @param url The URL of the resource to open.
3005
2961
  * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
3006
2962
  * @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
2963
  */
2964
+ export function openResource(url: string, lineNumber: number, callback?: () => void): void;
3009
2965
  export function openResource(
3010
2966
  url: string,
3011
2967
  lineNumber: number,
3012
- columnNumber: number,
3013
- callback?: (response: unknown) => unknown,
2968
+ columnNumber: number | undefined,
2969
+ callback?: () => void,
3014
2970
  ): void;
2971
+
3015
2972
  /**
3016
- * @since Chrome 59
3017
2973
  * The name of the color theme set in user's DevTools settings.
2974
+ * @since Chrome 59
3018
2975
  */
3019
- export var themeName: "default" | "dark";
2976
+ export const themeName: "default" | "dark";
3020
2977
  }
3021
2978
 
3022
2979
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
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": "b5537887aa39e34c2ca42e2ec6ebfdbbd43cd16e40272c028c6ed219c1a98d4c",
97
+ "typesPublisherContentHash": "e1847839136a21eca4a5e3d9983e414a4cc25f314b870dc6c424dbeacdcb8b35",
98
98
  "typeScriptVersion": "5.2"
99
99
  }