title: Declare Interfaces in typings file for JavaScript
body: <h2>Project Info</h2>
  
  <p>I'm working on a JavaScript project that utilizes <code>.d.ts</code> files. This is a subsequent question to a question I previously asked, so you can view more information regarding the project <a href="https://stackoverflow.com/questions/46678663/add-custom-typings-file-in-a-javascript-vscode-project">here</a>.</p>
  
  <h2>Problem</h2>
  
  <p>Although I can normally extract functions from the typings files I can't extract interfaces or namespaces that are either empty or consist purely of interfaces. I have temporarily fixed this problem by creating a <code>const</code> implementation for each interface and using <code>@typeof ConstantImplementation</code> in the comments. See Example below:</p>
  
  <pre><code>// Typings File
  export namespace test {
      export interface ITest {
          foo: string;
          bar: number;
      }
      export const Test: ITest;
  }
  </code></pre>
  
  <hr>
  
  <pre><code>// JS File
  if (undefined) var {Test: ITest} = require("globals.d.ts").test; 
  // Above line shows `unused var error`
  
  /* @type {typeof ITest} */
  var x = {};
  x.foo = "hello";
  x.bar = 3;
  // if I do `x.` intellisense should suggest `foo` and `bar` 
  </code></pre>
  
  <p>I was wondering if there is a better way to go around the problem, preferably one that doesn't throw an error (using <code>eslint ignore line</code> isn't a fix).</p>
  
  <h2>Clarification</h2>
  
  <p>This question is not about getting functionality from typings file. It's purely about making VSCode intellisense working with typings Interfaces. Here is an image to explain what it is that I want (the two lines inside the circle):</p>
  
  <p><a href="https://i.stack.imgur.com/5vZ2s.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5vZ2s.png" alt="enter image description here"></a></p>