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:
Alan Agius
2018-02-08 21:22:37 +01:00
committed by Mohamed Hegazy
parent 5915b6d3aa
commit 7b9ceb85fa
2 changed files with 2 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ interface ArrayConstructor {
}
interface DateConstructor {
new (value: Date): Date;
new (value: number | string | Date): Date;
}
interface Function {