@types/chrome 0.1.15 → 0.1.16

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 +36 -88
  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: Tue, 30 Sep 2025 18:02:49 GMT
11
+ * Last updated: Tue, 30 Sep 2025 21:32:35 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
@@ -7587,15 +7587,11 @@ declare namespace chrome {
7587
7587
 
7588
7588
  /**
7589
7589
  * Saves the content of the tab with given id as MHTML.
7590
- * @param callback Called when the MHTML has been generated.
7591
- * Parameter mhtmlData: The MHTML data as a Blob.
7592
- */
7593
- export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
7594
- /**
7595
- * Saves the content of the tab with given id as MHTML.
7596
- * @since Chrome 116 MV3
7590
+ *
7591
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
7597
7592
  */
7598
7593
  export function saveAsMHTML(details: SaveDetails): Promise<Blob | undefined>;
7594
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
7599
7595
  }
7600
7596
 
7601
7597
  ////////////////////
@@ -8503,57 +8499,48 @@ declare namespace chrome {
8503
8499
 
8504
8500
  /**
8505
8501
  * Adds an entry to the reading list if it does not exist.
8506
- * @since Chrome 120, MV3
8502
+ *
8503
+ * Can return its result via Promise.
8507
8504
  * @param entry The entry to add to the reading list.
8508
- * @param callback
8509
8505
  */
8510
8506
  export function addEntry(entry: AddEntryOptions): Promise<void>;
8511
8507
  export function addEntry(entry: AddEntryOptions, callback: () => void): void;
8512
8508
 
8513
8509
  /**
8514
8510
  * Retrieves all entries that match the `QueryInfo` properties. Properties that are not provided will not be matched.
8515
- * @since Chrome 120, MV3
8511
+ *
8512
+ * Can return its result via Promise.
8516
8513
  * @param info The properties to search for.
8517
- * @param callback
8518
8514
  */
8519
8515
  export function query(info: QueryInfo): Promise<ReadingListEntry[]>;
8520
8516
  export function query(info: QueryInfo, callback: (entries: ReadingListEntry[]) => void): void;
8521
8517
 
8522
8518
  /**
8523
8519
  * Removes an entry from the reading list if it exists.
8524
- * @since Chrome 120, MV3
8520
+ *
8521
+ * Can return its result via Promise.
8525
8522
  * @param info The entry to remove from the reading list.
8526
- * @param callback
8527
8523
  */
8528
8524
  export function removeEntry(info: RemoveOptions): Promise<void>;
8529
8525
  export function removeEntry(info: RemoveOptions, callback: () => void): void;
8530
8526
 
8531
8527
  /**
8532
8528
  * Updates a reading list entry if it exists.
8533
- * @since Chrome 120, MV3
8529
+ *
8530
+ * Can return its result via Promise.
8534
8531
  * @param info The entry to update.
8535
- * @param callback
8536
8532
  */
8537
8533
  export function updateEntry(info: UpdateEntryOptions): Promise<void>;
8538
8534
  export function updateEntry(info: UpdateEntryOptions, callback: () => void): void;
8539
8535
 
8540
- /**
8541
- * Triggered when a ReadingListEntry is added to the reading list.
8542
- * @since Chrome 120, MV3
8543
- */
8544
- export const onEntryAdded: chrome.events.Event<(entry: ReadingListEntry) => void>;
8536
+ /** Triggered when a `ReadingListEntry` is added to the reading list. */
8537
+ export const onEntryAdded: events.Event<(entry: ReadingListEntry) => void>;
8545
8538
 
8546
- /**
8547
- * Triggered when a ReadingListEntry is removed from the reading list.
8548
- * @since Chrome 120, MV3
8549
- */
8550
- export const onEntryRemoved: chrome.events.Event<(entry: ReadingListEntry) => void>;
8539
+ /** Triggered when a `ReadingListEntry` is removed from the reading list. */
8540
+ export const onEntryRemoved: events.Event<(entry: ReadingListEntry) => void>;
8551
8541
 
8552
- /**
8553
- * Triggered when a ReadingListEntry is updated in the reading list.
8554
- * @since Chrome 120, MV3
8555
- */
8556
- export const onEntryUpdated: chrome.events.Event<(entry: ReadingListEntry) => void>;
8542
+ /** Triggered when a `ReadingListEntry` is updated in the reading list. */
8543
+ export const onEntryUpdated: events.Event<(entry: ReadingListEntry) => void>;
8557
8544
  }
8558
8545
 
8559
8546
  ////////////////////
@@ -9738,25 +9725,16 @@ declare namespace chrome {
9738
9725
  */
9739
9726
  export namespace sessions {
9740
9727
  export interface Filter {
9741
- /**
9742
- * Optional.
9743
- * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS).
9744
- */
9728
+ /** The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ({@link sessions.MAX_SESSION_RESULTS}). */
9745
9729
  maxResults?: number | undefined;
9746
9730
  }
9747
9731
 
9748
9732
  export interface Session {
9749
9733
  /** The time when the window or tab was closed or modified, represented in seconds since the epoch. */
9750
9734
  lastModified: number;
9751
- /**
9752
- * Optional.
9753
- * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set.
9754
- */
9735
+ /** The {@link tabs.Tab}, if this entry describes a tab. Either this or {@link sessions.Session.window} will be set. */
9755
9736
  tab?: tabs.Tab | undefined;
9756
- /**
9757
- * Optional.
9758
- * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set.
9759
- */
9737
+ /** The {@link windows.Window}, if this entry describes a window. Either this or {@link sessions.Session.tab} will be set. */
9760
9738
  window?: windows.Window | undefined;
9761
9739
  }
9762
9740
 
@@ -9767,69 +9745,39 @@ declare namespace chrome {
9767
9745
  sessions: Session[];
9768
9746
  }
9769
9747
 
9770
- export interface SessionChangedEvent extends chrome.events.Event<() => void> {}
9771
-
9772
- /** The maximum number of sessions.Session that will be included in a requested list. */
9773
- export var MAX_SESSION_RESULTS: number;
9748
+ /** The maximum number of {@link sessions.Session} that will be included in a requested list. */
9749
+ export const MAX_SESSION_RESULTS: 25;
9774
9750
 
9775
9751
  /**
9776
9752
  * Gets the list of recently closed tabs and/or windows.
9777
- * @return The `getRecentlyClosed` method provides its result via callback or returned as a `Promise` (MV3 only).
9753
+ *
9754
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
9778
9755
  */
9779
9756
  export function getRecentlyClosed(filter?: Filter): Promise<Session[]>;
9780
- /**
9781
- * Gets the list of recently closed tabs and/or windows.
9782
- * @param callback
9783
- * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
9784
- */
9785
- export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void;
9786
- /**
9787
- * Gets the list of recently closed tabs and/or windows.
9788
- * @param callback
9789
- * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows.
9790
- */
9791
9757
  export function getRecentlyClosed(callback: (sessions: Session[]) => void): void;
9758
+ export function getRecentlyClosed(filter: Filter | undefined, callback: (sessions: Session[]) => void): void;
9759
+
9792
9760
  /**
9793
9761
  * Retrieves all devices with synced sessions.
9794
- * @return The `getDevices` method provides its result via callback or returned as a `Promise` (MV3 only).
9762
+ *
9763
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
9795
9764
  */
9796
9765
  export function getDevices(filter?: Filter): Promise<Device[]>;
9797
- /**
9798
- * Retrieves all devices with synced sessions.
9799
- * @param callback
9800
- * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
9801
- */
9802
- export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void;
9803
- /**
9804
- * Retrieves all devices with synced sessions.
9805
- * @param callback
9806
- * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects.
9807
- */
9808
9766
  export function getDevices(callback: (devices: Device[]) => void): void;
9767
+ export function getDevices(filter: Filter | undefined, callback: (devices: Device[]) => void): void;
9768
+
9809
9769
  /**
9810
- * Reopens a windows.Window or tabs.Tab.
9811
- * @param sessionId Optional.
9812
- * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
9813
- * @return The `restore` method provides its result via callback or returned as a `Promise` (MV3 only).
9770
+ * Reopens a {@link windows.Window} or {@link tabs.Tab}, with an optional callback to run when the entry has been restored.
9771
+ *
9772
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
9773
+ * @param sessionId The {@link windows.Window.sessionId}, or {@link tabs.Tab.sessionId} to restore. If this parameter is not specified, the most recently closed session is restored.
9814
9774
  */
9815
9775
  export function restore(sessionId?: string): Promise<Session>;
9816
- /**
9817
- * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
9818
- * @param sessionId Optional.
9819
- * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored.
9820
- * @param callback Optional.
9821
- * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
9822
- */
9823
- export function restore(sessionId: string, callback: (restoredSession: Session) => void): void;
9824
- /**
9825
- * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored.
9826
- * @param callback Optional.
9827
- * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object.
9828
- */
9829
9776
  export function restore(callback: (restoredSession: Session) => void): void;
9777
+ export function restore(sessionId: string | undefined, callback: (restoredSession: Session) => void): void;
9830
9778
 
9831
9779
  /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */
9832
- export var onChanged: SessionChangedEvent;
9780
+ export const onChanged: events.Event<() => void>;
9833
9781
  }
9834
9782
 
9835
9783
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
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": "764f93eaa7f8d4f7669f091cdfd73ad4db83ad84cfed3c9220152a9a35030761",
97
+ "typesPublisherContentHash": "3cb748894519c88fdf8bbd53c9b88cde0db71bd0e3a5becf92e9e47bbb21bd6c",
98
98
  "typeScriptVersion": "5.2"
99
99
  }