title: Why can't I get this typescript plugin to work?
body: <p>I'm working on these plugin example</p>
  
  <p><a href="https://github.com/MCKRUZ/TS-Plugin-HW" rel="nofollow noreferrer">https://github.com/MCKRUZ/TS-Plugin-HW</a></p>
  
  <p>Essentially the issue that I'm having is that I can't get the module loader to recognize that the plug-in has additional functionality to the original.  I think I'm almost there but I need a little push.</p>
  
  <p>I have a main file called Communicator.ts</p>
  
  <pre><code>    import * as communicatorModularAMD from "communicatorModularAMD";
  
      class Communicator {
          constructor() { }
          greet(message: string) {
              return communicatorModularAMD.goodbye();
          }
      };
  
      var communicator = new Communicator();
  
      document!.body.innerHTML = communicator.greet("Hello, world");
  </code></pre>
  
  <p>Very simple.  So CommunicatorModularAMD is a Javascript lib that I created and put into this little app.  I want to demonstrate creating a plug in for it so I wrote this</p>
  
  <pre><code>define(['CommunicatorModularAMD'], function() {
      return {
          goodbye: function() {
              return "&lt;h1&gt;Goodbye!&lt;/h1&gt;";
          }
      };
  });
  </code></pre>
  
  <p>With this declaration file</p>
  
  <pre><code>import * as m from 'communicatorModularAMD';
  
  /*~ Here, declare the same module as the one you imported above */
  declare module 'communicatorModularAMD' {
      /*~ Inside, add new function, classes, or variables. You can use
       *~ unexported types from the original module if needed. */
      export function goodbye(): string;
  
  
  }
  </code></pre>
  
  <p>The Typescript compiles but when i go to run it, it wont find goodbye.</p>
  
  <p>This is what I get back in the console.log for the communicatorModularAMD object, which does NOT contain goodbye.</p>
  
  <pre><code>{default: {…}, greet: ƒ}
  greet: ƒ (message)
  default: {greet: ƒ}
  __proto__: Object
  </code></pre>