title: Typescript: Add functions to "window" with ".d.ts" File
body: <p>I'm having a legacy *.js application and want to port parts of it to typescript.</p>
  
  <p>So far I found @types definitions for most of the used packages, but there is a global function added to the window object.</p>
  
  <p>I was able to fix the compilation error by addind this at the beginning of the *.ts File:</p>
  
  <pre><code>declare global {
      interface Window {
          openConformationModal?: any;
      }
  }
  </code></pre>
  
  <p>Now obv I don't want to include this in all my *.ts so I wanted to added it to a *.d.ts file so it is recogniced in all packages.</p>
  
  <p>The problem is, that if I add the same file to a e.g. window.d.ts file, it isn't recogniced. I know that the types in the folder are found because I a added it with   </p>
  
  <pre><code> {
    ...,
    "compilerOptions": {
      ....
      "typeRoots": [
        "FFOLDERPATH_TO_D_TS_FILE"
      ]
    }
  }
  </code></pre>
  
  <p>and there is another *.d.ts which is found. </p>
  
  <p>PS: Solution is based on <a href="https://stackoverflow.com/questions/12709074/how-do-you-explicitly-set-a-new-property-on-window-in-typescript?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">How do you explicitly set a new property on `window` in TypeScript?</a></p>