Skip to content

Commit 4810f1b

Browse files
committed
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 {}`.
1 parent af87ccf commit 4810f1b

3 files changed

+4
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import * as StatsdClient from 'statsd-client';
2+
const statsd = new StatsdClient({ debug: true });
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--noImplicitAny --module es6 --target es6

statsd-client/statsd-client.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,6 @@ declare module "statsd-client" {
9999
getChildClient(name: string): StatsdClient;
100100
}
101101

102+
namespace StatsdClient {}
102103
export = StatsdClient;
103104
}

0 commit comments

Comments
 (0)