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
2 changes: 1 addition & 1 deletion .github/actions/setup-for-scripts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Set up repo for running scripts
runs:
using: composite
steps:
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '20'
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# Need this to be able to inquire about origin/master
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '20'

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
# Need this to be able to inquire about origin/master
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '20'

Expand All @@ -87,7 +87,7 @@ jobs:
echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Restore pnpm cache
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
uses: actions/cache/restore@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-and-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
id: date
run: echo "date=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT

- uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
- uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
# dprint caches info about the files in the repo to skip formatting them.
# However, since package.json and .dprint.jsonc don't change very often,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pnpm-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: ${{ github.repository == 'DefinitelyTyped/DefinitelyTyped' }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: '20'
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
Expand All @@ -27,7 +27,7 @@ jobs:
run: pnpm install

- name: Save pnpm cache
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
uses: actions/cache/save@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
path: ${{ steps.pnpm-cache.outputs.store }}
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.pnpm-cache.outputs.date }}
46 changes: 44 additions & 2 deletions types/chrome/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ declare namespace chrome {
cookies?: boolean | undefined;
/**
* Stored passwords.
* @deprecated Support for password deletion through extensions has been removed. This data type will be ignored.
* @deprecated since Chrome 144. Support for password deletion through extensions has been removed. This data type will be ignored.
*/
passwords?: boolean | undefined;
/**
Expand Down Expand Up @@ -1125,7 +1125,7 @@ declare namespace chrome {
* Clears the browser's stored passwords.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @deprecated Support for password deletion through extensions has been removed. This function has no effect.
* @deprecated since Chrome 144. Support for password deletion through extensions has been removed. This function has no effect.
*/
export function removePasswords(options: RemovalOptions): Promise<void>;
export function removePasswords(options: RemovalOptions, callback: () => void): void;
Expand Down Expand Up @@ -3779,6 +3779,8 @@ declare namespace chrome {
BLOCKED_SCAN_FAILED = "blockedScanFailed",
/** For use by the Secure Enterprise Browser extension. When required, Chrome will block the download to disc and download the file directly to Google Drive. */
FORCE_SAVE_TO_GDRIVE = "forceSaveToGdrive",
/** For use by the Secure Enterprise Browser extension. When required, Chrome will block the download to disc and download the file directly to OneDrive. */
FORCE_SAVE_TO_ONEDRIVE = "forceSaveToOnedrive",
}

export interface DownloadItem {
Expand Down Expand Up @@ -13085,6 +13087,10 @@ declare namespace chrome {
EXTRA_HEADERS = "extraHeaders",
/** Specifies that the response headers should be included in the event. */
RESPONSE_HEADERS = "responseHeaders",
/** Specifies that the SecurityInfo should be included in the event. */
SECURITY_INFO = "securityInfo",
/** Specifies that the SecurityInfo with raw bytes of certificates should be included in the event. */
SECURITY_INFO_RAW_DER = "securityInfoRawDer",
}

/** @since Chrome 44 */
Expand Down Expand Up @@ -13145,6 +13151,23 @@ declare namespace chrome {
OTHER = "other",
}

/** @since Chrome 144 */
export interface SecurityInfo {
/** A list of certificates */
certificates: {
/** Fingerprints of the certificate. */
fingerprint: {
/** sha256 fingerprint of the certificate. */
sha256: string;
};
/** Raw bytes of DER encoded server certificate */
rawDER?: ArrayBuffer;
}[];

/** State of the connection. One of secure, insecure, broken. */
state: string;
}

/** Contains data uploaded in a URL request. */
export interface UploadData {
/** An ArrayBuffer with a copy of the data. */
Expand Down Expand Up @@ -13282,6 +13305,11 @@ declare namespace chrome {
export interface OnHeadersReceivedDetails extends WebRequestDetails {
/** The HTTP response headers that have been received with this response. */
responseHeaders?: HttpHeader[];
/**
* Information about the TLS/QUIC connection used for the underlying connection. Only provided if `securityInfo` is specified in the `extraInfoSpec` parameter.
* @since Chrome 144
*/
securityInfo?: SecurityInfo;
/** Standard HTTP status code returned by the server. */
statusCode: number;
/** HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers.*/
Expand Down Expand Up @@ -14541,6 +14569,14 @@ declare namespace chrome {
default_path: string;
}

/**
* Closes the extension's side panel. This is a no-op if the panel is already closed.
* @param options Specifies the context in which to close the side panel.
* @since Chrome 141
*/
export function close(options: CloseOptions): Promise<void>;
export function close(options: CloseOptions, callback: () => void): void;

/**
* Returns the side panel's current layout.
* @since Chrome 140
Expand Down Expand Up @@ -14593,6 +14629,12 @@ declare namespace chrome {
export function setPanelBehavior(behavior: PanelBehavior): Promise<void>;
export function setPanelBehavior(behavior: PanelBehavior, callback: () => void): void;

/**
* Fired when the extension's side panel is closed.
* @since Chrome 142
*/
const onClosed: events.Event<(info: PanelClosedInfo) => void>;

/**
* Fired when the extension's side panel is opened.
* @since Chrome 141
Expand Down
26 changes: 24 additions & 2 deletions types/chrome/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4920,6 +4920,7 @@ function testDownloads() {
chrome.downloads.DangerType.DEEP_SCANNED_SAFE === "deepScannedSafe";
chrome.downloads.DangerType.FILE === "file";
chrome.downloads.DangerType.FORCE_SAVE_TO_GDRIVE === "forceSaveToGdrive";
chrome.downloads.DangerType.FORCE_SAVE_TO_ONEDRIVE === "forceSaveToOnedrive";
chrome.downloads.DangerType.HOST === "host";
chrome.downloads.DangerType.PASSWORD_PROTECTED === "passwordProtected";
chrome.downloads.DangerType.PROMPT_FOR_LOCAL_PASSWORD_SCANNING === "promptForLocalPasswordScanning";
Expand Down Expand Up @@ -5080,7 +5081,7 @@ function testDownloads() {
result.byExtensionName; // $ExpectType string | undefined
result.bytesReceived; // $ExpectType number
result.canResume; // $ExpectType boolean
result.danger; // $ExpectType "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted" | "allowlistedByPolicy" | "asyncScanning" | "asyncLocalPasswordScanning" | "passwordProtected" | "blockedTooLarge" | "sensitiveContentWarning" | "sensitiveContentBlock" | "deepScannedFailed" | "deepScannedSafe" | "deepScannedOpenedDangerous" | "promptForScanning" | "promptForLocalPasswordScanning" | "accountCompromise" | "blockedScanFailed" | "forceSaveToGdrive"
result.danger; // $ExpectType "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted" | "allowlistedByPolicy" | "asyncScanning" | "asyncLocalPasswordScanning" | "passwordProtected" | "blockedTooLarge" | "sensitiveContentWarning" | "sensitiveContentBlock" | "deepScannedFailed" | "deepScannedSafe" | "deepScannedOpenedDangerous" | "promptForScanning" | "promptForLocalPasswordScanning" | "accountCompromise" | "blockedScanFailed" | "forceSaveToGdrive" | "forceSaveToOnedrive"
result.endTime; // $ExpectType string | undefined
result.error; // $ExpectType "CRASH" | "FILE_ACCESS_DENIED" | "FILE_BLOCKED" | "FILE_FAILED" | "FILE_HASH_MISMATCH" | "FILE_NAME_TOO_LONG" | "FILE_NO_SPACE" | "FILE_SAME_AS_SOURCE" | "FILE_SECURITY_CHECK_FAILED" | "FILE_TOO_LARGE" | "FILE_TOO_SHORT" | "FILE_TRANSIENT_ERROR" | "FILE_VIRUS_INFECTED" | "NETWORK_DISCONNECTED" | "NETWORK_FAILED" | "NETWORK_INVALID_REQUEST" | "NETWORK_SERVER_DOWN" | "NETWORK_TIMEOUT" | "SERVER_BAD_CONTENT" | "SERVER_CERT_PROBLEM" | "SERVER_CONTENT_LENGTH_MISMATCH" | "SERVER_CROSS_ORIGIN_REDIRECT" | "SERVER_FAILED" | "SERVER_FORBIDDEN" | "SERVER_NO_RANGE" | "SERVER_UNAUTHORIZED" | "SERVER_UNREACHABLE" | "USER_CANCELED" | "USER_SHUTDOWN" | undefined
result.estimatedEndTime; // $ExpectType string | undefined
Expand Down Expand Up @@ -5138,7 +5139,7 @@ function testDownloads() {
downloadItem.byExtensionName; // $ExpectType string | undefined
downloadItem.bytesReceived; // $ExpectType number
downloadItem.canResume; // $ExpectType boolean
downloadItem.danger; // $ExpectType "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted" | "allowlistedByPolicy" | "asyncScanning" | "asyncLocalPasswordScanning" | "passwordProtected" | "blockedTooLarge" | "sensitiveContentWarning" | "sensitiveContentBlock" | "deepScannedFailed" | "deepScannedSafe" | "deepScannedOpenedDangerous" | "promptForScanning" | "promptForLocalPasswordScanning" | "accountCompromise" | "blockedScanFailed" | "forceSaveToGdrive"
downloadItem.danger; // $ExpectType "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted" | "allowlistedByPolicy" | "asyncScanning" | "asyncLocalPasswordScanning" | "passwordProtected" | "blockedTooLarge" | "sensitiveContentWarning" | "sensitiveContentBlock" | "deepScannedFailed" | "deepScannedSafe" | "deepScannedOpenedDangerous" | "promptForScanning" | "promptForLocalPasswordScanning" | "accountCompromise" | "blockedScanFailed" | "forceSaveToGdrive" | "forceSaveToOnedrive"
downloadItem.endTime; // $ExpectType string | undefined
downloadItem.error; // $ExpectType "CRASH" | "FILE_ACCESS_DENIED" | "FILE_BLOCKED" | "FILE_FAILED" | "FILE_HASH_MISMATCH" | "FILE_NAME_TOO_LONG" | "FILE_NO_SPACE" | "FILE_SAME_AS_SOURCE" | "FILE_SECURITY_CHECK_FAILED" | "FILE_TOO_LARGE" | "FILE_TOO_SHORT" | "FILE_TRANSIENT_ERROR" | "FILE_VIRUS_INFECTED" | "NETWORK_DISCONNECTED" | "NETWORK_FAILED" | "NETWORK_INVALID_REQUEST" | "NETWORK_SERVER_DOWN" | "NETWORK_TIMEOUT" | "SERVER_BAD_CONTENT" | "SERVER_CERT_PROBLEM" | "SERVER_CONTENT_LENGTH_MISMATCH" | "SERVER_CROSS_ORIGIN_REDIRECT" | "SERVER_FAILED" | "SERVER_FORBIDDEN" | "SERVER_NO_RANGE" | "SERVER_UNAUTHORIZED" | "SERVER_UNREACHABLE" | "USER_CANCELED" | "USER_SHUTDOWN" | undefined
downloadItem.estimatedEndTime; // $ExpectType string | undefined
Expand Down Expand Up @@ -6198,6 +6199,15 @@ function testSidePanel() {
chrome.sidePanel.Side.LEFT === "left";
chrome.sidePanel.Side.RIGHT === "right";

const closeOptions: chrome.sidePanel.CloseOptions = {
tabId: 123,
};

chrome.sidePanel.close(closeOptions); // $ExpectType Promise<void>
chrome.sidePanel.close(closeOptions, () => void 0); // $ExpectType void
// @ts-expect-error
chrome.sidePanel.close(closeOptions, () => {}).then(() => {});

chrome.sidePanel.getLayout(); // $ExpectType Promise<PanelLayout>
chrome.sidePanel.getLayout((layout) => { // $ExpectType void
layout.side; // $ExpectType "left" | "right"
Expand Down Expand Up @@ -6265,6 +6275,12 @@ function testSidePanel() {
// @ts-expect-error
chrome.sidePanel.setPanelBehavior(setPanelBehavior, () => {}).then(() => {});

checkChromeEvent(chrome.sidePanel.onClosed, (info) => {
info.path; // $ExpectType string
info.tabId; // $ExpectType number | undefined
info.windowId; // $ExpectType number
});

checkChromeEvent(chrome.sidePanel.onOpened, (info) => {
info.path; // $ExpectType string
info.tabId; // $ExpectType number | undefined
Expand Down Expand Up @@ -6857,6 +6873,8 @@ function testWebRequest() {
chrome.webRequest.OnHeadersReceivedOptions.BLOCKING === "blocking";
chrome.webRequest.OnHeadersReceivedOptions.EXTRA_HEADERS === "extraHeaders";
chrome.webRequest.OnHeadersReceivedOptions.RESPONSE_HEADERS === "responseHeaders";
chrome.webRequest.OnHeadersReceivedOptions.SECURITY_INFO === "securityInfo";
chrome.webRequest.OnHeadersReceivedOptions.SECURITY_INFO_RAW_DER === "securityInfoRawDer";

chrome.webRequest.OnResponseStartedOptions.EXTRA_HEADERS === "extraHeaders";
chrome.webRequest.OnResponseStartedOptions.RESPONSE_HEADERS === "responseHeaders";
Expand Down Expand Up @@ -7064,6 +7082,10 @@ function testWebRequest() {
details.responseHeaders?.[0].name; // $ExpectType string | undefined
details.responseHeaders?.[0].value; // $ExpectType string | undefined
details.responseHeaders?.[0].binaryValue; // $ExpectType ArrayBuffer | undefined
details.securityInfo; // $ExpectType SecurityInfo | undefined
details.securityInfo!.certificates![0].fingerprint.sha256; // $ExpectType string
details.securityInfo!.certificates![0].rawDER; // $ExpectType ArrayBuffer | undefined
details.securityInfo!.state; // $ExpectType string
details.statusCode; // $ExpectType number
details.statusLine; // $ExpectType string
details.tabId; // $ExpectType number
Expand Down
13 changes: 10 additions & 3 deletions types/eslint-plugin-security/eslint-plugin-security-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import type { Linter, Rule } from "eslint";
import { configs, rules } from "eslint-plugin-security";
import security from "eslint-plugin-security";

const config: Linter.FlatConfig = configs.recommended;
const rule: Rule.RuleModule = rules["detect-unsafe-regex"];
const name: string = security.meta.name;
const version: string = security.meta.version;

const rule: Rule.RuleModule = security.rules["detect-unsafe-regex"];

const ruleConfig: Linter.Severity = security.rulesConfig["detect-unsafe-regex"];

const config: Linter.Config = security.configs.recommended;
const configLegacy: Linter.LegacyConfig = security.configs["recommended-legacy"];
13 changes: 9 additions & 4 deletions types/eslint-plugin-security/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Linter, Rule } from "eslint";
import type { ESLint, Linter, Rule } from "eslint";

export const configs: {
recommended: Linter.FlatConfig;
};
export const meta: Required<NonNullable<ESLint.ObjectMetaProperties["meta"]>>;

export const rules: Record<string, Rule.RuleModule>;

export const rulesConfig: Record<string, Linter.Severity>;

export const configs: {
readonly "recommended": Linter.Config;
readonly "recommended-legacy": Linter.LegacyConfig;
};
4 changes: 4 additions & 0 deletions types/eslint-plugin-security/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{
"name": "rhysd",
"githubUsername": "rhysd"
},
{
"name": "Dom Porada",
"githubUsername": "porada"
}
]
}
10 changes: 10 additions & 0 deletions types/jasmine/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,16 @@ declare namespace jasmine {
*/
function DiffBuilder(): DiffBuilder;

/**
* Formats a value for display, taking into account the current set of
* custom object formatters.
*
* @since 6.0.0
* @param value The value to pretty-print
* @returns The pretty-printed value
*/
function pp(value: any): string;

/**
* That will succeed if the actual value being compared is an instance of the specified class/constructor.
*/
Expand Down
9 changes: 9 additions & 0 deletions types/jasmine/jasmine-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2604,6 +2604,15 @@ describe("Debug logging", function() {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
jasmine.MAX_PRETTY_PRINT_DEPTH = 40;

jasmine.pp(true);
jasmine.pp("string");
jasmine.pp(42);
jasmine.pp({ key: "value" });
jasmine.pp([1, 2, 3]);
jasmine.pp(new Map());
jasmine.pp(new Set());
jasmine.pp(() => {});

(async () => {
throwUnless(1).toEqual(2);

Expand Down
2 changes: 1 addition & 1 deletion types/jasmine/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/jasmine",
"version": "5.1.9999",
"version": "6.0.9999",
"projects": [
"http://jasmine.github.io"
],
Expand Down
36 changes: 0 additions & 36 deletions types/leaflet.fullscreen/index.d.ts

This file was deleted.

Loading