From 28a3b11694e22cb7ded033ad53e2bb860b710542 Mon Sep 17 00:00:00 2001 From: Leonard Thieu Date: Mon, 26 Feb 2018 12:02:12 -0500 Subject: [PATCH] [simplebar] Allow SimpleBar to be imported as a module. (#23911) * [simplebar] Allow SimpleBar to be imported as a module. * [simplebar] Add missing author. --- types/simplebar/index.d.ts | 5 ++++- types/simplebar/test/module-tests.ts | 4 ++++ types/simplebar/tsconfig.json | 5 +++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 types/simplebar/test/module-tests.ts diff --git a/types/simplebar/index.d.ts b/types/simplebar/index.d.ts index 64533d7408..46b6b9e737 100644 --- a/types/simplebar/index.d.ts +++ b/types/simplebar/index.d.ts @@ -1,9 +1,12 @@ // Type definitions for simplebar.js 2.4 // Project: https://github.com/Grsmto/simplebar -// Definitions by: Leonard Thieu +// Definitions by: Gregor Woiwode , Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +export as namespace SimpleBar; +export = SimpleBar; + declare class SimpleBar { static removeObserver(): void; diff --git a/types/simplebar/test/module-tests.ts b/types/simplebar/test/module-tests.ts new file mode 100644 index 0000000000..b7d10d73bf --- /dev/null +++ b/types/simplebar/test/module-tests.ts @@ -0,0 +1,4 @@ +import SimpleBar = require('simplebar'); + +// $ExpectType typeof SimpleBar +SimpleBar; diff --git a/types/simplebar/tsconfig.json b/types/simplebar/tsconfig.json index 467b6358e4..9c51115e84 100644 --- a/types/simplebar/tsconfig.json +++ b/types/simplebar/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "simplebar-tests.ts" + "simplebar-tests.ts", + "test/module-tests.ts" ] -} \ No newline at end of file +}