@types/chrome 0.1.19 → 0.1.21

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 +53 -31
  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 20:02:36 GMT
11
+ * Last updated: Fri, 03 Oct 2025 06:39:45 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
@@ -6900,22 +6900,38 @@ declare namespace chrome {
6900
6900
  * @since Chrome 78
6901
6901
  */
6902
6902
  export namespace loginState {
6903
- export interface SessionStateChangedEvent extends chrome.events.Event<(sessionState: SessionState) => void> {}
6904
-
6905
- /** Possible profile types. */
6906
- export type ProfileType = "SIGNIN_PROFILE" | "USER_PROFILE";
6903
+ export enum ProfileType {
6904
+ SIGNIN_PROFILE = "SIGNIN_PROFILE",
6905
+ USER_PROFILE = "USER_PROFILE",
6906
+ }
6907
6907
 
6908
- /** Possible session states. */
6909
- export type SessionState = "UNKNOWN" | "IN_OOBE_SCREEN" | "IN_LOGIN_SCREEN" | "IN_SESSION" | "IN_LOCK_SCREEN";
6908
+ export enum SessionState {
6909
+ UNKNOWN = "UNKNOWN",
6910
+ IN_OOBE_SCREEN = "IN_OOBE_SCREEN",
6911
+ IN_LOGIN_SCREEN = "IN_LOGIN_SCREEN",
6912
+ IN_SESSION = "IN_SESSION",
6913
+ IN_LOCK_SCREEN = "IN_LOCK_SCREEN",
6914
+ IN_RMA_SCREEN = "IN_RMA_SCREEN",
6915
+ }
6910
6916
 
6911
- /** Gets the type of the profile the extension is in. */
6912
- export function getProfileType(callback: (profileType: ProfileType) => void): void;
6917
+ /**
6918
+ * Gets the type of the profile the extension is in.
6919
+ *
6920
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6921
+ */
6922
+ export function getProfileType(): Promise<`${ProfileType}`>;
6923
+ export function getProfileType(callback: (result: `${ProfileType}`) => void): void;
6913
6924
 
6914
- /** Gets the current session state. */
6915
- export function getSessionState(callback: (sessionState: SessionState) => void): void;
6925
+ /**
6926
+ * Gets the current session state.
6927
+ *
6928
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
6929
+ */
6930
+ export function getSessionState(): Promise<`${SessionState}`>;
6931
+ export function getSessionState(callback: (sessionState: `${SessionState}`) => void): void;
6916
6932
 
6917
- /** Dispatched when the session state changes. sessionState is the new session state.*/
6918
- export const onSessionStateChanged: SessionStateChangedEvent;
6933
+ /** Dispatched when the session state changes. `sessionState` is the new session state.*/
6934
+ export const onSessionStateChanged: events.Event<(sessionState: `${SessionState}`) => void>;
6919
6935
  }
6920
6936
 
6921
6937
  ////////////////////
@@ -10720,11 +10736,8 @@ declare namespace chrome {
10720
10736
  export interface CaptureInfo {
10721
10737
  /** The id of the tab whose status changed. */
10722
10738
  tabId: number;
10723
- /**
10724
- * The new capture status of the tab.
10725
- * One of: "pending", "active", "stopped", or "error"
10726
- */
10727
- status: string;
10739
+ /** The new capture status of the tab. */
10740
+ status: `${TabCaptureState}`;
10728
10741
  /** Whether an element in the tab being captured is in fullscreen mode. */
10729
10742
  fullscreen: boolean;
10730
10743
  }
@@ -10735,46 +10748,55 @@ declare namespace chrome {
10735
10748
  }
10736
10749
 
10737
10750
  export interface CaptureOptions {
10738
- /** Optional. */
10739
10751
  audio?: boolean | undefined;
10740
- /** Optional. */
10741
10752
  video?: boolean | undefined;
10742
- /** Optional. */
10743
10753
  audioConstraints?: MediaStreamConstraint | undefined;
10744
- /** Optional. */
10745
10754
  videoConstraints?: MediaStreamConstraint | undefined;
10746
10755
  }
10747
10756
 
10757
+ /** @since Chrome 71 */
10748
10758
  export interface GetMediaStreamOptions {
10749
- /** 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. */
10759
+ /** 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. */
10750
10760
  consumerTabId?: number | undefined;
10751
- /** 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. */
10761
+ /** 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. */
10752
10762
  targetTabId?: number | undefined;
10753
10763
  }
10754
10764
 
10755
- export interface CaptureStatusChangedEvent extends chrome.events.Event<(info: CaptureInfo) => void> {}
10765
+ export enum TabCaptureState {
10766
+ PENDING = "pending",
10767
+ ACTIVE = "active",
10768
+ STOPPED = "stopped",
10769
+ ERROR = "error",
10770
+ }
10756
10771
 
10757
10772
  /**
10758
- * 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.
10773
+ * 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.
10759
10774
  * @param options Configures the returned media stream.
10760
- * @param callback Callback with either the tab capture stream or null.
10761
10775
  */
10762
10776
  export function capture(options: CaptureOptions, callback: (stream: MediaStream | null) => void): void;
10777
+
10763
10778
  /**
10764
10779
  * 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).
10765
- * @param callback Callback invoked with CaptureInfo[] for captured tabs.
10780
+ *
10781
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
10766
10782
  */
10783
+ export function getCapturedTabs(): Promise<CaptureInfo[]>;
10767
10784
  export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void;
10768
10785
 
10769
10786
  /**
10770
10787
  * 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.
10771
- * @param options Options for the media stream id to retrieve.
10772
- * @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.
10788
+ *
10789
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
10773
10790
  */
10774
- export function getMediaStreamId(options: GetMediaStreamOptions, callback: (streamId: string) => void): void;
10791
+ export function getMediaStreamId(options?: GetMediaStreamOptions): Promise<string>;
10792
+ export function getMediaStreamId(callback: (streamId: string) => void): void;
10793
+ export function getMediaStreamId(
10794
+ options: GetMediaStreamOptions | undefined,
10795
+ callback: (streamId: string) => void,
10796
+ ): void;
10775
10797
 
10776
10798
  /** 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. */
10777
- export var onStatusChanged: CaptureStatusChangedEvent;
10799
+ export const onStatusChanged: events.Event<(info: CaptureInfo) => void>;
10778
10800
  }
10779
10801
 
10780
10802
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
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": "a82926d5a4b7fddf359d40643638f66c3408efcef582bb042d95e2827cc75f8a",
97
+ "typesPublisherContentHash": "428112a1fe1e6c91a0d80daf37710dfb8d33374f33d46c605328323a5676a6dd",
98
98
  "typeScriptVersion": "5.2"
99
99
  }