Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions notNeededPackages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4333,6 +4333,10 @@
"libraryName": "metascraper-video",
"asOfVersion": "5.42.0"
},
"react-window": {
"libraryName": "react-window-infinite-loader",
"asOfVersion": "2.0.0"
},
"metascraper-youtube": {
"libraryName": "metascraper-youtube",
"asOfVersion": "5.42.0"
Expand Down Expand Up @@ -6471,6 +6475,10 @@
"libraryName": "react-widgets",
"asOfVersion": "5.0.0"
},
"react-window": {
"libraryName": "react-window",
"asOfVersion": "2.0.0"
},
"react-youtube": {
"libraryName": "react-youtube",
"asOfVersion": "7.10.0"
Expand Down Expand Up @@ -7839,6 +7847,10 @@
"libraryName": "username",
"asOfVersion": "5.0.0"
},
"uuid": {
"libraryName": "uuid",
"asOfVersion": "11.0.0"
},
"uuid-apikey": {
"libraryName": "uuid-apikey",
"asOfVersion": "1.5.0"
Expand Down
144 changes: 84 additions & 60 deletions types/chrome/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5815,46 +5815,81 @@ declare namespace chrome {
/** An object encapsulating one visit to a URL. */
export interface VisitItem {
/** The transition type for this visit from its referrer. */
transition: string;
/** Optional. When this visit occurred, represented in milliseconds since the epoch. */
visitTime?: number | undefined;
transition: `${TransitionType}`;
/**
* True if the visit originated on this device. False if it was synced from a different device
* @since Chrome 115
*/
isLocal: boolean;
/** When this visit occurred, represented in milliseconds since the epoch. */
visitTime?: number;
/** The unique identifier for this visit. */
visitId: string;
/** The visit ID of the referrer. */
referringVisitId: string;
/** The unique identifier for the item. */
/** The unique identifier for the corresponding {@link history.HistoryItem}. */
id: string;
}

/** An object encapsulating one result of a history query. */
export interface HistoryItem {
/** Optional. The number of times the user has navigated to this page by typing in the address. */
typedCount?: number | undefined;
/** Optional. The title of the page when it was last loaded. */
title?: string | undefined;
/** Optional. The URL navigated to by a user. */
url?: string | undefined;
/** Optional. When this page was last loaded, represented in milliseconds since the epoch. */
lastVisitTime?: number | undefined;
/** Optional. The number of times the user has navigated to this page. */
visitCount?: number | undefined;
/** The number of times the user has navigated to this page by typing in the address. */
typedCount?: number;
/** The title of the page when it was last loaded. */
title?: string;
/** The URL navigated to by a user. */
url?: string;
/** When this page was last loaded, represented in milliseconds since the epoch. */
lastVisitTime?: number;
/** The number of times the user has navigated to this page. */
visitCount?: number;
/** The unique identifier for the item. */
id: string;
}

/**
* The transition type for this visit from its referrer.
* @since Chrome 44
*/
export enum TransitionType {
/** The user arrived at this page by clicking a link on another page. */
LINK = "link",
/** The user arrived at this page by typing the URL in the address bar. This is also used for other explicit navigation actions. */
TYPED = "typed",
/** The user arrived at this page through a suggestion in the UI, for example, through a menu item. */
AUTO_BOOKMARK = "auto_bookmark",
/** 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. */
AUTO_SUBFRAME = "auto_subframe",
/** The user arrived at this page by selecting something in a subframe. */
MANUAL_SUBFRAME = "manual_subframe",
/** 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. */
GENERATED = "generated",
/** The page was specified in the command line or is the start page. */
AUTO_TOPLEVEL = "auto_toplevel",
/** 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. */
FORM_SUBMIT = "form_submit",
/** 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. */
RELOAD = "reload",
/** The URL for this page was generated from a replaceable keyword other than the default search provider. */
KEYWORD = "keyword",
/** Corresponds to a visit generated for a keyword. */
KEYWORD_GENERATED = "keyword_generated",
}

export interface HistoryQuery {
/** A free-text query to the history service. Leave empty to retrieve all pages. */
/** A free-text query to the history service. Leave this empty to retrieve all pages. */
text: string;
/** Optional. The maximum number of results to retrieve. Defaults to 100. */
/** The maximum number of results to retrieve. Defaults to 100. */
maxResults?: number | undefined;
/** Optional. Limit results to those visited after this date, represented in milliseconds since the epoch. */
/** 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. */
startTime?: number | undefined;
/** Optional. Limit results to those visited before this date, represented in milliseconds since the epoch. */
/** Limit results to those visited before this date, represented in milliseconds since the epoch. */
endTime?: number | undefined;
}

export interface Url {
/** The URL for the operation. It must be in the format as returned from a call to history.search. */
/** @since Chrome 88 */
export interface UrlDetails {
/** The URL for the operation. It must be in the format as returned from a call to {@link history.search}. */
url: string;
}

Expand All @@ -5868,73 +5903,62 @@ declare namespace chrome {
export interface RemovedResult {
/** True if all history was removed. If true, then urls will be empty. */
allHistory: boolean;
/** Optional. */
urls?: string[] | undefined;
urls?: string[];
}

export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}

export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}

/**
* Searches the history for the last visit time of each page matching the query.
* @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only).
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function search(query: HistoryQuery): Promise<HistoryItem[]>;
/**
* Searches the history for the last visit time of each page matching the query.
*/
export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;

/**
* Adds a URL to the history at the current time with a transition type of "link".
* @return The `addUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*/
export function addUrl(details: Url): Promise<void>;
/**
* Adds a URL to the history at the current time with a transition type of "link".
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function addUrl(details: Url, callback: () => void): void;
export function addUrl(details: UrlDetails): Promise<void>;
export function addUrl(details: UrlDetails, callback: () => void): void;

/**
* 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.
* @return The `deleteRange` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function deleteRange(range: Range): Promise<void>;
/**
* 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.
*/
export function deleteRange(range: Range, callback: () => void): void;

/**
* Deletes all items from the history.
* @return The `deleteAll` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function deleteAll(): Promise<void>;
/**
* Deletes all items from the history.
*/
export function deleteAll(callback: () => void): void;

/**
* Retrieves information about visits to a URL.
* @return The `getVisits` method provides its result via callback or returned as a `Promise` (MV3 only).
*/
export function getVisits(details: Url): Promise<VisitItem[]>;
/**
* Retrieves information about visits to a URL.
*/
export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
/**
* Removes all occurrences of the given URL from the history.
* @return The `deleteUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function deleteUrl(details: Url): Promise<void>;
export function getVisits(details: UrlDetails): Promise<VisitItem[]>;
export function getVisits(details: UrlDetails, callback: (results: VisitItem[]) => void): void;

/**
* Removes all occurrences of the given URL from the history.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function deleteUrl(details: Url, callback: () => void): void;
export function deleteUrl(details: UrlDetails): Promise<void>;
export function deleteUrl(details: UrlDetails, callback: () => void): void;

/** Fired when a URL is visited, providing the {@link HistoryItem} data for that URL. This event fires before the page has loaded. */
export const onVisited: events.Event<(result: HistoryItem) => void>;

/** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */
export var onVisited: HistoryVisitedEvent;
/** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */
export var onVisitRemoved: HistoryVisitRemovedEvent;
/** Fired when one or more URLs are removed from history. When all visits have been removed the URL is purged from history. */
export const onVisitRemoved: events.Event<(removed: RemovedResult) => void>;
}

////////////////////
Expand Down
96 changes: 77 additions & 19 deletions types/chrome/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4806,30 +4806,88 @@ function testGcm() {
});
}

// https://developer.chrome.com/docs/extensions/reference/history
// https://developer.chrome.com/docs/extensions/reference/api/history
function testHistory() {
chrome.history.TransitionType.AUTO_BOOKMARK === "auto_bookmark";
chrome.history.TransitionType.AUTO_SUBFRAME === "auto_subframe";
chrome.history.TransitionType.AUTO_TOPLEVEL === "auto_toplevel";
chrome.history.TransitionType.FORM_SUBMIT === "form_submit";
chrome.history.TransitionType.GENERATED === "generated";
chrome.history.TransitionType.KEYWORD === "keyword";
chrome.history.TransitionType.KEYWORD_GENERATED === "keyword_generated";
chrome.history.TransitionType.LINK === "link";
chrome.history.TransitionType.MANUAL_SUBFRAME === "manual_subframe";
chrome.history.TransitionType.RELOAD === "reload";
chrome.history.TransitionType.TYPED === "typed";

const urlDetails: chrome.history.UrlDetails = {
url: "https://example.com",
};

chrome.history.addUrl(urlDetails); // $ExpectType Promise<void>
chrome.history.addUrl(urlDetails, () => void 0); // $ExpectType void
// @ts-expect-error
chrome.history.search({}, (results) => {});
chrome.history.search({ text: "" }, (results) => {});
chrome.history.addUrl(urlDetails, () => {}).then(() => {});

chrome.history.deleteAll(); // $ExpectType Promise<void>
chrome.history.deleteAll(() => void 0); // $ExpectType void
// @ts-expect-error
chrome.history.deleteAll(() => {}).then(() => {});

const range: chrome.history.Range = {
endTime: new Date().getTime(),
startTime: new Date().getTime(),
};

chrome.history.deleteRange(range); // $ExpectType Promise<void>
chrome.history.deleteRange(range, () => void 0); // $ExpectType void
// @ts-expect-error
chrome.history.addUrl({}, () => {});
chrome.history.addUrl({ url: "https://example.com" }, () => {});
chrome.history.deleteRange(range, () => {}).then(() => {});

chrome.history.deleteUrl(urlDetails); // $ExpectType Promise<void>
chrome.history.deleteUrl(urlDetails, () => void 0); // $ExpectType void
// @ts-expect-error
chrome.history.deleteRange({}, () => {});
chrome.history.deleteRange({ startTime: 1646172000000, endTime: 1646258400000 }, () => {});
chrome.history.deleteAll(() => {});
chrome.history.deleteUrl({ url: "https://example.com" }, () => {});
chrome.history.getVisits({ url: "https://example.com" }, () => {});
}
chrome.history.deleteUrl(urlDetails, () => {}).then(() => {});

chrome.history.getVisits(urlDetails); // $ExpectType Promise<VisitItem[]>
chrome.history.getVisits(urlDetails, ([result]) => { // $ExpectType void
result.id; // $ExpectType string
result.isLocal; // $ExpectType boolean
result.referringVisitId; // $ExpectType string
result.transition; // $ExpectType "link" | "typed" | "auto_bookmark" | "auto_subframe" | "manual_subframe" | "generated" | "auto_toplevel" | "form_submit" | "reload" | "keyword" | "keyword_generated"
result.visitId; // $ExpectType string
result.visitTime; // $ExpectType number | undefined
});
// @ts-expect-error
chrome.history.getVisits(urlDetails, () => {}).then(() => {});

const query: chrome.history.HistoryQuery = {
endTime: new Date().getTime(),
maxResults: 2,
startTime: new Date().getTime(),
text: "example",
};

chrome.history.search(query); // $ExpectType Promise<HistoryItem[]>
chrome.history.search(query, ([result]) => { // $ExpectType void
result.id; // $ExpectType string
result.lastVisitTime; // $ExpectType number | undefined
result.title; // $ExpectType string | undefined
result.typedCount; // $ExpectType number | undefined
result.url; // $ExpectType string | undefined
result.visitCount; // $ExpectType number | undefined
});
// @ts-expect-error
chrome.history.search(query, () => {}).then(() => {});

// https://developer.chrome.com/docs/extensions/reference/history
async function testHistoryForPromise() {
await chrome.history.search({ text: "" });
await chrome.history.addUrl({ url: "https://example.com" });
await chrome.history.deleteRange({ startTime: 1646172000000, endTime: 1646258400000 });
await chrome.history.deleteAll();
await chrome.history.deleteUrl({ url: "https://example.com" });
await chrome.history.getVisits({ url: "https://example.com" });
checkChromeEvent(chrome.history.onVisited, (result) => {
result; // $ExpectType HistoryItem
});

checkChromeEvent(chrome.history.onVisitRemoved, (result) => {
result.allHistory; // $ExpectType boolean
result.urls; // $ExpectType string[] | undefined
});
}

// https://developer.chrome.com/docs/extensions/reference/api/identity
Expand Down
16 changes: 13 additions & 3 deletions types/dockerode/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ declare namespace Dockerode {
get(callback: Callback<NodeJS.ReadableStream>): void;
get(): Promise<NodeJS.ReadableStream>;

push(options: ImagePushOptions, callback: Callback<NodeJS.ReadableStream>): void;
push(callback: Callback<NodeJS.ReadableStream>): void;
push(options: ImagePushOptions, callback: Callback<NodeJS.ReadableStream>, auth?: AuthConfig): void;
push(callback: Callback<NodeJS.ReadableStream>, auth?: AuthConfig): void;
push(options?: ImagePushOptions): Promise<NodeJS.ReadableStream>;
push(options?: ImagePushOptions, callback?: undefined, auth?: AuthConfig): Promise<NodeJS.ReadableStream>;

tag(options: ImageTagOptions, callback: Callback<any>): void;
tag(callback: Callback<any>): void;
Expand Down Expand Up @@ -1134,6 +1135,7 @@ declare namespace Dockerode {
tag?: string | undefined;
authconfig?: AuthConfig | undefined;
abortSignal?: AbortSignal;
stream?: boolean | undefined;
}

interface ImageTagOptions {
Expand All @@ -1148,7 +1150,13 @@ declare namespace Dockerode {
tag?: string;
}

interface AuthConfig {
interface AuthConfigKey {
key: string;
}
interface AuthConfigBase64 {
base64: string;
}
interface AuthConfigObject {
username?: string;
password?: string;
auth?: string;
Expand All @@ -1159,6 +1167,8 @@ declare namespace Dockerode {
email?: string | undefined;
}

type AuthConfig = AuthConfigKey | AuthConfigBase64 | AuthConfigObject;

interface RegistryConfig {
[registryAddress: string]: {
username: string;
Expand Down
2 changes: 1 addition & 1 deletion types/node/http.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ declare module "http" {
createConnection(
options: ClientRequestArgs,
callback?: (err: Error | null, stream: stream.Duplex) => void,
): stream.Duplex;
): stream.Duplex | null | undefined;
/**
* Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
*
Expand Down
Loading