From 58fbf425fe517a9a34215f0774582df23771f4d5 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 15 Nov 2025 01:49:56 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74030=20feat?= =?UTF-8?q?(validator):=20update=20isIP()=20to=20let=20it=20accept=20optio?= =?UTF-8?q?ns=20argument=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/validator/es/lib/isIP.d.ts | 1 + types/validator/index.d.ts | 11 +++++++++-- types/validator/lib/isIP.d.ts | 1 + types/validator/validator-tests.ts | 13 +++++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/types/validator/es/lib/isIP.d.ts b/types/validator/es/lib/isIP.d.ts index 680c54c7aec1fb..c28882fca87e05 100644 --- a/types/validator/es/lib/isIP.d.ts +++ b/types/validator/es/lib/isIP.d.ts @@ -1,3 +1,4 @@ import validator from "../../"; export type IPVersion = validator.IPVersion; +export type IsIPOptions = validator.IsIPOptions; export default validator.isIP; diff --git a/types/validator/index.d.ts b/types/validator/index.d.ts index 41d29b0181ce73..f20fa4ef38420d 100644 --- a/types/validator/index.d.ts +++ b/types/validator/index.d.ts @@ -714,12 +714,19 @@ declare namespace validator { export type IPVersion = "4" | "6" | 4 | 6; + export interface IsIPOptions { + /** + * Defines which IP version to compare to. + */ + version?: IPVersion | undefined; + } + /** * Check if the string is an IP (version 4 or 6). * - * @param [version] - IP Version + * @param [version] - Defines which IP version to compare to. */ - export function isIP(str: string, version?: IPVersion): boolean; + export function isIP(str: string, versionOrOptions?: IPVersion | IsIPOptions): boolean; /** * Check if the string is an IP Range (version 4 or 6). diff --git a/types/validator/lib/isIP.d.ts b/types/validator/lib/isIP.d.ts index 94b1125e7e92d9..fbe331c7d96f9a 100644 --- a/types/validator/lib/isIP.d.ts +++ b/types/validator/lib/isIP.d.ts @@ -1,3 +1,4 @@ import validator from "../"; export type IPVersion = validator.IPVersion; +export type IsIPOptions = validator.IsIPOptions; export default validator.isIP; diff --git a/types/validator/validator-tests.ts b/types/validator/validator-tests.ts index 2aea101679f22d..7e1b57c5c05db9 100644 --- a/types/validator/validator-tests.ts +++ b/types/validator/validator-tests.ts @@ -44,7 +44,7 @@ import isIBANFunc, { IBANLocale, IsIBANOptions, locales as isIBANLocales } from import isIMEIFunc from "validator/lib/isIMEI"; import isInFunc from "validator/lib/isIn"; import isIntFunc from "validator/lib/isInt"; -import isIPFunc from "validator/lib/isIP"; +import isIPFunc, { IPVersion, IsIPOptions } from "validator/lib/isIP"; import isIPRange from "validator/lib/isIPRange"; import isISBNFunc from "validator/lib/isISBN"; import isISINFunc from "validator/lib/isISIN"; @@ -454,7 +454,7 @@ import isIBANFuncEs, { } from "validator/es/lib/isIBAN"; import isInFuncEs from "validator/es/lib/isIn"; import isIntFuncEs from "validator/es/lib/isInt"; -import isIPFuncEs from "validator/es/lib/isIP"; +import isIPFuncEs, { IPVersion as IPVersionEs, IsIPOptions as IsIPOptionsEs } from "validator/es/lib/isIP"; import isIPRangeFuncEs from "validator/es/lib/isIPRange"; import isISBNFuncEs from "validator/es/lib/isISBN"; import isISINFuncEs from "validator/es/lib/isISIN"; @@ -925,7 +925,16 @@ const any: any = null; result = validator.isIdentityCard("sample", "zh-TW"); result = validator.isIP("sample"); + result = validator.isIP("sample", "4" satisfies IPVersion); result = validator.isIP("sample", "6"); + result = validator.isIP("sample", 4); + result = validator.isIP("sample", 6); + result = validator.isIP("sample", {}); + result = validator.isIP("sample", { version: "4" } satisfies IsIPOptions); + result = validator.isIP("sample", { version: "6" }); + result = validator.isIP("sample", { version: 4 }); + result = validator.isIP("sample", { version: 6 }); + result = validator.isIP("sample", result ? 6 : { version: 6 }); result = validator.isIPRange("sample"); result = validator.isIPRange("sample", "6"); From e8c5b721697a64e078ab1fea0546382732f3c750 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 15 Nov 2025 01:54:45 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74069=20feat?= =?UTF-8?q?(isLatLong):=20add=20`options.checkDMS`=20to=20isLatLong()=20by?= =?UTF-8?q?=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/validator/es/lib/isLatLong.d.ts | 1 + types/validator/index.d.ts | 9 ++++++++- types/validator/lib/isLatLong.d.ts | 1 + types/validator/validator-tests.ts | 6 ++++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/types/validator/es/lib/isLatLong.d.ts b/types/validator/es/lib/isLatLong.d.ts index 5c8341a9d8115c..c431991afce0e0 100644 --- a/types/validator/es/lib/isLatLong.d.ts +++ b/types/validator/es/lib/isLatLong.d.ts @@ -1,2 +1,3 @@ import validator from "../../"; +export type IsLatLongOptions = validator.IsLatLongOptions; export default validator.isLatLong; diff --git a/types/validator/index.d.ts b/types/validator/index.d.ts index f20fa4ef38420d..dd1cefbc4c97dd 100644 --- a/types/validator/index.d.ts +++ b/types/validator/index.d.ts @@ -856,12 +856,19 @@ declare namespace validator { */ export function isJWT(str: string): boolean; + export interface IsLatLongOptions { + /** + * Pass `checkDMS` as true to validate DMS(degrees, minutes, and seconds) latitude-longitude format. + * @default false + */ + checkDMS?: boolean | undefined; + } /** * Check if the string is a valid latitude-longitude coordinate in the format: * * `lat,long` or `lat, long`. */ - export function isLatLong(str: string): boolean; + export function isLatLong(str: string, options?: IsLatLongOptions): boolean; export interface IsLengthOptions { /** diff --git a/types/validator/lib/isLatLong.d.ts b/types/validator/lib/isLatLong.d.ts index f4d1cc5964a839..8e71eed17580aa 100644 --- a/types/validator/lib/isLatLong.d.ts +++ b/types/validator/lib/isLatLong.d.ts @@ -1,2 +1,3 @@ import validator from "../"; +export type IsLatLongOptions = validator.IsLatLongOptions; export default validator.isLatLong; diff --git a/types/validator/validator-tests.ts b/types/validator/validator-tests.ts index 7e1b57c5c05db9..c436ea0dc7ac54 100644 --- a/types/validator/validator-tests.ts +++ b/types/validator/validator-tests.ts @@ -60,7 +60,7 @@ import isISRCFunc from "validator/lib/isISRC"; import isISSNFunc from "validator/lib/isISSN"; import isJSONFunc, { IsJSONOptions } from "validator/lib/isJSON"; import isJWTFunc from "validator/lib/isJWT"; -import isLatLongFunc from "validator/lib/isLatLong"; +import isLatLongFunc, { IsLatLongOptions } from "validator/lib/isLatLong"; import isLengthFunc from "validator/lib/isLength"; import isLicensePlateFunc from "validator/lib/isLicensePlate"; import isLocaleFunc from "validator/lib/isLocale"; @@ -470,7 +470,7 @@ import isISRCFuncEs from "validator/es/lib/isISRC"; import isISSNFuncEs from "validator/es/lib/isISSN"; import isJSONFuncEs, { IsJSONOptions as IsJSONOptionsEs } from "validator/es/lib/isJSON"; import isJWTFuncEs from "validator/es/lib/isJWT"; -import isLatLongFuncEs from "validator/es/lib/isLatLong"; +import isLatLongFuncEs, { IsLatLongOptions as IsLatLongOptionsEs } from "validator/es/lib/isLatLong"; import isLengthFuncEs from "validator/es/lib/isLength"; import isLicensePlateFuncEs from "validator/es/lib/isLicensePlate"; import isLocaleFuncEs from "validator/es/lib/isLocale"; @@ -984,6 +984,8 @@ const any: any = null; result = validator.isJSON("sample", { allow_primitives: true }); result = validator.isLatLong("sample"); + result = validator.isLatLong("sample", {}); + result = validator.isLatLong("sample", { checkDMS: true } satisfies IsLatLongOptions); const isLengthOptions: validator.IsLengthOptions = {}; result = validator.isLength("sample", isLengthOptions); From 2c479b884db97b871bbcff3a6abefed6748fbd05 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 15 Nov 2025 01:55:39 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74070=20feat?= =?UTF-8?q?(validator):=20fix=20matches()=20to=20correct=20the=20argument?= =?UTF-8?q?=20type=20overload=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/validator/index.d.ts | 8 +------- types/validator/validator-tests.ts | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/types/validator/index.d.ts b/types/validator/index.d.ts index dd1cefbc4c97dd..fbeb2cd7ac23ec 100644 --- a/types/validator/index.d.ts +++ b/types/validator/index.d.ts @@ -1519,13 +1519,7 @@ declare namespace validator { * * @param pattern - `/foo/i` */ - export function matches(str: string, pattern: RegExp): boolean; - /** - * Check if string matches the pattern. - * - * @param pattern - `'foo'` - * @param [modifiers] - `'i'` - */ + export function matches(str: string, pattern: RegExp | string): boolean; export function matches(str: string, pattern: string, modifiers?: string): boolean; /** diff --git a/types/validator/validator-tests.ts b/types/validator/validator-tests.ts index c436ea0dc7ac54..41374e69dc8de9 100644 --- a/types/validator/validator-tests.ts +++ b/types/validator/validator-tests.ts @@ -1405,6 +1405,7 @@ const any: any = null; result = validator.matches("foobar", "foo/i"); result = validator.matches("foobar", "foo", "i"); + result = validator.matches("foobar", result ? "foo/i" : "foo"); result = validator.isSlug("cs_67CZ"); } From 86922c53f1c91ff2b6f7ec4c5320aac868446bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Fri, 14 Nov 2025 18:00:13 +0000 Subject: [PATCH 04/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74059=20Upda?= =?UTF-8?q?te=20DT=20references=20to=20deprecated=20@types/node=20globals?= =?UTF-8?q?=20by=20@Renegade334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/blocked/index.d.ts | 2 +- types/codependency/index.d.ts | 2 +- types/express-minify/index.d.ts | 4 ++-- types/express-mysql-session/index.d.ts | 2 +- types/find-package-json/index.d.ts | 2 +- types/folder-walker/index.d.ts | 2 +- types/ignore-styles/index.d.ts | 2 +- types/interpret/index.d.ts | 2 +- types/kurento-client/index.d.ts | 2 +- types/meteor/test/globals/meteor-tests.ts | 2 +- types/meteor/test/meteor-tests.ts | 2 +- types/nodal/index.d.ts | 2 +- types/pkginfo/index.d.ts | 6 +++--- types/react-timeout/index.d.ts | 15 +++++++-------- types/react-timeout/package.json | 1 - types/require-directory/index.d.ts | 2 +- types/socketcluster-client/lib/transport.d.ts | 2 +- types/socketcluster-client/v15/lib/transport.d.ts | 2 +- types/socketcluster-client/v16/lib/transport.d.ts | 2 +- types/socketcluster-client/v17/lib/transport.d.ts | 2 +- types/socketcluster-client/v18/lib/transport.d.ts | 2 +- types/stompjs/index.d.ts | 4 ++-- types/storybook-addon-jsx/index.d.ts | 2 +- types/storybook__addon-info/index.d.ts | 2 +- types/watchpack/index.d.ts | 2 +- types/yargs/v15/yargs.d.ts | 2 +- types/yargs/v16/yargs.d.ts | 2 +- types/yargs/yargs.d.ts | 2 +- 28 files changed, 37 insertions(+), 39 deletions(-) diff --git a/types/blocked/index.d.ts b/types/blocked/index.d.ts index 39dd3cade73e0c..4535cd16d93d16 100644 --- a/types/blocked/index.d.ts +++ b/types/blocked/index.d.ts @@ -10,7 +10,7 @@ export = Blocked; -declare function Blocked(callback: (ms: number) => void, options?: Blocked.Options): NodeJS.Timer; +declare function Blocked(callback: (ms: number) => void, options?: Blocked.Options): NodeJS.Timeout; declare namespace Blocked { interface Options { diff --git a/types/codependency/index.d.ts b/types/codependency/index.d.ts index b8373e3b806c25..5df79274b5a139 100644 --- a/types/codependency/index.d.ts +++ b/types/codependency/index.d.ts @@ -20,5 +20,5 @@ export interface RequirePeerFunction { resolve(name: string): DependencyInfo; } -export function register(baseModule: NodeModule, options?: { index: string[] }): RequirePeerFunction; +export function register(baseModule: NodeJS.Module, options?: { index: string[] }): RequirePeerFunction; export function get(middlewareName: string): RequirePeerFunction; diff --git a/types/express-minify/index.d.ts b/types/express-minify/index.d.ts index 532721f8afe8a7..d3608a830c6da6 100644 --- a/types/express-minify/index.d.ts +++ b/types/express-minify/index.d.ts @@ -15,12 +15,12 @@ declare namespace ExpressMinifyInterfaces { /** * Customize UglifyJS instance (require('uglify-js')). */ - uglifyJS?: NodeRequire | undefined; + uglifyJS?: NodeJS.Require | undefined; /** * Customize cssmin instance (require('cssmin')). */ - cssmin?: NodeRequire | undefined; + cssmin?: NodeJS.Require | undefined; /** * Handle compiling errors or minifying errors. You can determine what to respond when facing such errors. diff --git a/types/express-mysql-session/index.d.ts b/types/express-mysql-session/index.d.ts index 51c9182701e5ee..0c961263666bf5 100644 --- a/types/express-mysql-session/index.d.ts +++ b/types/express-mysql-session/index.d.ts @@ -99,7 +99,7 @@ declare class MySQLStoreClass extends expressSession.Store { options: MySQLStore.Options; - private _expirationInterval?: NodeJS.Timer | null; + private _expirationInterval?: NodeJS.Timeout | null; onReady(): Promise; diff --git a/types/find-package-json/index.d.ts b/types/find-package-json/index.d.ts index ca57767aa8977e..ebd9e471f1ba4c 100644 --- a/types/find-package-json/index.d.ts +++ b/types/find-package-json/index.d.ts @@ -10,7 +10,7 @@ export = find; * @param root The root directory we should start searching in. * @returns Iterator interface. */ -declare function find(root?: string | NodeModule): find.FinderIterator; +declare function find(root?: string | NodeJS.Module): find.FinderIterator; declare namespace find { interface FinderIterator extends IterableIterator { diff --git a/types/folder-walker/index.d.ts b/types/folder-walker/index.d.ts index c1d74bf1f6ed79..1967eb02e70624 100644 --- a/types/folder-walker/index.d.ts +++ b/types/folder-walker/index.d.ts @@ -3,7 +3,7 @@ import * as fs from "fs"; interface WalkerOptions { - fs?: NodeRequire; + fs?: NodeJS.Require; maxDepth?: number; filter: (filename: string) => boolean; } diff --git a/types/ignore-styles/index.d.ts b/types/ignore-styles/index.d.ts index 18734b56633ecf..abdca364bef1ad 100644 --- a/types/ignore-styles/index.d.ts +++ b/types/ignore-styles/index.d.ts @@ -1,6 +1,6 @@ /// -export type Handler = (m: NodeModule, filename: string) => any; +export type Handler = (m: NodeJS.Module, filename: string) => any; export const DEFAULT_EXTENSIONS: string[]; diff --git a/types/interpret/index.d.ts b/types/interpret/index.d.ts index b8e259e9394b6e..512c4d973d8abb 100644 --- a/types/interpret/index.d.ts +++ b/types/interpret/index.d.ts @@ -1,7 +1,7 @@ /// export interface Hook { - (m: { extensions: string } | NodeModule): any; + (m: { extensions: string } | NodeJS.Module): any; install(m?: { extension: string; [key: string]: any }): void; } diff --git a/types/kurento-client/index.d.ts b/types/kurento-client/index.d.ts index 8baab935a718df..0afb161cbf6f0e 100644 --- a/types/kurento-client/index.d.ts +++ b/types/kurento-client/index.d.ts @@ -5,7 +5,7 @@ declare namespace kurento { (ws_uri: string, options?: Options): Promise; getComplexType: (complex: "IceCandidate") => (value: any) => any; getSingleton(ws_uri: string, options?: Options): Promise; - register: (module: string | ReturnType) => void; + register: (module: string | ReturnType) => void; on: undefined; } diff --git a/types/meteor/test/globals/meteor-tests.ts b/types/meteor/test/globals/meteor-tests.ts index eca62aa440bad6..ec36f6d6708cce 100644 --- a/types/meteor/test/globals/meteor-tests.ts +++ b/types/meteor/test/globals/meteor-tests.ts @@ -1237,7 +1237,7 @@ namespace MeteorTests { }); } - function canAcceptUpdates(module: NodeModule) { + function canAcceptUpdates(module: NodeJS.Module) { return true; } if (module.hot) { diff --git a/types/meteor/test/meteor-tests.ts b/types/meteor/test/meteor-tests.ts index 4d6730bb42eddc..13ce5150430be0 100644 --- a/types/meteor/test/meteor-tests.ts +++ b/types/meteor/test/meteor-tests.ts @@ -1255,7 +1255,7 @@ namespace MeteorTests { }); } - function canAcceptUpdates(module: NodeModule) { + function canAcceptUpdates(module: NodeJS.Module) { return true; } if (module.hot) { diff --git a/types/nodal/index.d.ts b/types/nodal/index.d.ts index b879a023b86a53..e8b8e25b7d205e 100644 --- a/types/nodal/index.d.ts +++ b/types/nodal/index.d.ts @@ -993,4 +993,4 @@ export const my: { Schema?: any; bootstrapper?: any; }; -export const require: NodeRequire; +export const require: NodeJS.Require; diff --git a/types/pkginfo/index.d.ts b/types/pkginfo/index.d.ts index 05bc4bee32715e..322dbf0a300e12 100644 --- a/types/pkginfo/index.d.ts +++ b/types/pkginfo/index.d.ts @@ -12,7 +12,7 @@ declare namespace PkgInfo { } interface PkgInfo { - (pmodule: NodeModule, options?: Options | string[] | string, ...properties: string[]): PkgInfo; + (pmodule: NodeJS.Module, options?: Options | string[] | string, ...properties: string[]): PkgInfo; // // ### function find (dir) @@ -22,12 +22,12 @@ declare namespace PkgInfo { // which contains a `package.json` file. // read( - pmodule: NodeModule, + pmodule: NodeJS.Module, dir?: string, ): FindResults; find( - pmodule: NodeModule, + pmodule: NodeJS.Module, dir?: string, ): Record; } diff --git a/types/react-timeout/index.d.ts b/types/react-timeout/index.d.ts index de0a7d55e7cec4..3cd64a0a209df3 100644 --- a/types/react-timeout/index.d.ts +++ b/types/react-timeout/index.d.ts @@ -1,5 +1,3 @@ -/// - import * as React from "react"; export = ReactTimeout; @@ -9,17 +7,18 @@ declare function ReactTimeout( ): React.ComponentClass; declare namespace ReactTimeout { - type Timer = NodeJS.Timer | number; + type Timer = typeof globalThis extends { setTimeout(...args: any[]): infer T } ? T : Id; + type Immediate = typeof globalThis extends { setImmediate(...args: any[]): infer T } ? T : Id; type Id = number; interface ReactTimeoutProps { setTimeout?: ((callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer) | undefined; - clearTimeout?: ((timer: Timer) => void) | undefined; - setInterval?: ((callback: (...args: any[]) => void, ms: number, ...args: any[]) => Id) | undefined; - clearInterval?: ((id: Id) => void) | undefined; - setImmediate?: ((callback: (...args: any[]) => void, ...args: any[]) => Id) | undefined; - clearImmediate?: ((id: Id) => void) | undefined; + clearTimeout?: ((timer: Timer | Id) => void) | undefined; + setInterval?: ((callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timer) | undefined; + clearInterval?: ((id: Timer | Id) => void) | undefined; + setImmediate?: ((callback: (...args: any[]) => void, ...args: any[]) => Immediate) | undefined; + clearImmediate?: ((id: Immediate | Id) => void) | undefined; requestAnimationFrame?: ((callback: (...args: any[]) => void) => Id) | undefined; cancelAnimationFrame?: ((id: Id) => void) | undefined; } diff --git a/types/react-timeout/package.json b/types/react-timeout/package.json index 54a3e834b7533f..b808de9f16d12c 100644 --- a/types/react-timeout/package.json +++ b/types/react-timeout/package.json @@ -6,7 +6,6 @@ "https://github.com/plougsgaard/react-timeout" ], "dependencies": { - "@types/node": "*", "@types/react": "*" }, "devDependencies": { diff --git a/types/require-directory/index.d.ts b/types/require-directory/index.d.ts index 6a56323fff9a63..7feba503b31c71 100644 --- a/types/require-directory/index.d.ts +++ b/types/require-directory/index.d.ts @@ -66,7 +66,7 @@ declare namespace requireDirectory { * @returns hash of modules in specified directory */ declare function requireDirectory( - m: NodeModule, + m: NodeJS.Module, path?: string | requireDirectory.RequireDirectoryOptions, options?: requireDirectory.RequireDirectoryOptions, ): requireDirectory.RequireDirectoryResult; diff --git a/types/socketcluster-client/lib/transport.d.ts b/types/socketcluster-client/lib/transport.d.ts index 1de90dd25f3e0f..f8c9d464dbfabb 100644 --- a/types/socketcluster-client/lib/transport.d.ts +++ b/types/socketcluster-client/lib/transport.d.ts @@ -126,7 +126,7 @@ declare namespace AGTransport { data: any; callback?: EventObjectCallback | undefined; cid?: number | undefined; - timeout?: NodeJS.Timer | undefined; + timeout?: NodeJS.Timeout | undefined; } interface TransmitOptions { diff --git a/types/socketcluster-client/v15/lib/transport.d.ts b/types/socketcluster-client/v15/lib/transport.d.ts index 73cdd1b3b60b47..7489e5e02f5cee 100644 --- a/types/socketcluster-client/v15/lib/transport.d.ts +++ b/types/socketcluster-client/v15/lib/transport.d.ts @@ -125,7 +125,7 @@ declare namespace AGTransport { data: any; callback?: EventObjectCallback | undefined; cid?: number | undefined; - timeout?: NodeJS.Timer | undefined; + timeout?: NodeJS.Timeout | undefined; } interface TransmitOptions { diff --git a/types/socketcluster-client/v16/lib/transport.d.ts b/types/socketcluster-client/v16/lib/transport.d.ts index 73cdd1b3b60b47..7489e5e02f5cee 100644 --- a/types/socketcluster-client/v16/lib/transport.d.ts +++ b/types/socketcluster-client/v16/lib/transport.d.ts @@ -125,7 +125,7 @@ declare namespace AGTransport { data: any; callback?: EventObjectCallback | undefined; cid?: number | undefined; - timeout?: NodeJS.Timer | undefined; + timeout?: NodeJS.Timeout | undefined; } interface TransmitOptions { diff --git a/types/socketcluster-client/v17/lib/transport.d.ts b/types/socketcluster-client/v17/lib/transport.d.ts index 73cdd1b3b60b47..7489e5e02f5cee 100644 --- a/types/socketcluster-client/v17/lib/transport.d.ts +++ b/types/socketcluster-client/v17/lib/transport.d.ts @@ -125,7 +125,7 @@ declare namespace AGTransport { data: any; callback?: EventObjectCallback | undefined; cid?: number | undefined; - timeout?: NodeJS.Timer | undefined; + timeout?: NodeJS.Timeout | undefined; } interface TransmitOptions { diff --git a/types/socketcluster-client/v18/lib/transport.d.ts b/types/socketcluster-client/v18/lib/transport.d.ts index 73cdd1b3b60b47..7489e5e02f5cee 100644 --- a/types/socketcluster-client/v18/lib/transport.d.ts +++ b/types/socketcluster-client/v18/lib/transport.d.ts @@ -125,7 +125,7 @@ declare namespace AGTransport { data: any; callback?: EventObjectCallback | undefined; cid?: number | undefined; - timeout?: NodeJS.Timer | undefined; + timeout?: NodeJS.Timeout | undefined; } interface TransmitOptions { diff --git a/types/stompjs/index.d.ts b/types/stompjs/index.d.ts index 06e12f30e126f4..b9d41d607fbd35 100644 --- a/types/stompjs/index.d.ts +++ b/types/stompjs/index.d.ts @@ -73,5 +73,5 @@ export function client(url: string, protocols?: string | string[]): Client; export function over(ws: WebSocket): Client; export function overTCP(host: string, port: number): Client; export function overWS(url: string): Client; -export function setInterval(interval: number, f: (...args: any[]) => void): NodeJS.Timer; -export function clearInterval(id: NodeJS.Timer): void; +export function setInterval(interval: number, f: (...args: any[]) => void): NodeJS.Timeout; +export function clearInterval(id: NodeJS.Timeout): void; diff --git a/types/storybook-addon-jsx/index.d.ts b/types/storybook-addon-jsx/index.d.ts index 8ac6bdb4257662..a4da2f206c7041 100644 --- a/types/storybook-addon-jsx/index.d.ts +++ b/types/storybook-addon-jsx/index.d.ts @@ -18,7 +18,7 @@ export type AddWithJSXFunc = ( declare module "@storybook/addons" { interface ClientStoryApi { - storiesOf(kind: string, module: NodeModule): + storiesOf(kind: string, module: NodeJS.Module): & StoryApi & { addWithJSX: AddWithJSXFunc }; addDecorator(decorator: DecoratorFunction): StoryApi; diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index 803eeb2a06d0ae..d9a18fe8713af7 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -61,7 +61,7 @@ export function setDefaults(newDefaults: Options): Options; declare module "@storybook/addons" { interface ClientStoryApi { - storiesOf(kind: string, module: NodeModule): StoryApi; + storiesOf(kind: string, module: NodeJS.Module): StoryApi; addParameters(parameter: Parameters & { info: Options }): StoryApi; addDecorator(decorator: DecoratorFunction): StoryApi; } diff --git a/types/watchpack/index.d.ts b/types/watchpack/index.d.ts index 2b591a66c520fa..5d3464b550be1b 100644 --- a/types/watchpack/index.d.ts +++ b/types/watchpack/index.d.ts @@ -14,7 +14,7 @@ declare class Watchpack extends EventEmitter { aggregatedChanges: Set; aggregatedRemovals: Set; - aggregateTimeout: NodeJS.Timer; + aggregateTimeout: number; dirWatchers: Watcher[]; fileWatchers: Watcher[]; /** Last modified times for files by path */ diff --git a/types/yargs/v15/yargs.d.ts b/types/yargs/v15/yargs.d.ts index a3c5c3318e26b5..a8c62eef2d3005 100644 --- a/types/yargs/v15/yargs.d.ts +++ b/types/yargs/v15/yargs.d.ts @@ -5,5 +5,5 @@ export = Yargs; declare function Yargs( processArgs?: readonly string[], cwd?: string, - parentRequire?: NodeRequire, + parentRequire?: NodeJS.Require, ): Argv; diff --git a/types/yargs/v16/yargs.d.ts b/types/yargs/v16/yargs.d.ts index a3c5c3318e26b5..a8c62eef2d3005 100644 --- a/types/yargs/v16/yargs.d.ts +++ b/types/yargs/v16/yargs.d.ts @@ -5,5 +5,5 @@ export = Yargs; declare function Yargs( processArgs?: readonly string[], cwd?: string, - parentRequire?: NodeRequire, + parentRequire?: NodeJS.Require, ): Argv; diff --git a/types/yargs/yargs.d.ts b/types/yargs/yargs.d.ts index e2475135182403..9622a1c3396692 100644 --- a/types/yargs/yargs.d.ts +++ b/types/yargs/yargs.d.ts @@ -5,5 +5,5 @@ export = Yargs; declare function Yargs( processArgs?: readonly string[] | string, cwd?: string, - parentRequire?: NodeRequire, + parentRequire?: NodeJS.Require, ): Argv; From dfa1afde708b357cfe6aba23f63d28d806bad8a1 Mon Sep 17 00:00:00 2001 From: recurly-integrations <49795151+recurly-integrations@users.noreply.github.com> Date: Fri, 14 Nov 2025 13:29:12 -0500 Subject: [PATCH 05/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73945=20Upda?= =?UTF-8?q?tes=20types=20for=20Recurly.js=20v4.39.1=20by=20@recurly-integr?= =?UTF-8?q?ations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: recurly-integrations --- types/recurly__recurly-js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/recurly__recurly-js/package.json b/types/recurly__recurly-js/package.json index d58fe57dc8826a..7898eae37480ef 100644 --- a/types/recurly__recurly-js/package.json +++ b/types/recurly__recurly-js/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/recurly__recurly-js", - "version": "4.38.9999", + "version": "4.39.9999", "nonNpm": true, "nonNpmDescription": "@recurly/recurly-js", "projects": [ From b43f3585dce6d7c50601272aef61bb02264a16d1 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 15 Nov 2025 02:30:19 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73920=20fix(?= =?UTF-8?q?react-detect-offline):=20make=20BaseProps.polling=20takes=20par?= =?UTF-8?q?tial=20shape=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-detect-offline/index.d.ts | 33 +++++-- .../react-detect-offline-tests.tsx | 90 +++++++++++++++++-- 2 files changed, 105 insertions(+), 18 deletions(-) diff --git a/types/react-detect-offline/index.d.ts b/types/react-detect-offline/index.d.ts index 433ebf863a2d9a..c3e1520674ce28 100644 --- a/types/react-detect-offline/index.d.ts +++ b/types/react-detect-offline/index.d.ts @@ -1,17 +1,37 @@ import { JSX } from "react"; export interface PollingConfig { + /** + * URL to pool for connection status + */ url: string; + /** + * Force polling on or off. + * Polling is only used as a fallback for browsers that don't support the `"online"` event. + * Currently these are Chrome on Windows, Firefox on Windows, and Chrome on Linux. + */ enabled: boolean; + /** + * How often (in ms) to poll + */ interval: number; + /** + * How long (in ms) before timeout + */ timeout: number; } export interface BaseProps { - children?: React.ReactNode; + children?: React.ReactNode | undefined; + /** + * Called when connection changes + */ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - onChange?: (online: boolean) => void | undefined; - wrapperType?: string; - polling?: boolean | PollingConfig; + onChange?: ((online: boolean) => void | undefined) | undefined; + wrapperType?: string | undefined; + /** + * Config for polling fallback + */ + polling?: boolean | Partial> | undefined; } export interface BaseState { online: boolean; @@ -22,16 +42,11 @@ export const Base: React.ComponentClass; export interface DetectorProps extends BaseProps { render: ({ online }: { online: boolean }) => JSX.Element | null; } -// tslint:disable-next-line export interface DetectorState extends BaseState {} export const Detector: React.ComponentClass; -// tslint:disable-next-line export interface OnlineProps extends BaseProps {} -// tslint:disable-next-line export interface OnlineState extends BaseState {} export const Online: React.ComponentClass; -// tslint:disable-next-line export interface OfflineProps extends BaseProps {} -// tslint:disable-next-line export interface OfflineState extends BaseState {} export const Offline: React.ComponentClass; diff --git a/types/react-detect-offline/react-detect-offline-tests.tsx b/types/react-detect-offline/react-detect-offline-tests.tsx index 8671285dc4b01c..9cb4b851706023 100644 --- a/types/react-detect-offline/react-detect-offline-tests.tsx +++ b/types/react-detect-offline/react-detect-offline-tests.tsx @@ -1,11 +1,83 @@ import * as React from "react"; -import { Offline, Online } from "react-detect-offline"; - -function ReactDetectOfflineTests() { - return ( -
- Only shown when you're online - Only shown offline (surprise!) -
- ); +import { Detector, Offline, Online } from "react-detect-offline"; + +declare function render(arg: { online: boolean }): React.JSX.Element; + +// Online +{ + ; + // @ts-expect-error - props.render is not allowed to be in Online. + ; + + { + // $ExpectType boolean + online; + }} + wrapperType="wrapperType" + > + Only shown when you're online + ; + + ; + ; + ; + // @ts-expect-error - `enabled` is not upposed to be proovided by props + ; +} + +// Offline +{ + ; + // @ts-expect-error - props.render is not allowed to be in Offline. + ; + + { + // $ExpectType boolean + online; + }} + wrapperType="wrapperType" + > + Only shown when you're online + ; + + ; + ; + ; + // @ts-expect-error - `enabled` is not upposed to be proovided by props + ; +} + +// Detector +{ + // @ts-expect-error - props.render is required in Detector. + ; + + { + // $ExpectType boolean + arg.online; + + return null; + }} + />; + ; + + { + // $ExpectType boolean + online; + }} + wrapperType="wrapperType" + render={render} + > + Only shown when you're online + ; + + ; + ; + ; + // @ts-expect-error - `enabled` is not upposed to be proovided by props + ; } From 454f2a588bd645b6eeaadffb78a7f45c1f62bf47 Mon Sep 17 00:00:00 2001 From: Alex Jerabek <38896772+AlexJerabek@users.noreply.github.com> Date: Fri, 14 Nov 2025 10:33:47 -0800 Subject: [PATCH 07/18] [office-js,office-js-preview] Update support for Document.getFileAsync to exclude Word/Excel on the web (#74031) --- types/office-js-preview/index.d.ts | 16 ++++++++-------- types/office-js/index.d.ts | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 7199a25eb551d9..285c44a03f99cd 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -5851,10 +5851,10 @@ declare namespace Office { * * *Supported FileTypes, by platform* * - * - * - * - * + * + * + * + * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
Office on the web Office on Windows Office on Mac Office on iPad
Excel Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Not supported Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* * @param fileType The format in which the file will be returned @@ -5886,10 +5886,10 @@ declare namespace Office { * * *Supported FileTypes, by platform* * - * - * - * - * + * + * + * + * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
Office on the web Office on Windows Office on Mac Office on iPad
Excel Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Not supported Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* * @param fileType The format in which the file will be returned diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 453bd0d13b9813..a34f773fd2a703 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -5841,10 +5841,10 @@ declare namespace Office { * * *Supported FileTypes, by platform* * - * - * - * - * + * + * + * + * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
Office on the web Office on Windows Office on Mac Office on iPad
Excel Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Not supported Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* * @param fileType The format in which the file will be returned @@ -5876,10 +5876,10 @@ declare namespace Office { * * *Supported FileTypes, by platform* * - * - * - * - * + * + * + * + * *
Office on the web Office on Windows Office on Mac Office on iPad
Excel Compressed, Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
Office on the web Office on Windows Office on Mac Office on iPad
Excel Pdf Compressed, Pdf, TextCompressed, Pdf, Text Not supported
PowerPoint Compressed Compressed, Pdf Compressed, Pdf Compressed, Pdf
Word Not supported Compressed, Pdf, TextCompressed, Pdf, TextCompressed, Pdf
* * @param fileType The format in which the file will be returned From 915009ae79fb5470d8d29278c596992be3b0f78e Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 15 Nov 2025 02:43:57 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73968=20feat?= =?UTF-8?q?(selenium-webdriver):=20update=20types=20&=20tests=20for=20bidi?= =?UTF-8?q?/logEntries=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/selenium-webdriver/bidi/logEntries.d.ts | 117 ++++++++++++++++-- .../test/bidi/logEntries.ts | 97 ++++++++++++++- 2 files changed, 204 insertions(+), 10 deletions(-) diff --git a/types/selenium-webdriver/bidi/logEntries.d.ts b/types/selenium-webdriver/bidi/logEntries.d.ts index 86286259237819..aea7697c937d7e 100644 --- a/types/selenium-webdriver/bidi/logEntries.d.ts +++ b/types/selenium-webdriver/bidi/logEntries.d.ts @@ -1,35 +1,138 @@ +import { ScriptSource, Source } from "./scriptTypes"; + +/** + * Represents a base log entry. + * Described in https://w3c.github.io/webdriver-bidi/#types-log-logentry. + */ declare class BaseLogEntry { - constructor(level: string, text: string, timeStamp: Date, stackTrace: string); + /** + * Creates a new instance of BaseLogEntry. + * @param level - The log level. + * @param source - Script Source + * @param text - The log text. + * @param timeStamp - The log timestamp. + * @param stackTrace - The log stack trace. + */ + constructor( + level: string, + source: ScriptSource, + text: string, + timeStamp: number, + stackTrace: string, + ); + /** + * Gets the log level. + */ readonly level: string; + + /** + * Gets the log source. + */ + readonly source: Source; + + /** + * Gets the log text. + */ readonly text: string; - readonly timeStamp: Date; + + /** + * Gets the log timestamp. + */ + readonly timeStamp: number; + + /** + * Gets the log stack trace. + */ readonly stackTrace: string; } +/** + * Represents a generic log entry. + */ declare class GenericLogEntry extends BaseLogEntry { - constructor(level: string, text: string, timeStamp: Date, type: string, stackTrace: string); + /** + * Creates an instance of GenericLogEntry. + * @param level - The log level. + * @param source - Script Source + * @param text - The log text. + * @param timeStamp - The log timestamp. + * @param type - The log type. + * @param stackTrace - The log stack trace. + */ + constructor( + level: string, + source: ScriptSource, + text: string, + timeStamp: number, + type: string, + stackTrace: string, + ); + /** + * Gets the log type. + */ readonly type: string; } +/** + * Represents a log entry for console logs. + */ declare class ConsoleLogEntry extends GenericLogEntry { + /** + * Creates an instance of ConsoleLogEntry. + * @param level - The log level. + * @param source - Script Source + * @param text - The log text. + * @param timeStamp - The log timestamp. + * @param type - The log type. + * @param method - The method. + * @param args - The arguments. + * @param stackTrace - The log stack trace. + */ constructor( level: string, + source: ScriptSource, text: string, - timeStamp: Date, + timeStamp: number, type: string, method: string, - realm: string, args: any[], stackTrace: string, ); + /** + * Gets the method associated with the log entry. + */ readonly method: string; - readonly realm: string; + + /** + * Gets the arguments associated with the log entry. + */ readonly args: any[]; } -declare class JavascriptLogEntry extends GenericLogEntry {} +/** + * Represents a log entry for JavaScript logs. + */ +declare class JavascriptLogEntry extends GenericLogEntry { + /** + * Creates an instance of JavascriptLogEntry. + * @param level - The log level. + * @param source - Script Source + * @param text - The log text. + * @param timeStamp - The log timestamp. + * @param type - The log type. + * @param stackTrace - The log stack trace. + */ + constructor( + level: string, + source: ScriptSource, + text: string, + timeStamp: number, + type: string, + stackTrace: string, + ); +} export { BaseLogEntry, ConsoleLogEntry, GenericLogEntry, JavascriptLogEntry }; diff --git a/types/selenium-webdriver/test/bidi/logEntries.ts b/types/selenium-webdriver/test/bidi/logEntries.ts index 191d8ac9f2cfac..36ea3ce2db29e0 100644 --- a/types/selenium-webdriver/test/bidi/logEntries.ts +++ b/types/selenium-webdriver/test/bidi/logEntries.ts @@ -1,5 +1,96 @@ -import { BaseLogEntry } from "selenium-webdriver/bidi/logEntries"; +import { BaseLogEntry, ConsoleLogEntry, GenericLogEntry, JavascriptLogEntry } from "selenium-webdriver/bidi/logEntries"; -function TestBaseLogEntry() { - return new BaseLogEntry("info", "hello", new Date(), ""); +{ + // $ExpectType BaseLogEntry + const baseLogEntry = new BaseLogEntry("info", { realm: "" }, "hello", 1234, ""); + + // $ExpectType string + baseLogEntry.level; + + // $ExpectType Source + baseLogEntry.source; + + // $ExpectType string + baseLogEntry.text; + + // $ExpectType number + baseLogEntry.timeStamp; + + // $ExpectType string + baseLogEntry.stackTrace; +} + +{ + // $ExpectType GenericLogEntry + const genericLogEntry = new GenericLogEntry("info", { realm: "" }, "hello", 1234, "type", ""); + + // $ExpectType string + genericLogEntry.type; + + // $ExpectType string + genericLogEntry.level; + + // $ExpectType Source + genericLogEntry.source; + + // $ExpectType string + genericLogEntry.text; + + // $ExpectType number + genericLogEntry.timeStamp; + + // $ExpectType string + genericLogEntry.stackTrace; +} + +{ + // $ExpectType ConsoleLogEntry + const consoleLogEntry = new ConsoleLogEntry("info", { realm: "" }, "hello", 1234, "type", "method", [], ""); + + // $ExpectType string + consoleLogEntry.method; + + // $ExpectType any[] + consoleLogEntry.args; + + // $ExpectType string + consoleLogEntry.type; + + // $ExpectType string + consoleLogEntry.level; + + // $ExpectType Source + consoleLogEntry.source; + + // $ExpectType string + consoleLogEntry.text; + + // $ExpectType number + consoleLogEntry.timeStamp; + + // $ExpectType string + consoleLogEntry.stackTrace; +} + +{ + // $ExpectType JavascriptLogEntry + const javascriptLogEntry = new JavascriptLogEntry("info", { realm: "" }, "hello", 1234, "type", ""); + + // $ExpectType string + javascriptLogEntry.type; + + // $ExpectType string + javascriptLogEntry.level; + + // $ExpectType Source + javascriptLogEntry.source; + + // $ExpectType string + javascriptLogEntry.text; + + // $ExpectType number + javascriptLogEntry.timeStamp; + + // $ExpectType string + javascriptLogEntry.stackTrace; } From 42a73140f1f7f4cda1318713a6b860e28d57921a Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Fri, 14 Nov 2025 19:50:23 +0100 Subject: [PATCH 09/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73878=20[ali?= =?UTF-8?q?-oss]=20add=20missing=20signatureUrlV4=20type=20declaration=20b?= =?UTF-8?q?y=20@KuSh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/ali-oss/ali-oss-tests.ts | 36 ++++++++++++++++++++++++++++++++++ types/ali-oss/index.d.ts | 19 ++++++++++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/types/ali-oss/ali-oss-tests.ts b/types/ali-oss/ali-oss-tests.ts index 14fcc34ce57376..f535ce3a3d02f0 100644 --- a/types/ali-oss/ali-oss-tests.ts +++ b/types/ali-oss/ali-oss-tests.ts @@ -22,6 +22,42 @@ const clusterClient = new OSS.ClusterClient(clusterOptions); clusterClient.deleteMulti(["cluster"], { quiet: true }); +// $ExpectType string +clusterClient.signatureUrl("ossdemo.txt", { + expires: 3600, + response: { "content-type": "text/custom", "content-disposition": "attachment" }, +}, false); + +// $ExpectType Promise +clusterClient.asyncSignatureUrl("ossdemo.txt", { + expires: 3600, + response: { "content-type": "text/custom", "content-disposition": "attachment" }, +}, false); + +// $ExpectType Promise +clusterClient.signatureUrlV4("GET", 60, undefined, "your object name"); + +// $ExpectType Promise +clusterClient.signatureUrlV4( + "GET", + 60, + { headers: { "Cache-Control": "no-cache" }, queries: { versionId: "version ID of your object" } }, + "your object name", + ["Cache-Control"], +); + +// $ExpectType Promise +clusterClient.signatureUrlV4("PUT", 60, undefined, "your object name"); + +// $ExpectType Promise +clusterClient.signatureUrlV4( + "PUT", + 60, + { headers: { "Content-Type": "text/plain", "Content-MD5": "xxx", "Content-Length": 1 } }, + "your obejct name", + ["Content-Length"], +); + const imageOptions: OSS.ImageClientOptions = { imageHost: "xxxx", accessKeyId: "xxxx", diff --git a/types/ali-oss/index.d.ts b/types/ali-oss/index.d.ts index 125ce47e056d0a..cfbad9395b9b30 100644 --- a/types/ali-oss/index.d.ts +++ b/types/ali-oss/index.d.ts @@ -693,9 +693,24 @@ declare namespace OSS { deleteMulti(names: string[], options?: DeleteMultiOptions): Promise; - signatureUrl(name: string, options?: SignatureUrlOptions): string; + signatureUrl(name: string, options?: SignatureUrlOptions, strictObjectNameValidation?: boolean): string; + + signatureUrlV4( + method: HTTPMethods, + expires: number, + request?: { + headers?: object | undefined; + queries?: object | undefined; + }, + objectName?: string, + additionalHeaders?: string[], + ): Promise; - asyncSignatureUrl(name: string, options?: SignatureUrlOptions): Promise; + asyncSignatureUrl( + name: string, + options?: SignatureUrlOptions, + strictObjectNameValidation?: boolean, + ): Promise; putACL(name: string, acl: ACLType, options?: RequestOptions): Promise; From 13944668ee84423e599655731ee66752477e0342 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 10:57:16 -0800 Subject: [PATCH 10/18] Remove contributors with deleted accounts (#74005) Co-authored-by: TypeScript Bot From 5158d089c51fb2c6dcac123e896ba95075e1849a Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Fri, 14 Nov 2025 20:29:43 +0100 Subject: [PATCH 11/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73880=20[rol?= =?UTF-8?q?lup-plugin-peer-deps-external]=20fix:=20don't=20depend=20on=20a?= =?UTF-8?q?=20specific=20rollup=20version=20by=20@KuSh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/rollup-plugin-peer-deps-external/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/rollup-plugin-peer-deps-external/package.json b/types/rollup-plugin-peer-deps-external/package.json index 32623dadd0904d..cb08608158289d 100644 --- a/types/rollup-plugin-peer-deps-external/package.json +++ b/types/rollup-plugin-peer-deps-external/package.json @@ -5,12 +5,12 @@ "projects": [ "https://github.com/Updater/rollup-plugin-peer-deps-external" ], - "dependencies": { - "rollup": "^0.63.4" - }, "devDependencies": { "@types/rollup-plugin-peer-deps-external": "workspace:." }, + "peerDependencies": { + "rollup": "*" + }, "owners": [ { "name": "Nick", From f8dd43ad8bbec454c063560987295d3780e0bbec Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Fri, 14 Nov 2025 20:30:14 +0100 Subject: [PATCH 12/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73881=20[doc?= =?UTF-8?q?kerode]=20add=20missing=20pruneBuilder=20type=20definition=20by?= =?UTF-8?q?=20@KuSh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/dockerode/dockerode-tests.ts | 4 ++++ types/dockerode/index.d.ts | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/types/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts index 898790e9ea0c7b..bd7fa57ff3b92e 100644 --- a/types/dockerode/dockerode-tests.ts +++ b/types/dockerode/dockerode-tests.ts @@ -499,6 +499,10 @@ docker.pruneImages((err, response) => { // NOOP }); +docker.pruneBuilder((err, response) => { + // NOOP +}); + docker.pruneNetworks((err, response) => { // NOOP }); diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 7d02c6c8b21fa9..6d519472359694 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -2043,6 +2043,14 @@ declare namespace Dockerode { SpaceReclaimed: number; } + interface PruneBuilderOptions { + abortSignal?: AbortSignal; + } + + interface PruneBuilderInfo { + SpaceReclaimed: number; + } + interface PruneVolumesInfo { VolumesDeleted: string[]; SpaceReclaimed: number; @@ -2269,6 +2277,10 @@ declare class Dockerode { pruneImages(callback: Callback): void; pruneImages(options?: {}): Promise; + pruneBuilder(options: Dockerode.PruneBuilderOptions, callback: Callback): void; + pruneBuilder(callback: Callback): void; + pruneBuilder(options?: Dockerode.PruneBuilderOptions): Promise; + pruneContainers(options: {}, callback: Callback): void; pruneContainers(callback: Callback): void; pruneContainers(options?: {}): Promise; From aad4ef4dd3d65cf4e067cc097eab6924c10783f4 Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Fri, 14 Nov 2025 20:42:24 +0100 Subject: [PATCH 13/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74072=20[chr?= =?UTF-8?q?ome]=20update=20storage=20namespace=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 226 +++++++++++++--------------------- types/chrome/test/index.ts | 244 +++++++++++++++++++++---------------- 2 files changed, 226 insertions(+), 244 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index e25f56db496a1f..e50f00a491d749 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -10025,209 +10025,157 @@ declare namespace chrome { export interface StorageArea { /** * Gets the amount of space (in bytes) being used by one or more items. - * @param keys Optional. A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. - * @return A Promise that resolves with a number - * @since MV3 + * @param keys A single key or list of keys to get the total usage for. An empty list will return 0. Pass in `null` to get the total usage of all of storage. + * + * Can return its result via Promise in Manifest V3 or later since Chrome 95. */ + getBytesInUse(keys: never[]): Promise<0>; getBytesInUse(keys?: keyof T | Array | null): Promise; - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param keys Optional. A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ + getBytesInUse(callback: (bytesInUse: number) => void): void; + getBytesInUse(keys: never[], callback: (bytesInUse: 0) => void): void; getBytesInUse( - keys: keyof T | Array | null, + keys: keyof T | Array | null | undefined, callback: (bytesInUse: number) => void, ): void; - /** - * Gets the amount of space (in bytes) being used by one or more items. - * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). - * Parameter bytesInUse: Amount of space being used in storage, in bytes. - */ - getBytesInUse(callback: (bytesInUse: number) => void): void; + /** * Removes all items from storage. - * @return A void Promise - * @since MV3 + * + * Can return its result via Promise in Manifest V3 or later since Chrome 95. */ clear(): Promise; - /** - * Removes all items from storage. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ clear(callback: () => void): void; + /** * Sets multiple items. - * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. - * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). - * @return A void Promise - * @since MV3 + * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. Primitive values such as numbers will serialize as expected. Values with a `typeof` `object` and `function` will typically serialize to `{}`, with the exception of `Array` (serializes as expected), `Date`, and `Regex` (serialize using their `String` representation). + * + * Can return its result via Promise in Manifest V3 or later since Chrome 95. */ set(items: Partial): Promise; - /** - * Sets multiple items. - * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. - * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ set(items: Partial, callback: () => void): void; + /** * Removes one or more items from storage. * @param keys A single key or a list of keys for items to remove. - * @param callback Optional. - * @return A void Promise - * @since MV3 + * + * Can return its result via Promise in Manifest V3 or later since Chrome 95. */ remove(keys: keyof T | Array): Promise; - /** - * Removes one or more items from storage. - * @param keys A single key or a list of keys for items to remove. - * @param callback Optional. - * Callback on success, or on failure (in which case runtime.lastError will be set). - */ remove(keys: keyof T | Array, callback: () => void): void; + /** * Gets one or more items from storage. - * @param keys A single key to get, list of keys to get, or a dictionary specifying default values. - * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. - * @return A Promise that resolves with an object containing items - * @since MV3 + * @param keys A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in `null` to get the entire contents of storage. + * + * Can return its result via Promise in Manifest V3 or later since Chrome 95. */ - get( + get(keys: never[] | Record): Promise<{ [key: string]: never }>; + get( keys?: NoInferX | Array> | Partial> | null, ): Promise; - /** - * Gets one or more items from storage. - * @param keys A single key to get, list of keys to get, or a dictionary specifying default values. - * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get( - keys: NoInferX | Array> | Partial> | null, + get(callback: (items: T) => void): void; + get(keys: never[] | Record, callback: (items: { [key: string]: never }) => void): void; + get( + keys: NoInferX | Array> | Partial> | null | undefined, callback: (items: T) => void, ): void; + /** - * Gets the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - get(callback: (items: T) => void): void; - /** - * Sets the desired access level for the storage area. By default, session storage is restricted to trusted contexts (extension pages and service workers), while managed, local, and sync storage allow access from both trusted and untrusted contexts. - * @param accessOptions An object containing an accessLevel key which contains the access level of the storage area. - * @return A void Promise. - * @since Chrome 102 - */ - setAccessLevel(accessOptions: { accessLevel: AccessLevel }): Promise; - /** - * Sets the desired access level for the storage area. By default, session storage is restricted to trusted contexts (extension pages and service workers), while managed, local, and sync storage allow access from both trusted and untrusted contexts. - * @param accessOptions An object containing an accessLevel key which contains the access level of the storage area. - * @param callback Optional. + * Sets the desired access level for the storage area. By default, session storage is restricted to trusted contexts (extension pages and service workers), while `managed`, `local`, and `sync` storage allow access from both trusted and untrusted contexts. + * @param accessOptions The access level of the storage area. + * + * Can return its result via Promise in Manifest V3 or later. * @since Chrome 102 */ - setAccessLevel(accessOptions: { accessLevel: AccessLevel }, callback: () => void): void; - /** - * Fired when one or more items change within this storage area. - * @param keys A single key to get, list of keys to get, or a dictionary specifying default values. - * An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. - * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). - * Parameter items: Object with items in their key-value mappings. - */ - onChanged: StorageAreaChangedEvent; + setAccessLevel(accessOptions: { accessLevel: `${AccessLevel}` }): Promise; + setAccessLevel(accessOptions: { accessLevel: `${AccessLevel}` }, callback: () => void): void; + + /** Fired when one or more items change. */ + onChanged: events.Event<(changes: { [key: string]: StorageChange }) => void>; + /** * Gets all keys from storage. - * @return A Promise that resolves with an array of keys. + * + * Can return its result via Promise in Manifest V3 or later. * @since Chrome 130 */ getKeys(): Promise; - /** - * Gets all keys from storage. - * @param callback Callback with storage keys. - * Parameter keys: Array of keys in storage. - * @since Chrome 130 - */ getKeys(callback: (keys: string[]) => void): void; } export interface StorageChange { - /** Optional. The new value of the item, if there is a new value. */ - newValue?: any; - /** Optional. The old value of the item, if there was an old value. */ - oldValue?: any; + /** The new value of the item, if there is a new value. */ + newValue?: unknown; + /** The old value of the item, if there was an old value. */ + oldValue?: unknown; } export interface LocalStorageArea extends StorageArea { - /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; + /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or a rejected Promise if using async/await. */ + QUOTA_BYTES: 10485760; } export interface SyncStorageArea extends StorageArea { - /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ - MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; - /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; - /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ - QUOTA_BYTES_PER_ITEM: number; - /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ - MAX_ITEMS: number; - /** - * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. - * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + /** @deprecated The storage.sync API no longer has a sustained write operation quota. */ + MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000; + /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ + QUOTA_BYTES: 102400; + /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ + QUOTA_BYTES_PER_ITEM: 8192; + /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ + MAX_ITEMS: 512; + /** + * The maximum number of `set`, `remove`, or `clear` operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. + * + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ - MAX_WRITE_OPERATIONS_PER_HOUR: number; + MAX_WRITE_OPERATIONS_PER_HOUR: 1800; /** - * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. - * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. - * @since Chrome 40 + * The maximum number of `set`, `remove`, or `clear` operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. + * + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ - MAX_WRITE_OPERATIONS_PER_MINUTE: number; + MAX_WRITE_OPERATIONS_PER_MINUTE: 120; } export interface SessionStorageArea extends StorageArea { - /** The maximum amount (in bytes) of data that can be stored in memory, as measured by estimating the dynamically allocated memory usage of every value and key. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ - QUOTA_BYTES: number; + /** The maximum amount (in bytes) of data that can be stored in memory, as measured by estimating the dynamically allocated memory usage of every value and key. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ + QUOTA_BYTES: 10485760; } - export interface StorageAreaChangedEvent - extends chrome.events.Event<(changes: { [key: string]: StorageChange }) => void> - {} - - export type AreaName = keyof Pick; - export interface StorageChangedEvent - extends chrome.events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void> - {} + export type AreaName = "sync" | "local" | "managed" | "session"; - export type AccessLevel = keyof typeof AccessLevel; + /** + * The storage area's access level. + * @since Chrome 102 + */ + export enum AccessLevel { + /** Specifies contexts originating from the extension itself. */ + TRUSTED_CONTEXTS = "TRUSTED_CONTEXTS", + /** Specifies contexts originating from outside the extension. */ + TRUSTED_AND_UNTRUSTED_CONTEXTS = "TRUSTED_AND_UNTRUSTED_CONTEXTS", + } - /** The storage area's access level. */ - export var AccessLevel: { - TRUSTED_AND_UNTRUSTED_CONTEXTS: "TRUSTED_AND_UNTRUSTED_CONTEXTS"; - TRUSTED_CONTEXTS: "TRUSTED_CONTEXTS"; - }; + /** Items in the `local` storage area are local to each machine. */ + export const local: LocalStorageArea; - /** Items in the local storage area are local to each machine. */ - export var local: LocalStorageArea; - /** Items in the sync storage area are synced using Chrome Sync. */ - export var sync: SyncStorageArea; + /** Items in the `sync` storage area are synced using Chrome Sync. */ + export const sync: SyncStorageArea; - /** - * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. - * @since Chrome 33 - */ - export var managed: StorageArea; + /** Items in the `managed` storage area are set by an enterprise policy configured by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. For information on configuring a policy, see Manifest for storage areas. */ + export const managed: StorageArea; /** - * Items in the session storage area are stored in-memory and will not be persisted to disk. + * Items in the `session` storage area are stored in-memory and will not be persisted to disk. + * + * MV3 only * @since Chrome 102 */ - export var session: SessionStorageArea; + export const session: SessionStorageArea; /** Fired when one or more items change. */ - export var onChanged: StorageChangedEvent; + export const onChanged: events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void>; } //////////////////// diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index 02a77db8fa2cb3..cfa02584508798 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -1345,107 +1345,166 @@ function testDeclarativeContent() { // https://developer.chrome.com/extensions/storage#type-StorageArea function testStorage() { + chrome.storage.AccessLevel.TRUSTED_AND_UNTRUSTED_CONTEXTS === "TRUSTED_AND_UNTRUSTED_CONTEXTS"; + chrome.storage.AccessLevel.TRUSTED_CONTEXTS === "TRUSTED_CONTEXTS"; + + const key = "key"; + const badKey = "badKey"; + interface StorageData { - myKey: { + key: string; + key2: { x: number; y: number; z?: number; }; - myKey2: string; - } - - function getCallback(loadedData: { [key: string]: any }) { - console.log(loadedData.myKey.x + loadedData.myKey.y); - } - - function getCallbackTyped(loadedData: StorageData) { - console.log(loadedData.myKey.x + loadedData.myKey.y); } // @ts-expect-error const testNoInferX: chrome.storage.NoInferX = "This test checks if NoInferX is accidentally exported"; - chrome.storage.sync.get("myKey", getCallback); - chrome.storage.sync.get("badKey", getCallback); - // @ts-expect-error - chrome.storage.sync.get("badKey", getCallbackTyped); - // @ts-expect-error - chrome.storage.sync.get({ myKey: { badKey: true } }, getCallbackTyped); - chrome.storage.sync.get(null, (data) => { - console.log(data.myKey); - }); - chrome.storage.sync.get((data: any) => { - console.log(data.badKey); - }); - - chrome.storage.sync.get(getCallbackTyped); - chrome.storage.sync.get("myKey", getCallbackTyped); - chrome.storage.sync.get(["myKey", "myKey2"], getCallbackTyped); - chrome.storage.sync.get({ myKey: { x: 1, y: 2 } }, getCallbackTyped); - // @ts-expect-error - chrome.storage.sync.get({ myKey: { badKey: true } }, getCallback); - // @ts-expect-error - chrome.storage.sync.get({ myKey: { badKey: true } }, getCallbackTyped); - chrome.storage.sync.get(null, getCallbackTyped); - - function getBytesInUseCallback(bytesInUse: number) { - console.log(bytesInUse); - } + const StorageArea = ["sync", "managed", "local", "session"] as const; - chrome.storage.sync.getBytesInUse(getBytesInUseCallback); - chrome.storage.sync.getBytesInUse("myKey", getBytesInUseCallback); - chrome.storage.sync.getBytesInUse("badKey", getBytesInUseCallback); + StorageArea.forEach((area) => { + chrome.storage[area].clear(); // $ExpectType Promise + chrome.storage[area].clear(() => void 0); // $ExpectType void + // @ts-expect-error + chrome.storage[area].clear(() => void 0).then(() => {}); + + chrome.storage[area].get(); // $ExpectType Promise<{ [key: string]: unknown; }> + chrome.storage[area].get(null); // $ExpectType Promise<{ [key: string]: unknown; }> + chrome.storage[area].get(key); // $ExpectType Promise<{ [key: string]: unknown; }> + chrome.storage[area].get([]); // $ExpectType Promise<{ [key: string]: never; }> + chrome.storage[area].get([key]); // $ExpectType Promise<{ [key: string]: unknown; }> + chrome.storage[area].get({}); // $ExpectType Promise<{ [key: string]: never; }> + chrome.storage[area].get({ key }); // $ExpectType Promise<{ [key: string]: unknown; }> + chrome.storage[area].get(badKey); // $ExpectType Promise<{ [key: string]: unknown; }> + chrome.storage[area].get(key); // $ExpectType Promise + chrome.storage[area].get(undefined, (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: unknown; } + }); + chrome.storage[area].get(null, (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: unknown; } + }); + chrome.storage[area].get(key, (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: unknown; } + }); + chrome.storage[area].get([], (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: never; } + }); + chrome.storage[area].get([key], (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: unknown; } + }); + chrome.storage[area].get({ key }, (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: unknown; } + }); + chrome.storage[area].get({}, (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: never; } + }); + chrome.storage[area].get(badKey, (items) => { // $ExpectType void + items; // $ExpectType { [key: string]: unknown; } + }); + chrome.storage[area].get(key, (items) => { // $ExpectType void + items; // $ExpectType StorageData + }); + // @ts-expect-error + chrome.storage[area].get(badKey); + // @ts-expect-error + chrome.storage[area].get(undefined, () => {}).then(() => {}); + + chrome.storage[area].getBytesInUse(); // $ExpectType Promise + chrome.storage[area].getBytesInUse(null); // $ExpectType Promise + chrome.storage[area].getBytesInUse(key); // $ExpectType Promise + chrome.storage[area].getBytesInUse([key]); // $ExpectType Promise + chrome.storage[area].getBytesInUse([]); // $ExpectType Promise<0> + chrome.storage[area].getBytesInUse(badKey); // $ExpectType Promise + chrome.storage[area].getBytesInUse(key); // $ExpectType Promise + chrome.storage[area].getBytesInUse(key); // $ExpectType Promise + chrome.storage[area].getBytesInUse(undefined, (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType number + }); + chrome.storage[area].getBytesInUse(null, (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType number + }); + chrome.storage[area].getBytesInUse(key, (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType number + }); + chrome.storage[area].getBytesInUse([key], (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType number + }); + chrome.storage[area].getBytesInUse([], (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType 0 + }); + chrome.storage[area].getBytesInUse(badKey, (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType number + }); + chrome.storage[area].getBytesInUse(key, (bytesInUse) => { // $ExpectType void + bytesInUse; // $ExpectType number + }); + // @ts-expect-error + chrome.storage[area].getBytesInUse(badKey); + // @ts-expect-error + chrome.storage[area].getBytesInUse(() => {}).then(() => {}); - chrome.storage.sync.getBytesInUse("myKey", getBytesInUseCallback); - chrome.storage.sync.getBytesInUse(["myKey", "myKey2"], getBytesInUseCallback); - chrome.storage.sync.getBytesInUse(null, getBytesInUseCallback); - // @ts-expect-error - chrome.storage.sync.getBytesInUse(["badKey", "myKey2"], getBytesInUseCallback); + chrome.storage[area].getKeys(); // $ExpectType Promise + chrome.storage[area].getKeys((keys) => { // $ExpectType void + keys; // $ExpectType string[] + }); + // @ts-expect-error + chrome.storage[area].getKeys(() => {}).then(() => {}); + + chrome.storage[area].remove(key); // $ExpectType Promise + chrome.storage[area].remove([key]); // $ExpectType Promise + chrome.storage[area].remove(badKey); // $ExpectType Promise + chrome.storage[area].remove(key); // $ExpectType Promise + chrome.storage[area].remove(key, () => {}); // $ExpectType void + chrome.storage[area].remove([key], () => {}); // $ExpectType void + chrome.storage[area].remove(badKey, () => {}); // $ExpectType void + chrome.storage[area].remove(key, () => {}); // $ExpectType void + // @ts-expect-error + chrome.storage[area].remove(badKey); + // @ts-expect-error + chrome.storage[area].remove(() => {}).then(() => {}); - function doneCallback() { - console.log("done"); - } + chrome.storage[area].set({ key }); // $ExpectType Promise + chrome.storage[area].set({ badKey }); // $ExpectType Promise + chrome.storage[area].set({ key }, () => void 0); // $ExpectType void + chrome.storage[area].set({ badKey }, () => void 0); // $ExpectType void + chrome.storage[area].set({ key }, () => void 0); // $ExpectType void + // @ts-expect-error + chrome.storage[area].set({ badKey }); + // @ts-expect-error + chrome.storage[area].set({}, () => {}).then(() => {}); - chrome.storage.sync.set({ badKey: true }); - chrome.storage.sync.set({ myKey: { x: 1, y: 2 } }); - chrome.storage.sync.set({ myKey2: "hello world" }, doneCallback); - // @ts-expect-error - chrome.storage.sync.set({ badKey: "hello world" }, doneCallback); + const accessLevel = "TRUSTED_AND_UNTRUSTED_CONTEXTS"; - chrome.storage.sync.remove("badKey"); - chrome.storage.sync.remove("myKey"); - chrome.storage.sync.remove("myKey", doneCallback); - chrome.storage.sync.remove(["myKey", "myKey2"]); - chrome.storage.sync.remove(["myKey", "myKey2"], doneCallback); - // @ts-expect-error - chrome.storage.sync.remove(["badKey", "myKey2"], doneCallback); + chrome.storage[area].setAccessLevel({ accessLevel }); // $ExpectType Promise + chrome.storage[area].setAccessLevel({ accessLevel }, () => void 0); // $ExpectType void + // @ts-expect-error + chrome.storage[area].setAccessLevel({ accessLevel }, () => void 0).then(() => {}); - chrome.storage.sync.clear(); - chrome.storage.sync.clear(doneCallback); + checkChromeEvent(chrome.storage[area].onChanged, (changes) => { + changes[key].newValue; // $ExpectType unknown + changes[key].oldValue; // $ExpectType unknown + }); + }); - chrome.storage.sync.setAccessLevel({ accessLevel: chrome.storage.AccessLevel.TRUSTED_AND_UNTRUSTED_CONTEXTS }); - chrome.storage.sync.setAccessLevel( - { accessLevel: chrome.storage.AccessLevel.TRUSTED_AND_UNTRUSTED_CONTEXTS }, - doneCallback, - ); + chrome.storage.local.QUOTA_BYTES === 10485760; - chrome.storage.sync.onChanged.addListener(function(changes) { - var myNewValue: { x: number } = changes["myKey"].newValue; - var myOldValue: { x: number } = changes["myKey"].oldValue; - }); + chrome.storage.session.QUOTA_BYTES === 10485760; - chrome.storage.onChanged.addListener(function(changes, areaName) { - var area: string = areaName; - var myNewValue: { x: number } = changes["myKey"].newValue; - var myOldValue: { x: number } = changes["myKey"].oldValue; - }); + chrome.storage.sync.MAX_ITEMS === 512; + chrome.storage.sync.MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE === 1000000; + chrome.storage.sync.MAX_WRITE_OPERATIONS_PER_HOUR === 1800; + chrome.storage.sync.MAX_WRITE_OPERATIONS_PER_MINUTE === 120; + chrome.storage.sync.QUOTA_BYTES === 102400; + chrome.storage.sync.QUOTA_BYTES_PER_ITEM === 8192; - chrome.storage.sync.getKeys(); // $ExpectType Promise - chrome.storage.sync.getKeys((keys) => { // $ExpectType void - keys; // $ExpectType string[] + checkChromeEvent(chrome.storage.onChanged, (changes, areaName) => { + changes[key].newValue; // $ExpectType unknown + changes[key].oldValue; // $ExpectType unknown + areaName; // $ExpectType AreaName }); - // @ts-expect-error - chrome.storage.sync.getKeys(() => {}).then(() => {}); } // https://developer.chrome.com/docs/extensions/reference/api/tss @@ -4183,31 +4242,6 @@ function testDeclarativeWebRequest() { }); } -// https://developer.chrome.com/docs/extensions/reference/storage -function testStorageForPromise() { - chrome.storage.sync.getBytesInUse().then(() => {}); - chrome.storage.sync.getBytesInUse(null).then(() => {}); - chrome.storage.sync.getBytesInUse("testKey").then(() => {}); - chrome.storage.sync.getBytesInUse(["testKey"]).then(() => {}); - - chrome.storage.sync.clear().then(() => {}); - - chrome.storage.sync.set({ testKey: "testValue" }).then(() => {}); - - chrome.storage.sync.remove("testKey").then(() => {}); - chrome.storage.sync.remove(["testKey"]).then(() => {}); - - chrome.storage.sync.get().then(() => {}); - chrome.storage.sync.get(null).then(() => {}); - chrome.storage.sync.get("testKey").then(() => {}); - chrome.storage.sync.get(["testKey"]).then(() => {}); - chrome.storage.sync.get({ testKey: "testDefaultValue" }).then(() => {}); - - chrome.storage.sync.setAccessLevel({ accessLevel: chrome.storage.AccessLevel.TRUSTED_AND_UNTRUSTED_CONTEXTS }).then( - () => {}, - ); -} - // https://developer.chrome.com/docs/extensions/reference/api/contextMenus function testContextMenus() { chrome.contextMenus.ContextType.ACTION === "action"; From 38242a185128aaa7ce625456c877678f6d68a431 Mon Sep 17 00:00:00 2001 From: Claudio Procida <860099+claudiopro@users.noreply.github.com> Date: Fri, 14 Nov 2025 22:13:08 +0100 Subject: [PATCH 14/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74079=20chor?= =?UTF-8?q?e:=20remove=20@claudiopro=20from=20draft-js=20owners=20by=20@cl?= =?UTF-8?q?audiopro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 5 +---- types/draft-js/package.json | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index eb89f79b2c9929..35f70b5cb1f512 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1600,7 +1600,7 @@ /types/draco3d/ @donmccurdy @horizon0514 /types/draco3dgltf/ @donmccurdy /types/draft-convert/ @avaleriani @vadim-ch -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro @khawkinson @PeterDekkers @ankitr +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @khawkinson @PeterDekkers @ankitr /types/draftjs-to-html/ @1cheese /types/drag-controls/ @MGHawes /types/drag-timetable/ @chinkan @@ -3220,7 +3220,6 @@ /types/html-escaper/ @panManfredini /types/html-minifier/ @tkrotoff @peterblazejewicz /types/html-minifier/v1/ @tkrotoff -/types/html-minifier-next/ @orpheus6678 /types/html-minifier-terser/ @peterblazejewicz /types/html-parser/ @maxbogus /types/html-pdf/ @westy92 @@ -5600,7 +5599,6 @@ /types/password-hash/ @mugeso /types/password-hash-and-salt/ @alitaheri /types/path-browserify/ @Methuselah96 -/types/path-complete-extname/ @melangue /types/path-is-absolute/ @mhegazy /types/path-is-inside/ @aomarks /types/path-regex/ @BendingBender @@ -6246,7 +6244,6 @@ /types/react-gamepad/ @eventualbuddha /types/react-gateway/ @jsonunger /types/react-gauge-chart/ @meirkl -/types/react-geocode/ @stevemu /types/react-geosuggest/ @brmenchl /types/react-github-button/ @ifiokjr /types/react-global-configuration/ @ryokik diff --git a/types/draft-js/package.json b/types/draft-js/package.json index 4244775c7df54e..b1e1b96381bcf6 100644 --- a/types/draft-js/package.json +++ b/types/draft-js/package.json @@ -49,10 +49,6 @@ "name": "Pablo Varela", "githubUsername": "pablopunk" }, - { - "name": "Claudio Procida", - "githubUsername": "claudiopro" - }, { "name": "Kevin Hawkinson", "githubUsername": "khawkinson" From 1bd8116e0811529ffcc19c54d885dd6a5456e1b8 Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Fri, 14 Nov 2025 22:13:59 +0100 Subject: [PATCH 15/18] [react] Remove `digest` from `ErrorInfo` (#74085) --- types/react/index.d.ts | 1 - types/react/ts5.0/index.d.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/types/react/index.d.ts b/types/react/index.d.ts index 00b03984285762..c8933b3cf95add 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -4057,7 +4057,6 @@ declare namespace React { * Captures which component contained the exception, and its ancestors. */ componentStack?: string | null; - digest?: string | null; } // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts diff --git a/types/react/ts5.0/index.d.ts b/types/react/ts5.0/index.d.ts index f05b815083b901..ca6c833005fc3d 100644 --- a/types/react/ts5.0/index.d.ts +++ b/types/react/ts5.0/index.d.ts @@ -4056,7 +4056,6 @@ declare namespace React { * Captures which component contained the exception, and its ancestors. */ componentStack?: string | null; - digest?: string | null; } // Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts From 07cc59228bf801717a5c474aa9f6ec88616026eb Mon Sep 17 00:00:00 2001 From: Aidin Abedi Date: Fri, 14 Nov 2025 22:17:47 +0100 Subject: [PATCH 16/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73991=20Add?= =?UTF-8?q?=20@types/js-untar=20type=20definitions=20by=20@aidinabedi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/js-untar/.npmignore | 5 ++ types/js-untar/index.d.ts | 33 +++++++++++++ types/js-untar/js-untar-tests.ts | 80 ++++++++++++++++++++++++++++++++ types/js-untar/package.json | 17 +++++++ types/js-untar/tsconfig.json | 20 ++++++++ 5 files changed, 155 insertions(+) create mode 100644 types/js-untar/.npmignore create mode 100644 types/js-untar/index.d.ts create mode 100644 types/js-untar/js-untar-tests.ts create mode 100644 types/js-untar/package.json create mode 100644 types/js-untar/tsconfig.json diff --git a/types/js-untar/.npmignore b/types/js-untar/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/js-untar/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/js-untar/index.d.ts b/types/js-untar/index.d.ts new file mode 100644 index 00000000000000..1dbb9baab28a91 --- /dev/null +++ b/types/js-untar/index.d.ts @@ -0,0 +1,33 @@ +declare namespace untar { + interface ProgressivePromise extends Promise { + progress(cb: (arg: P) => void): this; + } + + interface TarFile { + name: string; + mode: string; + uid: number; + gid: number; + size: number; + mtime: number; + checksum: number; + type: string; + linkname: string; + ustarFormat: string; + version?: string; + uname?: string; + gname?: string; + devmajor?: number; + devminor?: number; + namePrefix?: string; + buffer: ArrayBuffer; + blob(): Blob; + getBlobUrl(): URL; + readAsString(): string; + readAsJSON(): any; + } +} + +declare function untar(arrayBuffer: ArrayBuffer): untar.ProgressivePromise; + +export = untar; diff --git a/types/js-untar/js-untar-tests.ts b/types/js-untar/js-untar-tests.ts new file mode 100644 index 00000000000000..1366d6ee58476a --- /dev/null +++ b/types/js-untar/js-untar-tests.ts @@ -0,0 +1,80 @@ +import untar = require("js-untar"); + +// Create a minimal tar ArrayBuffer for type testing +function createMinimalTarArrayBuffer(): ArrayBuffer { + const encoder = new TextEncoder(); + const header = new Uint8Array(512); + encoder.encode("hello.txt").forEach((b, i) => header[i] = b); + encoder.encode("0000777").forEach((b, i) => header[100 + i] = b); + encoder.encode("0000000").forEach((b, i) => header[108 + i] = b); + encoder.encode("0000000").forEach((b, i) => header[116 + i] = b); + encoder.encode("0000004").forEach((b, i) => header[124 + i] = b); + encoder.encode("00000000000").forEach((b, i) => header[136 + i] = b); + encoder.encode(" ").forEach((b, i) => header[148 + i] = b); + header[156] = "0".charCodeAt(0); + encoder.encode("ustar ").forEach((b, i) => header[257 + i] = b); + encoder.encode("00").forEach((b, i) => header[263 + i] = b); + const content = encoder.encode("hi\n"); + const tar = new Uint8Array(512 + 4 + 512); + tar.set(header, 0); + tar.set(content, 512); + return tar.buffer; +} + +const arrayBuffer = createMinimalTarArrayBuffer(); +const promise = untar(arrayBuffer); // $ExpectType ProgressivePromise + +promise.progress((file) => { + file; // $ExpectType TarFile + file.name; // $ExpectType string + file.mode; // $ExpectType string + file.uid; // $ExpectType number + file.gid; // $ExpectType number + file.size; // $ExpectType number + file.mtime; // $ExpectType number + file.checksum; // $ExpectType number + file.type; // $ExpectType string + file.linkname; // $ExpectType string + file.ustarFormat; // $ExpectType string + file.buffer; // $ExpectType ArrayBuffer + file.blob(); // $ExpectType Blob + file.getBlobUrl(); // $ExpectType URL + file.readAsString(); // $ExpectType string + file.readAsJSON(); // $ExpectType any + + file.version; // $ExpectType string | undefined + file.uname; // $ExpectType string | undefined + file.gname; // $ExpectType string | undefined + file.devmajor; // $ExpectType number | undefined + file.devminor; // $ExpectType number | undefined + file.namePrefix; // $ExpectType string | undefined +}); + +promise.then((files) => { + files; // $ExpectType TarFile[] + files.forEach((file) => { + file; // $ExpectType TarFile + file.name; // $ExpectType string + file.mode; // $ExpectType string + file.uid; // $ExpectType number + file.gid; // $ExpectType number + file.size; // $ExpectType number + file.mtime; // $ExpectType number + file.checksum; // $ExpectType number + file.type; // $ExpectType string + file.linkname; // $ExpectType string + file.ustarFormat; // $ExpectType string + file.buffer; // $ExpectType ArrayBuffer + file.blob(); // $ExpectType Blob + file.getBlobUrl(); // $ExpectType URL + file.readAsString(); // $ExpectType string + file.readAsJSON(); // $ExpectType any + + file.version; // $ExpectType string | undefined + file.uname; // $ExpectType string | undefined + file.gname; // $ExpectType string | undefined + file.devmajor; // $ExpectType number | undefined + file.devminor; // $ExpectType number | undefined + file.namePrefix; // $ExpectType string | undefined + }); +}); diff --git a/types/js-untar/package.json b/types/js-untar/package.json new file mode 100644 index 00000000000000..c0a879deead4f9 --- /dev/null +++ b/types/js-untar/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/js-untar", + "version": "2.0.9999", + "projects": [ + "https://github.com/InvokIT/js-untar" + ], + "devDependencies": { + "@types/js-untar": "workspace:." + }, + "owners": [ + { + "name": "aidin", + "githubUsername": "aidinabedi" + } + ] +} diff --git a/types/js-untar/tsconfig.json b/types/js-untar/tsconfig.json new file mode 100644 index 00000000000000..b550e3fd200702 --- /dev/null +++ b/types/js-untar/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "js-untar-tests.ts" + ] +} From dd9f93456e8ae851922108c5170efc9aa315e790 Mon Sep 17 00:00:00 2001 From: Holger Jeromin Date: Fri, 14 Nov 2025 23:27:33 +0100 Subject: [PATCH 17/18] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73867=20[jas?= =?UTF-8?q?mine]=20separated=20setSpecProperty=20and=20setSuiteProperty=20?= =?UTF-8?q?in=20tsdoc=20by=20@HolgerJeromin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Holger Jeromin --- types/jasmine/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index 309fda4cd98d23..c37f20dc1d31a0 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -1,5 +1,3 @@ -// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts - /** * @deprecated Use {@link jasmine.ImplementationCallback} instead. */ @@ -1044,7 +1042,7 @@ declare namespace jasmine { duration: number | null; /** - * User-supplied properties, if any, that were set using {@link Env.setSpecProperty} + * User-supplied properties, if any, that were set using {@link Env.setSuiteProperty} */ properties: { [key: string]: unknown } | null; } @@ -1061,6 +1059,11 @@ declare namespace jasmine { pendingReason: string; debugLogs: DebugLogEntry[] | null; + + /** + * User-supplied properties, if any, that were set using {@link Env.setSpecProperty} + */ + properties: { [key: string]: unknown } | null; } interface DebugLogEntry { From b9d1c330e08c9fd81ad161966b42e7607bb981a3 Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:52:51 -0800 Subject: [PATCH 18/18] [office-js-preview] (Outlook) Document token status APIs (#74041) --- types/office-js-preview/index.d.ts | 134 +++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 285c44a03f99cd..cf865e7666e5ba 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -10402,6 +10402,35 @@ declare namespace Office { */ Subject = "subject" } + /** + * Specifies the status of Exchange Web Services (EWS) callback tokens or REST API tokens in an organization. + * + * @remarks + * [Api set: Mailbox preview] + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * + * **Important**: Legacy Exchange Online user identity tokens and callback tokens are no longer supported and are turned off across all Microsoft 365 tenants. + * If an Outlook add-in requires delegated user access or user identity, we recommend using MSAL (Microsoft Authentication Library) and nested app authentication (NAA). + * Exchange user identity tokens are still supported for Exchange on-premises. For more information, see + * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/faq-nested-app-auth-outlook-legacy-tokens | Nested app authentication FAQ}. + * + * @beta + */ + enum TokenStatus { + /** + * EWS callback tokens or REST API tokens are turned off in the organization. + */ + Disabled = 0, + /** + * EWS callback tokens or REST API tokens are supported in the organization. + */ + Enabled = 1, + /** + * The mailbox is hosted in an Exchange Online environment where EWS tokens are turned off and are no longer supported. + */ + Removed = 2 + } /** * Specifies the week of the month. * @@ -14611,6 +14640,29 @@ declare namespace Office { * property to get similar information. */ interface Diagnostics { + /** + * Gets an object to identify whether Exchange Web Services (EWS) callback tokens are supported in an organization. + * + * @remarks + * + * [Api set: Mailbox preview] + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * + * **Important**: + * + * - The `ews` property is available for preview in Outlook on the web and on Windows (new and classic (Version 2510, Build 19328.20000 and later)). + * + * - Legacy Exchange Online user identity tokens and callback tokens are no longer supported and are turned off across all Microsoft 365 tenants. + * If an Outlook add-in requires delegated user access or user identity, we recommend using MSAL (Microsoft Authentication Library) and nested app authentication (NAA). + * Exchange user identity tokens are still supported for Exchange on-premises. For more information, see + * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/faq-nested-app-auth-outlook-legacy-tokens | Nested app authentication FAQ}. + * + * @beta + */ + ews: Ews; /** * Gets a string that represents the type of Outlook client. * @@ -15372,6 +15424,82 @@ declare namespace Office { */ urls: string[]; } + /** + * Provides methods to determine if Exchange Web Services (EWS) callback tokens are supported in an organization. + * + * @remarks + * + * [Api set: Mailbox preview] + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * + * **Important**: Legacy Exchange Online user identity tokens and callback tokens are no longer supported and are turned off across all Microsoft 365 tenants. + * If an Outlook add-in requires delegated user access or user identity, we recommend using MSAL (Microsoft Authentication Library) and nested app authentication (NAA). + * Exchange user identity tokens are still supported for Exchange on-premises. For more information, see + * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/faq-nested-app-auth-outlook-legacy-tokens | Nested app authentication FAQ}. + * + * @beta + */ + interface Ews { + /** + * Gets the status of EWS callback tokens in an organization. + * + * @remarks + * + * [Api set: Mailbox preview] + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * + * **Important**: + * + * - The `getTokenStatusAsync` method is available for preview in Outlook on the web and on Windows (new and classic (Version 2510, Build 19328.20000 and later)). + * + * - The `getTokenStatusAsync` method isn't supported if you load an add-in in an Outlook.com or Gmail mailbox. + * + * - Calling the `getTokenStatusAsync` method in compose mode requires you to have saved the item. The `saveAsync` method requires a minimum permission level of **read/write item**. + * + * @param options - An object literal that contains one or more of the following properties. `asyncContext`: Any data you want to access in the callback function. + * `isRest`: Identifies whether the token needed is for EWS or Outlook REST APIs. By default, the `isRest` property is set to `false`. + * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of type Office.AsyncResult. + * The `asyncResult.value` property returns the token status, which can be `Office.MailboxEnums.TokenStatus.Enabled`, `Office.MailboxEnums.TokenStatus.Disabled`, or + * `Office.MailboxEnums.TokenStatus.Removed`. A `Office.MailboxEnums.TokenStatus.Removed` status indicates that the mailbox is hosted in an Exchange Online environment + * where legacy Exchange tokens are turned off and are no longer supported. + * + * @beta + */ + getTokenStatusAsync(options: Office.AsyncContextOptions & { isRest?: boolean }, callback: (asyncResult: Office.AsyncResult) => void): void; + /** + * Gets the status of EWS callback tokens in an organization. + * + * @remarks + * + * [Api set: Mailbox preview] + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions | Minimum permission level}**: **read item** + * + * **{@link https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points | Applicable Outlook mode}**: Compose or Read + * + * **Important**: + * + * - The `getTokenStatusAsync` method is available for preview in Outlook on the web and on Windows (new and classic (Version 2510, Build 19328.20000 and later)). + * + * - The `getTokenStatusAsync` method isn't supported if you load an add-in in an Outlook.com or Gmail mailbox. + * + * - Calling the `getTokenStatusAsync` method in compose mode requires you to have saved the item. The `saveAsync` method requires a minimum permission level of **read/write item**. + * + * @param callback - When the method completes, the function passed in the `callback` parameter is called with a single parameter of type Office.AsyncResult. + * The `asyncResult.value` property returns the token status, which can be `Office.MailboxEnums.TokenStatus.Enabled`, `Office.MailboxEnums.TokenStatus.Disabled`, or + * `Office.MailboxEnums.TokenStatus.Removed`. A `Office.MailboxEnums.TokenStatus.Removed` status indicates that the mailbox is hosted in an Exchange Online environment + * where legacy Exchange tokens are turned off and are no longer supported. + * + * @beta + */ + getTokenStatusAsync(callback: (asyncResult: Office.AsyncResult) => void): void; + } /** * Provides a method to get the from value of a message in an Outlook add-in. * @@ -18536,6 +18664,9 @@ declare namespace Office { * add-ins to use {@link https://learn.microsoft.com/outlook/rest#outlook-rest-api-via-microsoft-graph | Microsoft Graph}. For guidance, see * {@link https://learn.microsoft.com/outlook/rest/compare-graph | Compare Microsoft Graph and Outlook REST API endpoints}. * + * - To determine if REST or EWS tokens are available in an organization, call `Office.context.mailbox.diagnostics.ews.getTokenStatusAsync`. + * The `getTokenStatusAsync` method is available for preview in Outlook on the web and on Windows (new and classic (Version 2510, Build 19328.20000 and later)). + * * - This method isn't supported if you load an add-in in an Outlook.com or Gmail mailbox. * * - This method is only supported in read mode in Outlook on Android and on iOS. For more information on supported APIs in Outlook mobile, see @@ -18640,6 +18771,9 @@ declare namespace Office { * attachment or item. For example, you can create a remote service to * {@link https://learn.microsoft.com/office/dev/add-ins/outlook/get-attachments-of-an-outlook-item | get attachments from the selected item}. * + * - To determine if REST or EWS tokens are available in an organization, call `Office.context.mailbox.diagnostics.ews.getTokenStatusAsync`. + * The `getTokenStatusAsync` method is available for preview in Outlook on the web and on Windows (new and classic (Version 2510, Build 19328.20000 and later)). + * * - Calling the `getCallbackTokenAsync` method in read mode requires a minimum permission level of **read item**. * * - Calling the `getCallbackTokenAsync` method in compose mode requires you to have saved the item.