@types/chrome 0.1.11 → 0.1.12
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 +84 -60
- 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: Tue, 16 Sep 2025 21:32:23 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
@@ -5815,46 +5815,81 @@ declare namespace chrome {
|
|
5815
5815
|
/** An object encapsulating one visit to a URL. */
|
5816
5816
|
export interface VisitItem {
|
5817
5817
|
/** The transition type for this visit from its referrer. */
|
5818
|
-
transition:
|
5819
|
-
/**
|
5820
|
-
|
5818
|
+
transition: `${TransitionType}`;
|
5819
|
+
/**
|
5820
|
+
* True if the visit originated on this device. False if it was synced from a different device
|
5821
|
+
* @since Chrome 115
|
5822
|
+
*/
|
5823
|
+
isLocal: boolean;
|
5824
|
+
/** When this visit occurred, represented in milliseconds since the epoch. */
|
5825
|
+
visitTime?: number;
|
5821
5826
|
/** The unique identifier for this visit. */
|
5822
5827
|
visitId: string;
|
5823
5828
|
/** The visit ID of the referrer. */
|
5824
5829
|
referringVisitId: string;
|
5825
|
-
/** The unique identifier for the
|
5830
|
+
/** The unique identifier for the corresponding {@link history.HistoryItem}. */
|
5826
5831
|
id: string;
|
5827
5832
|
}
|
5828
5833
|
|
5829
5834
|
/** An object encapsulating one result of a history query. */
|
5830
5835
|
export interface HistoryItem {
|
5831
|
-
/**
|
5832
|
-
typedCount?: number
|
5833
|
-
/**
|
5834
|
-
title?: string
|
5835
|
-
/**
|
5836
|
-
url?: string
|
5837
|
-
/**
|
5838
|
-
lastVisitTime?: number
|
5839
|
-
/**
|
5840
|
-
visitCount?: number
|
5836
|
+
/** The number of times the user has navigated to this page by typing in the address. */
|
5837
|
+
typedCount?: number;
|
5838
|
+
/** The title of the page when it was last loaded. */
|
5839
|
+
title?: string;
|
5840
|
+
/** The URL navigated to by a user. */
|
5841
|
+
url?: string;
|
5842
|
+
/** When this page was last loaded, represented in milliseconds since the epoch. */
|
5843
|
+
lastVisitTime?: number;
|
5844
|
+
/** The number of times the user has navigated to this page. */
|
5845
|
+
visitCount?: number;
|
5841
5846
|
/** The unique identifier for the item. */
|
5842
5847
|
id: string;
|
5843
5848
|
}
|
5844
5849
|
|
5850
|
+
/**
|
5851
|
+
* The transition type for this visit from its referrer.
|
5852
|
+
* @since Chrome 44
|
5853
|
+
*/
|
5854
|
+
export enum TransitionType {
|
5855
|
+
/** The user arrived at this page by clicking a link on another page. */
|
5856
|
+
LINK = "link",
|
5857
|
+
/** The user arrived at this page by typing the URL in the address bar. This is also used for other explicit navigation actions. */
|
5858
|
+
TYPED = "typed",
|
5859
|
+
/** The user arrived at this page through a suggestion in the UI, for example, through a menu item. */
|
5860
|
+
AUTO_BOOKMARK = "auto_bookmark",
|
5861
|
+
/** The user arrived at this page through subframe navigation that they didn't request, such as through an ad loading in a frame on the previous page. These don't always generate new navigation entries in the back and forward menus. */
|
5862
|
+
AUTO_SUBFRAME = "auto_subframe",
|
5863
|
+
/** The user arrived at this page by selecting something in a subframe. */
|
5864
|
+
MANUAL_SUBFRAME = "manual_subframe",
|
5865
|
+
/** The user arrived at this page by typing in the address bar and selecting an entry that didn't look like a URL, such as a Google Search suggestion. For example, a match might have the URL of a Google Search result page, but it might appear to the user as "Search Google for ...". These are different from typed navigations because the user didn't type or see the destination URL. They're also related to keyword navigations. */
|
5866
|
+
GENERATED = "generated",
|
5867
|
+
/** The page was specified in the command line or is the start page. */
|
5868
|
+
AUTO_TOPLEVEL = "auto_toplevel",
|
5869
|
+
/** The user arrived at this page by filling out values in a form and submitting the form. Not all form submissions use this transition type. */
|
5870
|
+
FORM_SUBMIT = "form_submit",
|
5871
|
+
/** The user reloaded the page, either by clicking the reload button or by pressing Enter in the address bar. Session restore and Reopen closed tab also use this transition type. */
|
5872
|
+
RELOAD = "reload",
|
5873
|
+
/** The URL for this page was generated from a replaceable keyword other than the default search provider. */
|
5874
|
+
KEYWORD = "keyword",
|
5875
|
+
/** Corresponds to a visit generated for a keyword. */
|
5876
|
+
KEYWORD_GENERATED = "keyword_generated",
|
5877
|
+
}
|
5878
|
+
|
5845
5879
|
export interface HistoryQuery {
|
5846
|
-
/** A free-text query to the history service. Leave empty to retrieve all pages. */
|
5880
|
+
/** A free-text query to the history service. Leave this empty to retrieve all pages. */
|
5847
5881
|
text: string;
|
5848
|
-
/**
|
5882
|
+
/** The maximum number of results to retrieve. Defaults to 100. */
|
5849
5883
|
maxResults?: number | undefined;
|
5850
|
-
/**
|
5884
|
+
/** Limit results to those visited after this date, represented in milliseconds since the epoch. If property is not specified, it will default to 24 hours. */
|
5851
5885
|
startTime?: number | undefined;
|
5852
|
-
/**
|
5886
|
+
/** Limit results to those visited before this date, represented in milliseconds since the epoch. */
|
5853
5887
|
endTime?: number | undefined;
|
5854
5888
|
}
|
5855
5889
|
|
5856
|
-
|
5857
|
-
|
5890
|
+
/** @since Chrome 88 */
|
5891
|
+
export interface UrlDetails {
|
5892
|
+
/** The URL for the operation. It must be in the format as returned from a call to {@link history.search}. */
|
5858
5893
|
url: string;
|
5859
5894
|
}
|
5860
5895
|
|
@@ -5868,73 +5903,62 @@ declare namespace chrome {
|
|
5868
5903
|
export interface RemovedResult {
|
5869
5904
|
/** True if all history was removed. If true, then urls will be empty. */
|
5870
5905
|
allHistory: boolean;
|
5871
|
-
|
5872
|
-
urls?: string[] | undefined;
|
5906
|
+
urls?: string[];
|
5873
5907
|
}
|
5874
5908
|
|
5875
|
-
export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}
|
5876
|
-
|
5877
|
-
export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}
|
5878
|
-
|
5879
5909
|
/**
|
5880
5910
|
* Searches the history for the last visit time of each page matching the query.
|
5881
|
-
*
|
5911
|
+
*
|
5912
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
5882
5913
|
*/
|
5883
5914
|
export function search(query: HistoryQuery): Promise<HistoryItem[]>;
|
5884
|
-
/**
|
5885
|
-
* Searches the history for the last visit time of each page matching the query.
|
5886
|
-
*/
|
5887
5915
|
export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
|
5916
|
+
|
5888
5917
|
/**
|
5889
5918
|
* Adds a URL to the history at the current time with a transition type of "link".
|
5890
|
-
*
|
5891
|
-
|
5892
|
-
export function addUrl(details: Url): Promise<void>;
|
5893
|
-
/**
|
5894
|
-
* Adds a URL to the history at the current time with a transition type of "link".
|
5919
|
+
*
|
5920
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
5895
5921
|
*/
|
5896
|
-
export function addUrl(details:
|
5922
|
+
export function addUrl(details: UrlDetails): Promise<void>;
|
5923
|
+
export function addUrl(details: UrlDetails, callback: () => void): void;
|
5924
|
+
|
5897
5925
|
/**
|
5898
5926
|
* Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
|
5899
|
-
*
|
5927
|
+
*
|
5928
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
5900
5929
|
*/
|
5901
5930
|
export function deleteRange(range: Range): Promise<void>;
|
5902
|
-
/**
|
5903
|
-
* Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
|
5904
|
-
*/
|
5905
5931
|
export function deleteRange(range: Range, callback: () => void): void;
|
5932
|
+
|
5906
5933
|
/**
|
5907
5934
|
* Deletes all items from the history.
|
5908
|
-
*
|
5935
|
+
*
|
5936
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
5909
5937
|
*/
|
5910
5938
|
export function deleteAll(): Promise<void>;
|
5911
|
-
/**
|
5912
|
-
* Deletes all items from the history.
|
5913
|
-
*/
|
5914
5939
|
export function deleteAll(callback: () => void): void;
|
5940
|
+
|
5915
5941
|
/**
|
5916
5942
|
* Retrieves information about visits to a URL.
|
5917
|
-
*
|
5918
|
-
|
5919
|
-
export function getVisits(details: Url): Promise<VisitItem[]>;
|
5920
|
-
/**
|
5921
|
-
* Retrieves information about visits to a URL.
|
5922
|
-
*/
|
5923
|
-
export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
|
5924
|
-
/**
|
5925
|
-
* Removes all occurrences of the given URL from the history.
|
5926
|
-
* @return The `deleteUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
|
5943
|
+
*
|
5944
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
5927
5945
|
*/
|
5928
|
-
export function
|
5946
|
+
export function getVisits(details: UrlDetails): Promise<VisitItem[]>;
|
5947
|
+
export function getVisits(details: UrlDetails, callback: (results: VisitItem[]) => void): void;
|
5948
|
+
|
5929
5949
|
/**
|
5930
5950
|
* Removes all occurrences of the given URL from the history.
|
5951
|
+
*
|
5952
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
5931
5953
|
*/
|
5932
|
-
export function deleteUrl(details:
|
5954
|
+
export function deleteUrl(details: UrlDetails): Promise<void>;
|
5955
|
+
export function deleteUrl(details: UrlDetails, callback: () => void): void;
|
5956
|
+
|
5957
|
+
/** Fired when a URL is visited, providing the {@link HistoryItem} data for that URL. This event fires before the page has loaded. */
|
5958
|
+
export const onVisited: events.Event<(result: HistoryItem) => void>;
|
5933
5959
|
|
5934
|
-
/** Fired when
|
5935
|
-
export
|
5936
|
-
/** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */
|
5937
|
-
export var onVisitRemoved: HistoryVisitRemovedEvent;
|
5960
|
+
/** Fired when one or more URLs are removed from history. When all visits have been removed the URL is purged from history. */
|
5961
|
+
export const onVisitRemoved: events.Event<(removed: RemovedResult) => void>;
|
5938
5962
|
}
|
5939
5963
|
|
5940
5964
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.12",
|
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": "4be2065e800c9158a9e20019cc5cf220ee67551b642b4dcef5ea7cd2751cf4a9",
|
98
98
|
"typeScriptVersion": "5.2"
|
99
99
|
}
|