From d471f9f443b757358b3fbe6fe256d703e72f74ef Mon Sep 17 00:00:00 2001 From: Ryan Price Date: Thu, 17 Jan 2019 00:11:15 -0500 Subject: [PATCH] export amplitude type because amplitude-js is a UMD module Without doing this, tsc complains that node_modules/@types/amplitude-js/index.d.ts is not a module --- types/amplitude-js/amplitude-js-tests.ts | 2 ++ types/amplitude-js/index.d.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts index c5ffbe9898..0b6bb49751 100644 --- a/types/amplitude-js/amplitude-js-tests.ts +++ b/types/amplitude-js/amplitude-js-tests.ts @@ -1,5 +1,7 @@ // Tests for Amplitude SDK TypeScript definitions +import amplitude = require('amplitude-js'); + module Amplitude.Tests { function all() { diff --git a/types/amplitude-js/index.d.ts b/types/amplitude-js/index.d.ts index 1cdb843589..2eb4d8a43b 100644 --- a/types/amplitude-js/index.d.ts +++ b/types/amplitude-js/index.d.ts @@ -4,7 +4,10 @@ // Dan Manastireanu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module amplitude { +export = amplitude; +export as namespace amplitude; + +declare namespace amplitude { type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void; type LogReturn = number | void;