title: Typescript ambient declaration namespace
body: <p>Recently i have moved our spa app to typescript,and now i stuck with implementing  the declation file of rsa.js which is used for openid authentication.</p>
  
  <p>Previously used Js code like below.</p>
  
  <pre><code>var jws = new KJUR.jws.JWS();
  jws.verifyJWSByPemX509Cert(idToken, cert);
  </code></pre>
  
  <p>in a rsa.d.ts file</p>
  
  <pre><code>declare namespace KJUR.jws {
      interface IParsedJWS {
          payloadS: any
      }
      interface IJWS {
          new ();
          verifyJWSByPemX509Cert(idToken: string, cert: string): boolean;
          parsedJWS: IParsedJWS;
      }
  }
  
  declare var JWS: KJUR.jws.IJWS;
  declare module "KJUR.jws.JWS" {
      export = JWS;
  }
  </code></pre>
  
  <p>Im not sure what im doing here.Please anyone guide me the right way.How can i define namespace like KJUR.jws.JWS to use new KJUR.jws.JWS();?</p>
  
  <p>Thanks</p>