title: AWS X-ray import with Typescript
body: <p>I currently use postgresql-node in my lambda with</p>
  
  <pre><code>import { Client } from 'pg'
  </code></pre>
  
  <p>I want to instrument the Postgresql lib with AWS X-ray. The Nodejs example has this line:</p>
  
  <pre><code>var AWSXRay = require('aws-xray-sdk');
  var pg = AWSXRay.capturePostgres(require('pg'));
  </code></pre>
  
  <p>How would I convert the second line in that to proper Typescript. All the variations I come up with produce some errors or warnings. For example I would guess this would work:</p>
  
  <pre><code>const pg = AWSXRay.capturePostgres(require('pg'))
  </code></pre>
  
  <p>but not only you get ESlint warning for <code>require</code> being used without <code>import</code> but after that <code>pg.Client</code> says <code>pg namespace not found</code>.</p>