title: how to define and use an enum in typescript ?
body: <p>I am using typescript with atom version 1.7.5</p>
  
  <p>I have a declaration file Provision.d.ts with the following declarations</p>
  
  <pre><code>declare module Provision {
  
  export enum ProvisionMode {
      NOOP,
      PRODUCTION,
      DEVELOPMENT,
      TEST,
      DEFAULT
  }
  
  export interface ProvisionSettingsService {
      setGlobalProvisionMode(arg0: ProvisionMode, arg1: string, back: Http.HttpDefaultCallback): void;
      getGlobalProvisionMode(arg0: string, back: Http.HttpDefaultCallback): void;
      setPathProvision(arg0: string, arg1: ProvisionMode, back: Http.HttpDefaultCallback): void;
      getPathProvision(arg0: string, back: Http.HttpDefaultCallback): void;
  }
  
  }
  </code></pre>
  
  <p>and then my implementation file  Provision.ts</p>
  
  <pre><code>/// &lt;reference path='./Provision.d.ts'/&gt;
  module ProvisionImpl{
  
  export class ProvisionServiceCallback implements Http.Callback&lt;Provision.ProvisionMode&gt;{
  
  onSuccess(data: Provision.ProvisionMode): void {
  
  }
  
  onError(): void {
      var console: Console;
      console.log("provision callback Error");
  }
  </code></pre>
  
  <p>}</p>
  
  <p>export class ProvisionServiceClient  implements Provision.ProvisionSettingsService{</p>
  
  <pre><code> setGlobalProvisionMode(arg0: Provision.ProvisionMode, arg1: string, back : Http.HttpDefaultCallback): void{
        /// ..... various implementations here
   }
  
   getGlobalProvisionMode(arg0: string , back : Http.HttpDefaultCallback): void{
                  /// ..... various implementations here
   }
  
   setPathProvision(arg0: string, arg1: Provision.ProvisionMode,  back : Http.HttpDefaultCallback): void{
                   /// ..... various implementations here
   }
  
   getPathProvision(arg0: string,  back : Http.HttpDefaultCallback): void{
        /// ..... various implementations here
   }
   }
   }
  </code></pre>
  
  <p>When I try to use the above implementation in my code say CountryService.ts</p>
  
  <pre><code>/// &lt;reference path='./Provision.d.ts' /&gt;
  /// &lt;reference path='./Provision.ts' /&gt;
  
  class App{
      public switchOp() {
  
          var client = new ProvisionImpl.ProvisionServiceClient();
  
          var noop = Provision.ProvisionMode.NOOP ;
          var prod = Provision.ProvisionMode.PRODUCTION ;
  
          if (this.op){
              client.setGlobalProvisionMode(noop , "dummy" , new Http.HttpDefaultCallback()) ;
          }else{
              client.setGlobalProvisionMode(prod , "dummy" , new Http.HttpDefaultCallback()) ;
          }
      }
  }
  
  new App().switchOp();
  </code></pre>
  
  <p>Though my code compiles without any complaint it consistently gives me an error </p>
  
  <pre><code>Uncaught ReferenceError: Provision is not defined
  </code></pre>
  
  <p>on this line </p>
  
  <pre><code>var noop = Provision.ProvisionMode.NOOP ; 
  </code></pre>