@types/chrome 0.1.18 → 0.1.20

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 +38 -25
  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: Thu, 02 Oct 2025 06:39:55 GMT
11
+ * Last updated: Fri, 03 Oct 2025 06:02:16 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
@@ -10057,7 +10057,7 @@ declare namespace chrome {
10057
10057
  * Permissions: "system.cpu"
10058
10058
  */
10059
10059
  export namespace system.cpu {
10060
- export interface ProcessorUsage {
10060
+ export interface CpuTime {
10061
10061
  /** The cumulative time used by userspace programs on this processor. */
10062
10062
  user: number;
10063
10063
  /** The cumulative time used by kernel programs on this processor. */
@@ -10068,9 +10068,12 @@ declare namespace chrome {
10068
10068
  total: number;
10069
10069
  }
10070
10070
 
10071
+ /** @deprecated Use {@link CpuTime} instead. */
10072
+ interface ProcessorUsage extends CpuTime {}
10073
+
10071
10074
  export interface ProcessorInfo {
10072
10075
  /** Cumulative usage info for this logical processor. */
10073
- usage: ProcessorUsage;
10076
+ usage: CpuTime;
10074
10077
  }
10075
10078
 
10076
10079
  export interface CpuInfo {
@@ -10087,16 +10090,20 @@ declare namespace chrome {
10087
10090
  features: string[];
10088
10091
  /** Information about each logical processor. */
10089
10092
  processors: ProcessorInfo[];
10093
+ /**
10094
+ * List of CPU temperature readings from each thermal zone of the CPU. Temperatures are in degrees Celsius.
10095
+ * @since Chrome 60
10096
+ */
10097
+ temperatures: number[];
10090
10098
  }
10091
10099
 
10092
- /** Queries basic CPU information of the system. */
10093
- export function getInfo(callback: (info: CpuInfo) => void): void;
10094
-
10095
10100
  /**
10096
10101
  * Queries basic CPU information of the system.
10097
- * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
10102
+ *
10103
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
10098
10104
  */
10099
10105
  export function getInfo(): Promise<CpuInfo>;
10106
+ export function getInfo(callback: (info: CpuInfo) => void): void;
10100
10107
  }
10101
10108
 
10102
10109
  ////////////////////
@@ -10713,11 +10720,8 @@ declare namespace chrome {
10713
10720
  export interface CaptureInfo {
10714
10721
  /** The id of the tab whose status changed. */
10715
10722
  tabId: number;
10716
- /**
10717
- * The new capture status of the tab.
10718
- * One of: "pending", "active", "stopped", or "error"
10719
- */
10720
- status: string;
10723
+ /** The new capture status of the tab. */
10724
+ status: `${TabCaptureState}`;
10721
10725
  /** Whether an element in the tab being captured is in fullscreen mode. */
10722
10726
  fullscreen: boolean;
10723
10727
  }
@@ -10728,46 +10732,55 @@ declare namespace chrome {
10728
10732
  }
10729
10733
 
10730
10734
  export interface CaptureOptions {
10731
- /** Optional. */
10732
10735
  audio?: boolean | undefined;
10733
- /** Optional. */
10734
10736
  video?: boolean | undefined;
10735
- /** Optional. */
10736
10737
  audioConstraints?: MediaStreamConstraint | undefined;
10737
- /** Optional. */
10738
10738
  videoConstraints?: MediaStreamConstraint | undefined;
10739
10739
  }
10740
10740
 
10741
+ /** @since Chrome 71 */
10741
10742
  export interface GetMediaStreamOptions {
10742
- /** Optional tab id of the tab which will later invoke getUserMedia() to consume the stream. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches the consumber tab's origin. The tab's origin must be a secure origin, e.g. HTTPS. */
10743
+ /** Optional tab id of the tab which will later invoke `getUserMedia()` to consume the stream. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches the consumber tab's origin. The tab's origin must be a secure origin, e.g. HTTPS. */
10743
10744
  consumerTabId?: number | undefined;
10744
- /** Optional tab id of the tab which will be captured. If not specified then the current active tab will be selected. Only tabs for which the extension has been granted the activeTab permission can be used as the target tab. */
10745
+ /** Optional tab id of the tab which will be captured. If not specified then the current active tab will be selected. Only tabs for which the extension has been granted the `activeTab` permission can be used as the target tab. */
10745
10746
  targetTabId?: number | undefined;
10746
10747
  }
10747
10748
 
10748
- export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {}
10749
+ export enum TabCaptureState {
10750
+ PENDING = "pending",
10751
+ ACTIVE = "active",
10752
+ STOPPED = "stopped",
10753
+ ERROR = "error",
10754
+ }
10749
10755
 
10750
10756
  /**
10751
- * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension.
10757
+ * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked, similar to the way that activeTab works. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension.
10752
10758
  * @param options Configures the returned media stream.
10753
- * @param callback Callback with either the tab capture stream or null.
10754
10759
  */
10755
10760
  export function capture(options: CaptureOptions, callback: (stream: MediaStream | null) => void): void;
10761
+
10756
10762
  /**
10757
10763
  * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab).
10758
- * @param callback Callback invoked with CaptureInfo[] for captured tabs.
10764
+ *
10765
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
10759
10766
  */
10767
+ export function getCapturedTabs(): Promise<CaptureInfo[]>;
10760
10768
  export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void;
10761
10769
 
10762
10770
  /**
10763
10771
  * Creates a stream ID to capture the target tab. Similar to chrome.tabCapture.capture() method, but returns a media stream ID, instead of a media stream, to the consumer tab.
10764
- * @param options Options for the media stream id to retrieve.
10765
- * @param callback Callback to invoke with the result. If successful, the result is an opaque string that can be passed to the getUserMedia() API to generate a media stream that corresponds to the target tab. The created streamId can only be used once and expires after a few seconds if it is not used.
10772
+ *
10773
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
10766
10774
  */
10767
- export function getMediaStreamId(options: GetMediaStreamOptions, callback: (streamId: string) => void): void;
10775
+ export function getMediaStreamId(options?: GetMediaStreamOptions): Promise<string>;
10776
+ export function getMediaStreamId(callback: (streamId: string) => void): void;
10777
+ export function getMediaStreamId(
10778
+ options: GetMediaStreamOptions | undefined,
10779
+ callback: (streamId: string) => void,
10780
+ ): void;
10768
10781
 
10769
10782
  /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */
10770
- export var onStatusChanged: CaptureStatusChangedEvent;
10783
+ export const onStatusChanged: events.Event<(info: CaptureInfo) => void>;
10771
10784
  }
10772
10785
 
10773
10786
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
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": "29c78aebedd7b318174f7216589325a219bf672ea2647e846d05e9ab4bb3bf43",
97
+ "typesPublisherContentHash": "433cd27fa4711e2223cc598ccb6f0921c2fdadb29d28cee16f78c1f291cce217",
98
98
  "typeScriptVersion": "5.2"
99
99
  }