-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Introduce ES2025 target & Add missing ScriptTargetFeatures #63046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1f00226
7c48e79
f69d5ad
bb08b4c
82d7c65
f9ec910
2003118
86c687a
e86a117
3ff5b2f
57b8b0e
06350b4
4c718cd
a684da6
c3e2e60
ff0e67c
29b9b1d
2e54cbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /// <reference lib="es2024" /> | ||
| /// <reference lib="es2025.collection" /> | ||
| /// <reference lib="es2025.float16" /> | ||
| /// <reference lib="es2025.intl" /> | ||
| /// <reference lib="es2025.iterator" /> | ||
| /// <reference lib="es2025.promise" /> | ||
| /// <reference lib="es2025.regexp" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /// <reference lib="es2025" /> | ||
| /// <reference lib="dom" /> | ||
| /// <reference lib="webworker.importscripts" /> | ||
| /// <reference lib="scripthost" /> | ||
| /// <reference lib="dom.iterable" /> | ||
| /// <reference lib="dom.asynciterable" /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not strictly required anymore (for any of the libs), but not a problem in this PR; can be cleaned up later. |
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My main concern with this file is the defined unions they don't entirely match the pattern of inlining things like in existing intl or the original es5 types. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| /// <reference lib="es2018.intl" /> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this because |
||
|
|
||
| declare namespace Intl { | ||
| /** | ||
| * An object representing the relative time format in parts | ||
| * that can be used for custom locale-aware formatting. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts). | ||
| */ | ||
| type DurationFormatPart = | ||
| | { | ||
| type: "literal"; | ||
| value: string; | ||
| unit?: "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "milliseconds" | "microseconds" | "nanoseconds"; | ||
| } | ||
| | { | ||
| type: Exclude<NumberFormatPartTypes, "literal">; | ||
| value: string; | ||
| unit: "year" | "month" | "week" | "day" | "hour" | "minute" | "second" | "milliseconds" | "microseconds" | "nanoseconds"; | ||
| }; | ||
|
|
||
| /** | ||
| * An object with some or all properties of the `Intl.DurationFormat` constructor `options` parameter. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#parameters) | ||
| */ | ||
| interface DurationFormatOptions { | ||
| localeMatcher?: "lookup" | "best fit" | undefined; | ||
| numberingSystem?: string | undefined; | ||
| style?: "long" | "short" | "narrow" | "digital" | undefined; | ||
| years?: "long" | "short" | "narrow" | undefined; | ||
| yearsDisplay?: "always" | "auto" | undefined; | ||
| months?: "long" | "short" | "narrow" | undefined; | ||
| monthsDisplay?: "always" | "auto" | undefined; | ||
| weeks?: "long" | "short" | "narrow" | undefined; | ||
| weeksDisplay?: "always" | "auto" | undefined; | ||
| days?: "long" | "short" | "narrow" | undefined; | ||
| daysDisplay?: "always" | "auto" | undefined; | ||
| hours?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined; | ||
| hoursDisplay?: "always" | "auto" | undefined; | ||
| minutes?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined; | ||
| minutesDisplay?: "always" | "auto" | undefined; | ||
| seconds?: "long" | "short" | "narrow" | "numeric" | "2-digit" | undefined; | ||
| secondsDisplay?: "always" | "auto" | undefined; | ||
| milliseconds?: "long" | "short" | "narrow" | "numeric" | undefined; | ||
| millisecondsDisplay?: "always" | "auto" | undefined; | ||
| microseconds?: "long" | "short" | "narrow" | "numeric" | undefined; | ||
| microsecondsDisplay?: "always" | "auto" | undefined; | ||
| nanoseconds?: "long" | "short" | "narrow" | "numeric" | undefined; | ||
| nanosecondsDisplay?: "always" | "auto" | undefined; | ||
| fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; | ||
| } | ||
|
|
||
| /** | ||
| * The Intl.DurationFormat object enables language-sensitive duration formatting. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat) | ||
| */ | ||
| interface DurationFormat { | ||
| /** | ||
| * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format). | ||
| */ | ||
| format(duration: Partial<Record<"years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds", number>>): string; | ||
| /** | ||
| * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts). | ||
| */ | ||
| formatToParts(duration: Partial<Record<"years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds", number>>): DurationFormatPart[]; | ||
| /** | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/resolvedOptions). | ||
| */ | ||
| resolvedOptions(): ResolvedDurationFormatOptions; | ||
| } | ||
|
|
||
| interface ResolvedDurationFormatOptions { | ||
| locale: string; | ||
| numberingSystem: string; | ||
| style: "long" | "short" | "narrow" | "digital"; | ||
| years: "long" | "short" | "narrow"; | ||
| yearsDisplay: "always" | "auto"; | ||
| months: "long" | "short" | "narrow"; | ||
| monthsDisplay: "always" | "auto"; | ||
| weeks: "long" | "short" | "narrow"; | ||
| weeksDisplay: "always" | "auto"; | ||
| days: "long" | "short" | "narrow"; | ||
| daysDisplay: "always" | "auto"; | ||
| hours: "long" | "short" | "narrow" | "numeric" | "2-digit"; | ||
| hoursDisplay: "always" | "auto"; | ||
| minutes: "long" | "short" | "narrow" | "numeric" | "2-digit"; | ||
| minutesDisplay: "always" | "auto"; | ||
| seconds: "long" | "short" | "narrow" | "numeric" | "2-digit"; | ||
| secondsDisplay: "always" | "auto"; | ||
| milliseconds: "long" | "short" | "narrow" | "numeric"; | ||
| millisecondsDisplay: "always" | "auto"; | ||
| microseconds: "long" | "short" | "narrow" | "numeric"; | ||
| microsecondsDisplay: "always" | "auto"; | ||
| nanoseconds: "long" | "short" | "narrow" | "numeric"; | ||
| nanosecondsDisplay: "always" | "auto"; | ||
| fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the spec, this |
||
| } | ||
|
|
||
| const DurationFormat: { | ||
| prototype: DurationFormat; | ||
|
|
||
| /** | ||
| * @param locales A string with a BCP 47 language tag, or an array of such strings. | ||
| * For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) | ||
| * page. | ||
| * | ||
| * @param options An object for setting up a duration format. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat). | ||
| */ | ||
| new (locales?: LocalesArgument, options?: DurationFormatOptions): DurationFormat; | ||
|
|
||
| /** | ||
| * Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale. | ||
| * | ||
| * @param locales A string with a BCP 47 language tag, or an array of such strings. | ||
| * For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) | ||
| * page. | ||
| * | ||
| * @param options An object with a locale matcher. | ||
| * | ||
| * @returns An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale. | ||
| * | ||
| * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/supportedLocalesOf). | ||
| */ | ||
| supportedLocalesOf(locales?: LocalesArgument, options?: Pick<DurationFormatOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[]; | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| interface RegExpConstructor { | ||
| /** | ||
| * Escapes any RegExp syntax characters in the input string, returning a | ||
| * new string that can be safely interpolated into a RegExp as a literal | ||
| * string to match. | ||
| * @example | ||
| * ```ts | ||
| * const regExp = new RegExp(RegExp.escape("foo.bar")); | ||
| * regExp.test("foo.bar"); // true | ||
| * regExp.test("foo!bar"); // false | ||
| * ``` | ||
| */ | ||
| escape(string: string): string; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,8 @@ | ||
| /// <reference lib="es2024" /> | ||
| /// <reference lib="es2025" /> | ||
| /// <reference lib="esnext.intl" /> | ||
| /// <reference lib="esnext.decorators" /> | ||
| /// <reference lib="esnext.disposable" /> | ||
| /// <reference lib="esnext.collection" /> | ||
| /// <reference lib="esnext.array" /> | ||
| /// <reference lib="esnext.iterator" /> | ||
| /// <reference lib="esnext.promise" /> | ||
| /// <reference lib="esnext.float16" /> | ||
| /// <reference lib="esnext.error" /> | ||
| /// <reference lib="esnext.sharedmemory" /> | ||
| /// <reference lib="esnext.typedarrays" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are none of these applicable to ES2025?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Intlnamespace was written, and I have not touched this file.ref: https://github.com/tc39/proposals/blob/main/finished-proposals.md