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
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 {}`.
  • Loading branch information
garthk committed Aug 9, 2016
1 parent dd0d729 commit f7763de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions statsd-client/statsd-client-import-asterisk-tests.ts
@@ -0,0 +1,3 @@
/// <reference path="statsd-client.d.ts" />
import * as StatsdClient from 'statsd-client';
const statsd = new StatsdClient({ debug: true });
1 change: 1 addition & 0 deletions statsd-client/statsd-client.d.ts
Expand Up @@ -99,5 +99,6 @@ declare module "statsd-client" {
getChildClient(name: string): StatsdClient;
}

namespace StatsdClient {}
export = StatsdClient;
}

0 comments on commit f7763de

Please sign in to comment.