title: How can I use a *.d.ts outside of the node_modules folder for my Angular library?
body: <p>I have an angular 8 library I'm creating and it's going to utilize the insane.js npm package.  Because insane is JavaScript, I need to make it so that my typescript service recognizes the insane function.  I used dts-gen to create an insane.d.ts file as there is no @types/insane package.  However, I can't use the import in my service unless I place the insane.d.ts file within the /node_modules/insane/ folder.  That said, I'm at a loss on how to put this file in with my code and recognize the insane function.  Every time I move the file out of that directory, I receive an error on my import line saying: </p>
  
  <blockquote>
    <p>Could not find a declaration file for module 'insane'. 'c:/TFS/repo/amrock-simple-mde/projects/simple-mde/node_modules/insane/insane.js' implicitly has an 'any' type.</p>
  </blockquote>
  
  <p>I've provided a stackblitz link <a href="https://stackblitz.com/edit/angular-wgebwd" rel="nofollow noreferrer">here</a> to help describe what I'm experiencing.  I hope it helps.  Check out the SanitizerService under the shared folder to get an idea of what I was trying to do.  I'm trying to do something to the effect of:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import * as insane from 'insane';  // line where error is
  
  @Injectable({
    providedIn: 'root'
  })
  
  export class SanitizerService {
  
    constructor() { }
  
    sanitize(content: string): string {
      return insane(content, {
       allowedAttributes: {
         a: ['name', 'target']
       }
     });
    }
  
  }
  </code></pre>
  
  <p>I'd expect the import to recognize the insane.d.ts, but it doesn't. Can anyone help me figure out what I'm missing?</p>