From 8d17b1990ccd92f0b62a293ea9671db3629f8cfb Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:21:56 -0700 Subject: [PATCH 1/7] [office-js][office-js-preview] (Outlook) Correct the recipients limit note for the setAsync method (#73328) --- types/office-js-preview/index.d.ts | 4 ++-- types/office-js/index.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 27cde6b2cee8b9..7bd3f8cdf3493e 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -22285,7 +22285,7 @@ declare namespace Office { * However, take note of the following: * * - In Outlook on the web, on Windows (new and classic), and on Mac (classic UI), you can have a maximum of 500 recipients in a target field. - * If you need to set more than 100 recipients, you can call `setAsync` repeatedly, but be mindful of the recipient limit of the field. + * If you need to add more recipients after setting 100 recipients, you can call `addAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `setAsync` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see @@ -22328,7 +22328,7 @@ declare namespace Office { * However, take note of the following: * * - In Outlook on the web, on Windows (new and classic), and on Mac (classic UI), you can have a maximum of 500 recipients in a target field. - * If you need to set more than 100 recipients, you can call `setAsync` repeatedly, but be mindful of the recipient limit of the field. + * If you need to add more recipients after setting 100 recipients, you can call `addAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `setAsync` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 93bcce38488168..6d51197d903ff2 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -21931,7 +21931,7 @@ declare namespace Office { * However, take note of the following: * * - In Outlook on the web, on Windows (new and classic), and on Mac (classic UI), you can have a maximum of 500 recipients in a target field. - * If you need to set more than 100 recipients, you can call `setAsync` repeatedly, but be mindful of the recipient limit of the field. + * If you need to add more recipients after setting 100 recipients, you can call `addAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `setAsync` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see @@ -21974,7 +21974,7 @@ declare namespace Office { * However, take note of the following: * * - In Outlook on the web, on Windows (new and classic), and on Mac (classic UI), you can have a maximum of 500 recipients in a target field. - * If you need to set more than 100 recipients, you can call `setAsync` repeatedly, but be mindful of the recipient limit of the field. + * If you need to add more recipients after setting 100 recipients, you can call `addAsync` repeatedly, but be mindful of the recipient limit of the field. * * - In Outlook on Android and on iOS, the `setAsync` method isn't supported in the Message Compose mode. Only the Appointment Organizer mode is * supported. For more information on supported APIs in Outlook mobile, see From 440acd1460d22e845ce6762924acf221cf574909 Mon Sep 17 00:00:00 2001 From: NovaBG03 <43469098+NovaBG03@users.noreply.github.com> Date: Mon, 28 Jul 2025 23:03:29 +0300 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73340=20[react?= =?UTF-8?q?-native-web]=20Add=20AriaRole=20support=20and=20paragraph=20rol?= =?UTF-8?q?e=20to=20Text=20component=20by=20@NovaBG03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/react-native-web/index.d.ts | 29 +++++++++++++++++-- .../react-native-web-tests.tsx | 4 +++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/types/react-native-web/index.d.ts b/types/react-native-web/index.d.ts index b4437edd14f2de..dd91bb1eb69cd3 100644 --- a/types/react-native-web/index.d.ts +++ b/types/react-native-web/index.d.ts @@ -1,4 +1,5 @@ import type { + AriaRole, ComponentClass, ComponentType, createElement, @@ -1075,7 +1076,9 @@ export interface TextProps extends ViewPropsWithoutStyle { | "link" | "listitem" | "none" - | "text"; + | "text" + | "paragraph" + | AriaRole; style?: StyleProp; testID?: string; // @deprecated @@ -1372,7 +1375,29 @@ declare module "react-native" { dir?: "auto" | "ltr" | "rtl"; } // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface TextProps extends WebTextProps {} + interface TextProps extends WebTextProps { + role?: + | "button" + | "header" + | "heading" + | "label" + | "link" + | "listitem" + | "none" + | "text" + | "paragraph" + | AriaRole; + // @deprecated + accessibilityRole?: + | "button" + | "header" + | "heading" + | "label" + | "link" + | "listitem" + | "none" + | "text"; + } /** * TextInput diff --git a/types/react-native-web/react-native-web-tests.tsx b/types/react-native-web/react-native-web-tests.tsx index 704c8682852beb..d3c9b914d49655 100644 --- a/types/react-native-web/react-native-web-tests.tsx +++ b/types/react-native-web/react-native-web-tests.tsx @@ -335,6 +335,10 @@ const sectionList = null} keyExtrac const statusBar = ; const switchComponent = console.log("Switch changed")} />; const textComponent = ; +const textComponentWithButtonRole = ; +const textComponentWithLabelRole = ; +const textComponentWithParagraphRole = ; +const textComponentWithCodeRole = ; const textInput = console.log("TextInput value:", text)} />; const touchableHighlight = ( Date: Mon, 28 Jul 2025 15:07:51 -0600 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73332=20[ramda?= =?UTF-8?q?]=20bump=20types-ramda=20to=200.31.0=20by=20@Harris-Miller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/ramda/es/renameKeys.d.ts | 2 ++ types/ramda/package.json | 4 ++-- types/ramda/src/renameKeys.d.ts | 2 ++ types/ramda/test/mergeLeft-tests.ts | 7 ------- types/ramda/test/mergeRight-tests.ts | 9 --------- types/ramda/tsconfig.json | 2 -- 6 files changed, 6 insertions(+), 20 deletions(-) create mode 100644 types/ramda/es/renameKeys.d.ts create mode 100644 types/ramda/src/renameKeys.d.ts delete mode 100644 types/ramda/test/mergeLeft-tests.ts delete mode 100644 types/ramda/test/mergeRight-tests.ts diff --git a/types/ramda/es/renameKeys.d.ts b/types/ramda/es/renameKeys.d.ts new file mode 100644 index 00000000000000..d65acbe7830347 --- /dev/null +++ b/types/ramda/es/renameKeys.d.ts @@ -0,0 +1,2 @@ +import { renameKeys } from "../index.js"; +export default renameKeys; diff --git a/types/ramda/package.json b/types/ramda/package.json index e5f04dd85a535c..2fc5109b2b583f 100644 --- a/types/ramda/package.json +++ b/types/ramda/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/ramda", - "version": "0.30.9999", + "version": "0.31.9999", "projects": [ "https://ramdajs.com" ], @@ -20,7 +20,7 @@ }, "minimumTypeScriptVersion": "4.7", "dependencies": { - "types-ramda": "^0.30.1" + "types-ramda": "^0.31.0" }, "devDependencies": { "@types/ramda": "workspace:." diff --git a/types/ramda/src/renameKeys.d.ts b/types/ramda/src/renameKeys.d.ts new file mode 100644 index 00000000000000..54c82728c68f4b --- /dev/null +++ b/types/ramda/src/renameKeys.d.ts @@ -0,0 +1,2 @@ +import { renameKeys } from "../index"; +export default renameKeys; diff --git a/types/ramda/test/mergeLeft-tests.ts b/types/ramda/test/mergeLeft-tests.ts deleted file mode 100644 index bbdfd836e97985..00000000000000 --- a/types/ramda/test/mergeLeft-tests.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as R from "ramda"; - -(() => { - R.mergeLeft({ foo: { bar: 1 } }, { foo: { bar: 2 } }); // => {foo: {bar: 1}} - const curry1 = R.mergeLeft({ foo: { bar: 1 } }); - curry1({ foo: { bar: 2 } }); // => {foo: {bar: 1}} -}); diff --git a/types/ramda/test/mergeRight-tests.ts b/types/ramda/test/mergeRight-tests.ts deleted file mode 100644 index 882d52eba73be4..00000000000000 --- a/types/ramda/test/mergeRight-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as R from "ramda"; - -(() => { - R.mergeRight({ name: "fred", age: 10 }, { age: 40 }); - // => { 'name': 'fred', 'age': 40 } - - const withDefaults = R.mergeRight({ x: 0, y: 0 }); - withDefaults({ y: 2 }); // => {x: 0, y: 2} -}); diff --git a/types/ramda/tsconfig.json b/types/ramda/tsconfig.json index abf0a29489a5ad..d604dba01e321c 100644 --- a/types/ramda/tsconfig.json +++ b/types/ramda/tsconfig.json @@ -136,8 +136,6 @@ "test/mergeDeepRight-tests.ts", "test/mergeDeepWith-tests.ts", "test/mergeDeepWithKey-tests.ts", - "test/mergeLeft-tests.ts", - "test/mergeRight-tests.ts", "test/mergeWith-tests.ts", "test/mergeWithKey-tests.ts", "test/min-tests.ts", From f98ac8e533d8543140c365cb0096d5bb428c13f8 Mon Sep 17 00:00:00 2001 From: yusheng chen Date: Tue, 29 Jul 2025 05:27:09 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73337=20doc(sm?= =?UTF-8?q?tp-server):=20update=20outdated=20jsdoc=20[see=20details]=20url?= =?UTF-8?q?s=20by=20@samuel871211?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 陳昱昇 --- types/smtp-server/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/smtp-server/index.d.ts b/types/smtp-server/index.d.ts index cbdd801842319a..267fde3302ba57 100644 --- a/types/smtp-server/index.d.ts +++ b/types/smtp-server/index.d.ts @@ -158,7 +158,7 @@ export interface SMTPServerOptions extends tls.TlsOptions { banner?: string | undefined; /** * optional maximum allowed message size in bytes - * ([see details](https://github.com/andris9/smtp-server#using-size-extension)) + * ([see details](https://nodemailer.com/extras/smtp-server#using-the-size-extension)) */ size?: number | undefined; /** @@ -256,7 +256,7 @@ export interface SMTPServerOptions extends tls.TlsOptions { */ closeTimeout?: ms | undefined; /** - * The callback to handle authentications ([see details](https://github.com/andris9/smtp-server#handling-authentication)) + * The callback to handle authentications ([see details](https://nodemailer.com/extras/smtp-server#handling-authentication-onauth)) */ onAuth?( auth: SMTPServerAuthentication, @@ -264,19 +264,19 @@ export interface SMTPServerOptions extends tls.TlsOptions { callback: (err: Error | null | undefined, response?: SMTPServerAuthenticationResponse) => void, ): void; /** - * The callback to handle the client connection. ([see details](https://github.com/andris9/smtp-server#validating-client-connection)) + * The callback to handle the client connection. ([see details](https://nodemailer.com/extras/smtp-server#validating-client-connection-onconnect--onclose)) */ onConnect?(session: SMTPServerSession, callback: (err?: Error | null) => void): void; /** - * the callback to validate MAIL FROM commands ([see details](https://github.com/andris9/smtp-server#validating-sender-addresses)) + * the callback to validate MAIL FROM commands ([see details](https://nodemailer.com/extras/smtp-server#validating-sender-onmailfrom)) */ onMailFrom?(address: SMTPServerAddress, session: SMTPServerSession, callback: (err?: Error | null) => void): void; /** - * The callback to validate RCPT TO commands ([see details](https://github.com/andris9/smtp-server#validating-recipient-addresses)) + * The callback to validate RCPT TO commands ([see details](https://nodemailer.com/extras/smtp-server#validating-recipients-onrcptto)) */ onRcptTo?(address: SMTPServerAddress, session: SMTPServerSession, callback: (err?: Error | null) => void): void; /** - * the callback to handle incoming messages ([see details](https://github.com/andris9/smtp-server#processing-incoming-message)) + * the callback to handle incoming messages ([see details](https://nodemailer.com/extras/smtp-server#processing-incoming-messages-ondata)) */ onData?(stream: SMTPServerDataStream, session: SMTPServerSession, callback: (err?: Error | null) => void): void; /** From 1549017237a797914389a758e1724817978c6fbd Mon Sep 17 00:00:00 2001 From: Superchupu <53496941+SuperchupuDev@users.noreply.github.com> Date: Mon, 28 Jul 2025 23:28:46 +0200 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73283=20[picom?= =?UTF-8?q?atch]=20remove=20`lookbehinds`=20option=20and=20fix=20documenta?= =?UTF-8?q?tion=20by=20@SuperchupuDev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/picomatch/lib/picomatch.d.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/types/picomatch/lib/picomatch.d.ts b/types/picomatch/lib/picomatch.d.ts index b875edb6cd6ff3..8009b5131e4978 100644 --- a/types/picomatch/lib/picomatch.d.ts +++ b/types/picomatch/lib/picomatch.d.ts @@ -115,10 +115,6 @@ declare namespace picomatch { * When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. */ literalBrackets?: boolean | undefined; - /** - * Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds. - */ - lookbehinds?: boolean | undefined; /** * Alias for `basename` */ @@ -132,7 +128,7 @@ declare namespace picomatch { */ nobrace?: boolean | undefined; /** - * Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. + * Disable matching with regex brackets. */ nobracket?: boolean | undefined; /** @@ -182,7 +178,7 @@ declare namespace picomatch { */ posix?: boolean | undefined; /** - * Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself + * Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself. */ posixSlashes?: boolean | undefined; /** From 643225315bb7631642d06e39af178e0b2eb1e129 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Tue, 29 Jul 2025 05:29:35 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73292=20feat(l?= =?UTF-8?q?uxon):=20upgrade=20to=20v3.7,=20add=20export=20map=20to=20fix?= =?UTF-8?q?=20attw=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- attw.json | 1 - types/luxon/index.d.mts | 1 + types/luxon/index.d.ts | 2 - types/luxon/package.json | 10 +- types/luxon/src/datetime.d.ts | 73 +++++++++---- types/luxon/src/duration.d.ts | 52 +++++++-- types/luxon/src/interval.d.ts | 3 +- types/luxon/test/luxon-tests.module.ts | 144 ++++++++++++++++++------- types/luxon/tsconfig.json | 1 + 9 files changed, 212 insertions(+), 75 deletions(-) create mode 100644 types/luxon/index.d.mts diff --git a/attw.json b/attw.json index 10bbd384cd437d..e52ed52caa27f1 100644 --- a/attw.json +++ b/attw.json @@ -171,7 +171,6 @@ "leveldown", "lint-staged", "locutus", - "luxon", "mapbox__mapbox-sdk", "mapboxgl-spiderifier", "marv", diff --git a/types/luxon/index.d.mts b/types/luxon/index.d.mts new file mode 100644 index 00000000000000..8e893de15df158 --- /dev/null +++ b/types/luxon/index.d.mts @@ -0,0 +1 @@ +export * from "./index.js"; diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index baa3c32e428ba4..ce6c7d6c726305 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -1,5 +1,3 @@ -// Minimum TypeScript Version: 4.3 - export * from "./src/luxon"; export as namespace luxon; diff --git a/types/luxon/package.json b/types/luxon/package.json index 470a668c116ac0..f5bef8bea018d0 100644 --- a/types/luxon/package.json +++ b/types/luxon/package.json @@ -1,10 +1,18 @@ { "private": true, "name": "@types/luxon", - "version": "3.6.9999", + "version": "3.7.9999", "projects": [ "https://github.com/moment/luxon#readme" ], + "exports": { + ".": { + "import": "./index.d.mts", + "require": "./index.d.ts" + }, + "./package.json": "./package.json" + }, + "minimumTypeScriptVersion": "4.3", "devDependencies": { "@types/luxon": "workspace:." }, diff --git a/types/luxon/src/datetime.d.ts b/types/luxon/src/datetime.d.ts index a55cb874ad9599..bd1dec4180af76 100644 --- a/types/luxon/src/datetime.d.ts +++ b/types/luxon/src/datetime.d.ts @@ -3,7 +3,6 @@ import { DateTimeFormatOptions, NumberingSystem, StringUnitLength, - ToISOFormat, ToISOTimeDurationOptions, WeekSettings, ZoneOptions, @@ -220,22 +219,31 @@ export type _ToObjectUnit = Exclude; export interface ToRelativeOptions extends Omit { /** + * The style of units, must be "long", "short", or "narrow". * @default long */ style?: StringUnitLength | undefined; - /** @default true */ + /** + * A single unit or an array of units. If an array is supplied, the method will pick the best one + * to use from the array. If omitted, the method will pick the unit from a default set. + */ + unit?: ToRelativeUnit | ToRelativeUnit[] | undefined; + /** + * Whether or not to round the numbers in the output. + * @default true + */ round?: boolean | undefined; + /** + * Rounding method to use when rounding the numbers in the output + * @default 'trunc' + */ + rounding?: "trunc" | "expand" | "round" | "floor" | "ceil" | undefined; /** * Padding in milliseconds. This allows you to round up the result if it fits inside the threshold. * Do not use this in combination with `{round: false}` because the decimal output will include the padding. * @default 0 */ padding?: number | undefined; - /** - * A single unit or an array of units. If an array is supplied, the method will pick the best one - * to use from the array. If omitted, the method will pick the unit from a default set. - */ - unit?: ToRelativeUnit | ToRelativeUnit[] | undefined; } export interface ToRelativeCalendarOptions { @@ -275,12 +283,12 @@ export interface ToSQLOptions { includeOffsetSpace?: boolean; } -export interface ToISODateOptions { +export interface ToISODateOptions extends Pick { /** - * Choose between the basic and extended format - * @default 'extended' + * Truncate output to desired presicion. + * @default 'day' */ - format?: ToISOFormat | undefined; + precision?: "year" | "years" | "month" | "months" | "day" | "days" | undefined; } export interface ToISOTimeOptions extends ToISOTimeDurationOptions { @@ -295,6 +303,29 @@ export interface ToISOTimeOptions extends ToISOTimeDurationOptions { * @default false */ extendedZone?: boolean | undefined; + + /** + * Truncate output to desired presicion. + * When precision and suppressSeconds or suppressMilliseconds are used together, + * precision sets the maximum unit shown in the output, + * however seconds or milliseconds will still be suppressed if they are 0. + * @default 'milliseconds' + */ + precision?: + | "year" + | "years" + | "month" + | "months" + | "day" + | "days" + | "hour" + | "hours" + | "minute" + | "minutes" + | "second" + | "seconds" + | "millisecond" + | "milliseconds"; } /** @deprecated alias for backwards compatibility */ @@ -1427,19 +1458,22 @@ export class DateTime { * DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' * @example * DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @example + * DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z' + * @example + * DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z' */ toISO(opts?: ToISOTimeOptions): IfValid; /** * Returns an ISO 8601-compliant string representation of this DateTime's date component * - * @param opts - options - * @param opts.format - choose between the basic and extended format. Defaults to 'extended'. - * * @example * DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' * @example * DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @example + * DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05' */ toISODate(opts?: ToISODateOptions): IfValid; @@ -1454,13 +1488,6 @@ export class DateTime { /** * Returns an ISO 8601-compliant string representation of this DateTime's time component * - * @param opts - options - * @param opts.suppressMilliseconds - exclude milliseconds from the format if they're 0. Defaults to false. - * @param opts.suppressSeconds - exclude seconds from the format if they're 0. Defaults to false. - * @param opts.includeOffset - include the offset, such as 'Z' or '-04:00'. Defaults to true. - * @param opts.includePrefix - include the `T` prefix. Defaults to false. - * @param opts.format - choose between the basic and extended format. Defaults to 'extended'. - * * @example * DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' * @example @@ -1469,6 +1496,8 @@ export class DateTime { * DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' * @example * DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @example + * DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z' */ toISOTime(opts?: ToISOTimeOptions): IfValid; @@ -1650,7 +1679,7 @@ export class DateTime { /** * Returns a string representation of this time relative to now, such as "in two days". * Can only internationalize if your platform supports Intl.RelativeTimeFormat. - * Rounds down by default. + * Rounds towards zero by default. * * @example * DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" diff --git a/types/luxon/src/duration.d.ts b/types/luxon/src/duration.d.ts index 20ade9b3f4fddf..5b54293f3bde98 100644 --- a/types/luxon/src/duration.d.ts +++ b/types/luxon/src/duration.d.ts @@ -61,7 +61,17 @@ export interface ToISOTimeDurationOptions { } export interface ToHumanDurationOptions extends Intl.NumberFormatOptions { + /** + * How to format the merged list. + * Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @default 'narrow' + */ listStyle?: "long" | "short" | "narrow" | undefined; + /** + * Show all units previously used by the duration even if they are zero. + * @default true + */ + showZeros?: boolean | undefined; } /** @@ -78,6 +88,19 @@ export type DurationLike = Duration | DurationLikeObject | number; export type DurationMaybeValid = CanBeInvalid extends true ? (Duration | Duration) : Duration; +export interface DurationFormatOptions { + /** + * Whether or not to floor numerical values. + * @default true + */ + floor?: boolean | undefined; + /** + * How to handle signs + * @default 'negative' + */ + signMode?: "negative" | "all" | "negativeLargestOnly" | undefined; +} + /** * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". * Conceptually, it is just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. @@ -218,18 +241,20 @@ export class Duration { * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits * * The duration will be converted to the set of units in the format string using {@link Duration.shiftTo} and the Duration's conversion accuracy setting. * - * @param fmt - the format string - * @param opts - options - * @param opts.floor - floor numerical values. Defaults to true. - * * @example * Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" * @example * Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" * @example * Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @example + * Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2" + * @example + * Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2" + * @example + * Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2" */ - toFormat(fmt: string, opts?: { floor?: boolean | undefined }): IfValid; + toFormat(fmt: string, opts?: DurationFormatOptions): IfValid; /** * Returns a string representation of a Duration with all units included @@ -237,10 +262,11 @@ export class Duration { * * @example * ```js - * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 }) - * dur.toHuman() //=> '1 day, 5 hours, 6 minutes' - * dur.toHuman({ listStyle: "long" }) //=> '1 day, 5 hours, and 6 minutes' - * dur.toHuman({ unitDisplay: "short" }) //=> '1 day, 5 hr, 6 min' + * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min' + * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes' * ``` */ toHuman(opts?: ToHumanDurationOptions): string; @@ -425,6 +451,14 @@ export class Duration { */ negate(): this; + /** + * Removes all units with values equal to 0 from this Duration. + * + * @example + * Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 } + */ + removeZeros(): this; + /** * Get the years. */ diff --git a/types/luxon/src/interval.d.ts b/types/luxon/src/interval.d.ts index 2847bfe5b646ef..0d86d7f334b1d8 100644 --- a/types/luxon/src/interval.d.ts +++ b/types/luxon/src/interval.d.ts @@ -96,7 +96,8 @@ export class Interval { get start(): IfValid, null, IsValid>; /** - * Returns the end of the Interval + * Returns the end of the Interval. This is the first instant which is not part of the interval. + * (Interval is half-open). */ get end(): IfValid, null, IsValid>; diff --git a/types/luxon/test/luxon-tests.module.ts b/types/luxon/test/luxon-tests.module.ts index 3fe323dc615bbd..c4d660be0ca14a 100644 --- a/types/luxon/test/luxon-tests.module.ts +++ b/types/luxon/test/luxon-tests.module.ts @@ -37,7 +37,7 @@ DateTime.fromFormatParser("22/11/1948", parser); // @ts-expect-error new DateTime(); -const dt = DateTime.local(2017, 5, 15, 8, 30); +const dt = DateTime.local(2017, 5, 15, 8, 30); // $ExpectType DateTime | DateTime const now = DateTime.now(); // $ExpectType DateTime @@ -115,12 +115,32 @@ getters.weeksInLocalWeekYear; // $ExpectType PossibleWeeksInYear dt.toBSON(); // $ExpectType Date dt.toHTTP(); // $ExpectType string | null dt.toISO(); // $ExpectType string | null -dt.toISO({ includeOffset: true, format: "extended" }); // $ExpectType string | null -dt.toISO({ extendedZone: true, format: "extended" }); // $ExpectType string | null +dt.toISO({}); // $ExpectType string | null +// $ExpectType string | null +dt.toISO({ + includePrefix: true, + suppressMilliseconds: true, + suppressSeconds: true, + format: "basic", + includeOffset: true, + extendedZone: true, + precision: "hours", +}); dt.toISODate(); // $ExpectType string | null -dt.toISODate({ format: "basic" }); // $ExpectType string | null +dt.toISODate({}); // $ExpectType string | null +dt.toISODate({ format: "basic", precision: "months" }); // $ExpectType string | null dt.toISOTime(); // $ExpectType string | null -dt.toISOTime({ format: "basic" }); // $ExpectType string | null +dt.toISOTime({}); // $ExpectType string | null +// $ExpectType string | null +dt.toISOTime({ + includePrefix: true, + suppressMilliseconds: true, + suppressSeconds: true, + format: "basic", + includeOffset: true, + extendedZone: true, + precision: "hours", +}); dt.toISOWeekDate(); // $ExpectType string | null dt.toJSDate(); // $ExpectType Date dt.toJSON(); // $ExpectType string | null @@ -134,7 +154,22 @@ dt.toLocaleString(DateTime.DATE_MED, {}); // $ExpectType string dt.toMillis(); // $ExpectType number dt.toMillis(); // $ExpectType number dt.toRelative(); // $ExpectType string | null +dt.toRelative({}); // $ExpectType string | null +// $ExpectType string | null +dt.toRelative({ + base: DateTime.local(), + locale: "fr", + numberingSystem: "bali", + style: "long", + unit: Math.random() < 0.5 ? "days" : ["days"], + round: true, + rounding: "expand", + padding: 10, +}); dt.toRelativeCalendar(); // $ExpectType string | null +dt.toRelativeCalendar({}); // $ExpectType string | null +// $ExpectType string | null +dt.toRelativeCalendar({ base: DateTime.local(), locale: "fr", unit: "days", numberingSystem: "bali" }); dt.toRFC2822(); // $ExpectType string | null dt.toSeconds(); // $ExpectType number dt.toSQL(); // $ExpectType string | null @@ -154,16 +189,51 @@ dt.toUnixInteger(); // $ExpectType number // Known valid DateTime narrows out invalid returns now.toHTTP(); // $ExpectType string now.toISO(); // $ExpectType string -now.toISO({ includeOffset: true, format: "extended" }); // $ExpectType string -now.toISO({ extendedZone: true, format: "extended" }); // $ExpectType string +now.toISO({}); // $ExpectType string +// $ExpectType string +now.toISO({ + includePrefix: true, + suppressMilliseconds: true, + suppressSeconds: true, + format: "basic", + includeOffset: true, + extendedZone: true, + precision: "hours", +}); now.toISODate(); // $ExpectType string -now.toISODate({ format: "basic" }); // $ExpectType string +now.toISODate({}); // $ExpectType string +now.toISODate({ format: "basic", precision: "months" }); // $ExpectType string now.toISOTime(); // $ExpectType string -now.toISOTime({ format: "basic" }); // $ExpectType string +now.toISOTime({}); // $ExpectType string +// $ExpectType string +now.toISOTime({ + includePrefix: true, + suppressMilliseconds: true, + suppressSeconds: true, + format: "basic", + includeOffset: true, + extendedZone: true, + precision: "hours", +}); now.toISOWeekDate(); // $ExpectType string now.toJSON(); // $ExpectType string now.toRelative(); // $ExpectType string +now.toRelative({}); // $ExpectType string +// $ExpectType string +now.toRelative({ + base: DateTime.local(), + locale: "fr", + numberingSystem: "bali", + style: "long", + unit: Math.random() < 0.5 ? "days" : ["days"], + round: true, + rounding: "expand", + padding: 10, +}); now.toRelativeCalendar(); // $ExpectType string +now.toRelativeCalendar({}); // $ExpectType string +// $ExpectType string +now.toRelativeCalendar({ base: DateTime.local(), locale: "fr", unit: "days", numberingSystem: "bali" }); now.toRFC2822(); // $ExpectType string now.toSQL(); // $ExpectType string now.toSQL({ includeOffset: false, includeZone: true }); // $ExpectType string @@ -173,36 +243,6 @@ now.toSQLTime({ includeOffset: false, includeZone: true }); // $ExpectType strin now.toSQLTime({ includeOffsetSpace: false, includeZone: true }); // $ExpectType string now.toObject(); // $ExpectType Record<_ToObjectUnit, number> -// $ExpectType string | null -dt.toRelative({ - base: DateTime.local(), - locale: "fr", - style: "long", - unit: "days", - round: true, - padding: 10, - numberingSystem: "bali", -}); - -// $ExpectType string | null -dt.toRelative({ - base: DateTime.local(), - locale: "fr", - style: "long", - unit: ["days"], - round: true, - padding: 10, - numberingSystem: "bali", -}); - -// $ExpectType string | null -dt.toRelativeCalendar({ - base: DateTime.local(), - locale: "fr", - unit: "days", - numberingSystem: "bali", -}); - dt.plus({ hours: 3, minutes: 2 }); dt.minus({ days: 7 }); dt.startOf("day"); @@ -283,6 +323,32 @@ dur.rescale(); // $ExpectType Duration dur.shiftToAll(); // $ExpectType Duration dur.toMillis(); // $ExpectType number dur.mapUnits((x, u) => (u === "hours" ? x * 2 : x)); // $ExpectType Duration +// $ExpectType string +dur.toHuman(); +// $ExpectType string +dur.toHuman({}); +// $ExpectType string +dur.toHuman({ + compactDisplay: "long", + notation: "engineering", + signDisplay: "always", + unit: "", + unitDisplay: "long", + currencySign: "accounting", + listStyle: "narrow", + showZeros: true, +}); +// $ExpectType Duration +dur.removeZeros(); +// $ExpectType string +dur.toFormat(""); +// $ExpectType string +dur.toFormat("", {}); +// $ExpectType string +dur.toFormat("", { + floor: true, + signMode: "negativeLargestOnly", +}); if (Duration.isDuration(anything)) { anything; // $ExpectType Duration | Duration diff --git a/types/luxon/tsconfig.json b/types/luxon/tsconfig.json index 80f9c5142b5f15..93fd2853d13497 100644 --- a/types/luxon/tsconfig.json +++ b/types/luxon/tsconfig.json @@ -14,6 +14,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ + "index.d.mts", "index.d.ts", "test/luxon-tests.global.ts", "test/luxon-tests.module.ts" From 1dd4473f5635d6a7a12a97dbbdd78958a9eac85c Mon Sep 17 00:00:00 2001 From: Stephen Smith Date: Mon, 28 Jul 2025 17:41:09 -0400 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73317=20chore(?= =?UTF-8?q?request):=20bump=20form-data=20to=20fix=20vulnerability=20by=20?= =?UTF-8?q?@stephensmithnewfront?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/request/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/request/package.json b/types/request/package.json index a1ef621a97bd66..a9b17bb15ffa18 100644 --- a/types/request/package.json +++ b/types/request/package.json @@ -9,7 +9,7 @@ "@types/caseless": "*", "@types/node": "*", "@types/tough-cookie": "*", - "form-data": "^2.5.0" + "form-data": "^2.5.5" }, "devDependencies": { "@types/request": "workspace:."