title: Typescript export default function
body: <p>My current typescript version is 1.6.2 and we compile it to ECMA 5. I am new to TypeScript so please be understanding. These are the imported library typings. </p>
  
  <p>redux-thunk.d.ts:</p>
  
  <pre><code>    declare module "redux-thunk" {
      import { Middleware, Dispatch } from 'redux';
  
      export interface Thunk extends Middleware { }
  
      export interface ThunkInterface {
          &lt;T&gt;(dispatch: Dispatch, getState?: () =&gt; T): any;
      }
  
      var thunk: Thunk;
  
      export default thunk;
  }
  </code></pre>
  
  <p>In app.ts:</p>
  
  <pre><code>import thunk from "redux-thunk";
  
  console.log(thunk);
  </code></pre>
  
  <p>I am getting undefined. This is the code taken from: 
  <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/redux-thunk/redux-thunk-tests.ts" rel="nofollow">https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/redux-thunk/redux-thunk-tests.ts</a> (7 and 16 lines)</p>
  
  <p>I've got the same problem with all libraries that uses default import in typescript.</p>
  
  <p>EDIT:
  @Steve Fenton I am using npm to do the job for me. I've just noticed that the problem is with Typescript compiler. When I create typescript file with export default function I get for example:</p>
  
  <pre><code>Object.defineProperty(exports, "__esModule", { value: true });
  exports.default = {
      nextQuestion: nextQuestion,
  };
  </code></pre>
  
  <p>Notice <code>exports.default</code></p>
  
  <p>When I look into <code>redux-thunk.js</code> file downloaded from npm there is:</p>
  
  <pre><code>exports.__esModule = true;
  exports['default'] = thunkMiddleware;
  
  function thunkMiddleware(_ref) {
      var dispatch = _ref.dispatch;
      var getState = _ref.getState;
  
      return function (next) {
          return function (action) {
              return typeof action === 'function' ? action(dispatch, getState) : next(action);
          };
      };
  }
  
  module.exports = exports['default'];
  </code></pre>
  
  <p>Notice <code>module.exports = exports['default'];</code></p>
  
  <p>If I take redux-thunk typings into Babel compiler I get the results with <code>exports['default']</code> style.</p>
  
  <p>The most important part is that when I replace <code>export['default']</code>  style to <code>exports.default</code>  style in  <code>redux-thunk.js</code> then everything works. Is this a problem with my compiler?</p>