Skip to content

Commit

Permalink
Fix error TS2497 on import * as X from 'statsd-client':
Browse files Browse the repository at this point in the history
Per microsoft/TypeScript#5073, closed as `By Design` by @mhegazy,
we need to merge a namespace with the export when using `export =`,
otherwise `import *` must fail.
  • Loading branch information
garthk committed Jul 26, 2016
1 parent af87ccf commit d077714
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions statsd-client/statsd-client-import-asterisk-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import * as StatsdClient from 'statsd-client';
const statsd = new StatsdClient({ debug: true });
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--noImplicitAny --module es6 --target es6
1 change: 1 addition & 0 deletions statsd-client/statsd-client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ declare module "statsd-client" {
getChildClient(name: string): StatsdClient;
}

namespace StatsdClient {}
export = StatsdClient;
}

0 comments on commit d077714

Please sign in to comment.