From f7763de15ee8b5f3425cd165feebd0ae9ccf05f7 Mon Sep 17 00:00:00 2001 From: Garth Kidd Date: Tue, 26 Jul 2016 12:54:31 +1000 Subject: [PATCH] Fix error TS2497 on import * as X from 'statsd-client': Per Microsoft/TypeScript#5073, closed as `By Design` by @mhegazy, we need to export a namespace for `import *` to work, else `TS2497`. That clashes with the `export = ClassName` pattern unless you also merge in a namespace, e.g. with `namespace ClassName {}`. --- statsd-client/statsd-client-import-asterisk-tests.ts | 3 +++ statsd-client/statsd-client.d.ts | 1 + 2 files changed, 4 insertions(+) create mode 100644 statsd-client/statsd-client-import-asterisk-tests.ts diff --git a/statsd-client/statsd-client-import-asterisk-tests.ts b/statsd-client/statsd-client-import-asterisk-tests.ts new file mode 100644 index 0000000000..b01d523042 --- /dev/null +++ b/statsd-client/statsd-client-import-asterisk-tests.ts @@ -0,0 +1,3 @@ +/// +import * as StatsdClient from 'statsd-client'; +const statsd = new StatsdClient({ debug: true }); diff --git a/statsd-client/statsd-client.d.ts b/statsd-client/statsd-client.d.ts index 2fabcfb83f..b5c8bba2ef 100644 --- a/statsd-client/statsd-client.d.ts +++ b/statsd-client/statsd-client.d.ts @@ -99,5 +99,6 @@ declare module "statsd-client" { getChildClient(name: string): StatsdClient; } + namespace StatsdClient {} export = StatsdClient; }