title: How to make JSX factory function global to typescript project?
body: <p>I'm following the <a href="https://www.typescriptlang.org/docs/handbook/jsx.html" rel="nofollow noreferrer">TypeScript JSX guide</a> to setup &amp; play around with JSX <strong>sans React</strong> in a side project.</p>
  
  <p>One thing that's very annoying that I'm running into: I cannot find any mention of how to globally expose the JSX factory function to the whole project. Also (though much less important), my <code>JSX.IntrinsicElements</code> structure is also not being globally exposed.</p>
  
  <p>Here's my tsconfig: </p>
  
  <pre><code>{
      "compileOnSave": true,
      "compilerOptions": {
          "target": "es6",
          "lib": [
              "dom",
              "es2015"
          ],
          "experimentalDecorators": true,
          "jsx": "react",
          "jsxFactory": "generateElement",
          "sourceMap": true,
          "noImplicitAny": true,
          "pretty": true,
          "importHelpers": true,
          "outDir": "dist"
      },
      "include": ["./src/**/*.ts", "./src/**/*.tsx"]
  }
  </code></pre>
  
  <p>The file where I declare <code>generateElement</code>:</p>
  
  <pre><code>export function generateElement(tag: string, attrs: string[]) {
      return document.createElement(tag)
  }
  
  declare namespace JSX {
      interface IntrinsicElements {
          image: any
      }
  }
  </code></pre>
  
  <p>The file where I declare my <code>image</code> element:</p>
  
  <pre><code>export function image(prop: {src: string}) {
      return (
          &lt;img /&gt;
      )
  }
  </code></pre>
  
  <p>And the main entrypoint for the project, where I try to import my element:</p>
  
  <pre><code>import {image} from "./image";
  
  image({src: "google.com"})
  </code></pre>
  
  <p>The errors:</p>
  
  <pre><code>src/image.tsx:13:9 - error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.
  
  13         &lt;img /&gt;
             ~~~~~~~
  
  
  src/image.tsx:13:10 - error TS2304: Cannot find name 'generateElement'.
  
  13         &lt;img /&gt;
             ~~~~~~~
  </code></pre>