diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index eebf89497d..44165c06c3 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -426,7 +426,7 @@ export class Interval { engulfs(other: Interval): boolean; equals(other: Interval): boolean; hasSame(unit: DurationUnit): boolean; - intersection(other: Interval): Interval; + intersection(other: Interval): Interval | null; isAfter(dateTime: DateTime): boolean; isBefore(dateTime: DateTime): boolean; isEmpty(): boolean; diff --git a/types/luxon/luxon-tests.ts b/types/luxon/luxon-tests.ts index 59566c35c3..ecf49e2081 100644 --- a/types/luxon/luxon-tests.ts +++ b/types/luxon/luxon-tests.ts @@ -140,6 +140,7 @@ i.length('years'); // $ExpectType number i.contains(DateTime.local(2019)); // $ExpectType boolean i.set({end: DateTime.local(2020)}); // $ExpectType Interval i.mapEndpoints((d) => d); // $ExpectType Interval +i.intersection(i); // $ExpectType Interval | null i.toISO(); // $ExpectType string i.toString(); // $ExpectType string