title: TypeScript how to export const in a promise
body: <p>What I want to implement is that get a data from the database, which the getter method is async, then export a const variable based on the promise returned value. </p>
  
  <p>The code is like this:</p>
  
  <pre><code>import {Storage} from "@ionic/storage";
  //...
  storage.get("setup_done").then((val)=&gt;{
    export const FirstRunPage = val?'valueA':'valueB';
  }) 
  </code></pre>
  
  <p>However, I get an error message that:</p>
  
  <pre><code>Modifiers cannot appear here
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/myBLt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/myBLt.png" alt="enter image description here"></a>
  why could that happen?</p>