title: Is there an equivalent of require().default in TypeScript?
body: <p>I'm trying to build a small <a href="http://todotxt.org/" rel="nofollow noreferrer">Todo.txt</a> app for Android, using Ionic with Angular and Capacitor.</p>
  
  <p>To handle the Todo.txt file, I am using a <a href="https://www.npmjs.com/package/todotxt-parse" rel="nofollow noreferrer">todotxt-parse package</a>. So far, I have this on my page.ts file, and it's working:</p>
  
  <pre><code>declare var require: any; // &lt;- This isn't nice :(
  const TodoTxt = require('todotxt-parse').default;
  const todo = new TodoTxt('Review pull request +TodoTxtTouch @github`');
  console.log(todo.parse()); // &lt;- Outputs an object with task metadata
  </code></pre>
  
  <p>However, I understand that that <code>declare var require: any;</code> is not a good practice.</p>
  
  <p>Importing the module like this: <code>import { TodoTxt } from 'todotxt-parse';</code> causes an error <code>TS2305: Module /node_modules/todotxt-parse/lib/index"' has no exported member 'TodoTxt'</code></p>
  
  <p>On the other hand, changing the module's index.ts file from <code>export default class TodoTxt { ... }</code> to <code>export class TodoTxt { ... }</code> causes a <code>TypeError: todotxt_parse__WEBPACK_IMPORTED_MODULE_3__.TodoTxt is not a constructor</code></p>