From 2c2ece066684d3cdf22fb0277df70c3fef37c0fb Mon Sep 17 00:00:00 2001 From: nathanlepori Date: Tue, 27 Jul 2021 11:52:52 +0200 Subject: [PATCH] Added overload for default export to extendMoment --- lib/moment-range.d.ts | 5 +++-- typing-tests/typescript/tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/moment-range.d.ts b/lib/moment-range.d.ts index 1bc672f..7a9bf2e 100644 --- a/lib/moment-range.d.ts +++ b/lib/moment-range.d.ts @@ -1,5 +1,5 @@ -import * as moment from 'moment'; -import {Moment, unitOfTime} from 'moment'; +import * as momentNs from 'moment'; +import moment, {Moment, unitOfTime} from 'moment'; export class DateRange { start: Moment; @@ -86,4 +86,5 @@ declare module 'moment' { } } +export function extendMoment(momentClass: typeof momentNs): MomentRange & typeof momentNs; export function extendMoment(momentClass: typeof moment): MomentRange & typeof moment; diff --git a/typing-tests/typescript/tsconfig.json b/typing-tests/typescript/tsconfig.json index f0aa7f6..01cec67 100644 --- a/typing-tests/typescript/tsconfig.json +++ b/typing-tests/typescript/tsconfig.json @@ -1,7 +1,7 @@ { "compileOnSave": false, "compilerOptions": { - "allowSyntheticDefaultImports": false, + "allowSyntheticDefaultImports": true, "baseUrl": ".", "declaration": true, "forceConsistentCasingInFileNames": true,