Skip to content

Commit 9f45da2

Browse files
committed
add proposal-temporal ancillaries to lib.esnext.{date,intl}
1 parent f6198ff commit 9f45da2

File tree

86 files changed

+838
-768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+838
-768
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ const libEntries: [string, string][] = [
252252
["esnext.error", "lib.esnext.error.d.ts"],
253253
["esnext.sharedmemory", "lib.esnext.sharedmemory.d.ts"],
254254
["esnext.temporal", "lib.esnext.temporal.d.ts"],
255+
["esnext.date", "lib.esnext.date.d.ts"],
255256
["decorators", "lib.decorators.d.ts"],
256257
["decorators.legacy", "lib.decorators.legacy.d.ts"],
257258
];

src/compiler/utilities.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,6 +1923,11 @@ export const getScriptTargetFeatures: () => ScriptTargetFeatures = /* @__PURE__
19231923
"fromHex",
19241924
],
19251925
})),
1926+
Date: new Map(Object.entries({
1927+
esnext: [
1928+
"toTemporalInstant",
1929+
],
1930+
})),
19261931
}))
19271932
);
19281933

src/lib/esnext.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
/// <reference lib="esnext.sharedmemory" />
1212
/// <reference lib="esnext.typedarrays" />
1313
/// <reference lib="esnext.temporal" />
14+
/// <reference lib="esnext.date" />

src/lib/esnext.date.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference lib="esnext.temporal" />
2+
3+
interface Date {
4+
toTemporalInstant(): Temporal.Instant;
5+
}

src/lib/esnext.intl.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/// <reference lib="esnext.temporal" />
2+
13
declare namespace Intl {
2-
// Empty
4+
type FormattableTemporalObject = Temporal.PlainDate | Temporal.PlainYearMonth | Temporal.PlainMonthDay | Temporal.PlainTime | Temporal.PlainDateTime | Temporal.Instant;
5+
6+
interface DateTimeFormat {
7+
format(date?: FormattableTemporalObject | Date | number): string;
8+
formatToParts(date?: FormattableTemporalObject | Date | number): DateTimeFormatPart[];
9+
formatRange(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): string;
10+
formatRangeToParts(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): DateTimeRangeFormatPart[];
11+
}
312
}

src/lib/libs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"esnext.error",
9292
"esnext.sharedmemory",
9393
"esnext.temporal",
94+
"esnext.date",
9495
"decorators",
9596
"decorators.legacy",
9697
// Default libraries

tests/baselines/reference/bundlerDirectoryModule(module=nodenext,moduleresolution=nodenext).trace.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,7 @@
197197
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
198198
"File '/package.json' does not exist according to earlier cached lookups.",
199199
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
200+
"File '/package.json' does not exist according to earlier cached lookups.",
201+
"File '/.ts/package.json' does not exist according to earlier cached lookups.",
200202
"File '/package.json' does not exist according to earlier cached lookups."
201203
]

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with extra comma.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse --lib option with trailing white-space.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/config/commandLineParsing/parseCommandLine/Parse invalid option of library flags.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)