title: Typescript: Load content of file in variable
body: <p><strong>I have a js file defining an object:</strong></p>
  
  <pre><code>var schema = {
      "date": Date.now(),
      "someOtherField": 5 + 6,
      "aMoreComplexField: {
          "foo": "bar"
      }
  }
  </code></pre>
  
  <p>Now in my typescript code I want to load this file and want to have the content of the variable schema in a variable.</p>
  
  <p><strong>Pseudocode</strong>:</p>
  
  <pre><code>function loadSchema(schemaFile1, anotherSchemaFile) {
      let schema = someHowLoadFile(schemaFile);
      schema = Object.assign(schema, someHowLoadFile(anotherSchemaFile));
  
      // do some additional stuff here with content of schema
  
      return schema;
  }
  </code></pre>
  
  <p>But how can I achieve this? I can define the content of the schema file so if the content should be something else than <code>var schema = {}</code> just tell me what to do. I tried to put <code>export {}</code> and <code>return {}</code> but my IDE directly shows me that this is not correct.
  As logic is called in the schema like the <code>Date.now()</code> I can't just use a JSON file.</p>