mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
refactor: use union type in DateConstructor (#21757)
* refactor: use union type in `DateConstructor` Add support for union types in `DateConstructor` This will add support for something like the below; ` let date; string | number; const date = new Date(x); ` Closes: #21758 * fix: date constructor can't be passed `string | Date`, but takes either individually Closes: #20900
This commit is contained in:
committed by
Mohamed Hegazy
parent
5915b6d3aa
commit
7b9ceb85fa
2
src/lib/es2015.core.d.ts
vendored
2
src/lib/es2015.core.d.ts
vendored
@@ -69,7 +69,7 @@ interface ArrayConstructor {
|
||||
}
|
||||
|
||||
interface DateConstructor {
|
||||
new (value: Date): Date;
|
||||
new (value: number | string | Date): Date;
|
||||
}
|
||||
|
||||
interface Function {
|
||||
|
||||
Reference in New Issue
Block a user