From 7293f118b733961c970b251ac1cdd193364d1fa6 Mon Sep 17 00:00:00 2001 From: Takuma Suzuki Date: Fri, 8 Feb 2019 17:08:34 +0900 Subject: [PATCH 1/2] Fix args type for Interval.toDuration() --- types/luxon/index.d.ts | 4 ++-- types/luxon/luxon-tests.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index b5f1134fb5..95a06b1d6a 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for luxon 1.10 +// Type definitions for luxon 1.11.1 // Project: https://github.com/moment/luxon#readme // Definitions by: Colby DeHart // Hyeonseok Yang @@ -436,7 +436,7 @@ export class Interval { splitAt(...dateTimes: DateTime[]): Interval[]; splitBy(duration: Duration | DurationObject | number): Interval[]; toDuration( - unit: DurationUnit | DurationUnit[], + unit?: DurationUnit | DurationUnit[], options?: DiffOptions ): Duration; toFormat( diff --git a/types/luxon/luxon-tests.ts b/types/luxon/luxon-tests.ts index df5481094b..59566c35c3 100644 --- a/types/luxon/luxon-tests.ts +++ b/types/luxon/luxon-tests.ts @@ -144,6 +144,7 @@ i.mapEndpoints((d) => d); // $ExpectType Interval i.toISO(); // $ExpectType string i.toString(); // $ExpectType string i.toDuration('months'); // $ExpectType Duration +i.toDuration(); // $ExpectType Duration if (Interval.isInterval(anything)) { anything; // $ExpectType Interval From 3caae783fe15d11a4ac24faba39d1ede9e4a7e92 Mon Sep 17 00:00:00 2001 From: Takuma Suzuki Date: Fri, 8 Feb 2019 18:35:16 +0900 Subject: [PATCH 2/2] fixup! Fix args type for Interval.toDuration() --- types/luxon/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index 95a06b1d6a..eebf89497d 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for luxon 1.11.1 +// Type definitions for luxon 1.11 // Project: https://github.com/moment/luxon#readme // Definitions by: Colby DeHart // Hyeonseok Yang