title: TypeScript Cannot find namespace despite Variable being in same Class
body: <p>I'm trying to define Callbackdefinitions to make it easier to work with many callbacks in my Node.js project.</p>
  
  <p>My database.ts file looks like that:</p>
  
  <pre><code>export default class Database {
  
      //Export the enums
      public static LoadObjectResponse = LoadObjectResponse;
  
      //Export Callback definitions
      public static loadObjectCallback: (resultCode: Database.LoadObjectResponse) =&gt; void;//ERROR
      ...
  }
  
  enum LoadObjectResponse {
      ERROR_ON_LOADING, //"Error on Loading Object.",
      OBJECT_NOT_FOUND //"Object not found."
  }
  </code></pre>
  
  <p>So I want a loadObjectCallback defined, that says that the parameter has to be of the enum Type LoadObjectResponse. But when I try to do it like that, the compiler always gives the error</p>
  
  <pre><code>Cannot find namespace "Database"
  </code></pre>
  
  <p>I don't understand why it gives me the error, the variable itself is in the definition of Database, why doesn't it work?</p>
  
  <p>It gives me the same error when I try to use it in Classfunction definitions:</p>
  
  <pre><code>public static loadObject(MongoModel, searchObject, callback: Database.LoadObjectResponse) {//ERROR namespace Database not found
  </code></pre>
  
  <p>Again Error:</p>
  
  <pre><code>Cannot find namespace "Database"
  </code></pre>
  
  <p>Inside of functions in the Database class calling</p>
  
  <pre><code>Database.LoadObjectResponse
  </code></pre>
  
  <p>works flawlessly, why doesn't it work in variable definitions?</p>