convert as3 to typescript

package models
{
   import com.playsaurus.model.Model;
   import com.playsaurus.numbers.BigNumber;
   import com.playsaurus.utils.CurrentUser;
   import com.playsaurus.utils.ServerTimeKeeper;
   import heroclickerlib.managers.Formulas;
   import heroclickerlib.world.Avatar;
   import it.sephiroth.gettext._;
   import org.osflash.signals.Signal;
   
   public class Monster extends Model
   {
      
      public static var count:int;
       
      
      public var id:Number;
      
      public var level:int;
      
      public var isBoss:Boolean = false;
      
      public var isPrimal:Boolean = false;
      
      public var isTitan:Boolean = false;
      
      public var isNewImmortal:Boolean = false;
      
      public var isMiniGame:Boolean = false;
      
      private var _curLife:BigNumber;
      
      private var _avatar:Avatar;
      
      private var _deathSignal:Signal;
      
      public var uid:int;
      
      public var creationTime:Number;
      
      private var _curMaxLife:BigNumber;
      
      public function Monster()
      {
         this._curMaxLife = new BigNumber(1);
         super();
         registerStaticPrimaryKey("id");
         registerStaticTable("monsters");
         registerStaticString("name");
         registerStaticString("description");
         registerStaticBigNumber("baseLife");
         registerStaticString("lifeFormula");
         registerStaticInteger("baseGold");
         registerStaticString("goldFormula");
         registerStaticInteger("assetId");
         registerStaticInteger("baseSize");
         registerStaticInteger("dieSoundId");
         registerStaticString("mobileAsset");
         registerStaticInteger("mobileSize");
         this._deathSignal = new Signal();
         this.uid = count++;
      }
      
      public static function getLegacyImmortalMaxHealth(param1:Number) : BigNumber
      {
         return new BigNumber(2).pow(param1 - 1).multiplyN(1000);
      }
      
      public function isSpecialMonster() : Boolean
      {
         return this.isTitan || this.isNewImmortal || this.isMiniGame;
      }
      
      public function get name() : String
      {
         return _(this.getStatic("name"));
      }
      
      public function get description() : String
      {
         return _(this.getStatic("description"));
      }
      
      public function get baseLife() : BigNumber
      {
         return this.getStatic("baseLife");
      }
      
      public function get lifeFormula() : String
      {
         return this.getStatic("lifeFormula");
      }
      
      public function get baseGold() : Number
      {
         return this.getStatic("baseGold");
      }
      
      public function get goldFormula() : String
      {
         return this.getStatic("goldFormula");
      }
      
      public function get assetId() : Number
      {
         return this.getStatic("assetId");
      }
      
      public function get baseSize() : Number
      {
         return this.getStatic("baseSize");
      }
      
      public function get dieSoundId() : Number
      {
         return this.getStatic("dieSoundId");
      }
      
      public function get mobileAsset() : String
      {
         return this.getStatic("mobileAsset");
      }
      
      public function get mobileSize() : Number
      {
         return this.getStatic("mobileSize");
      }
      
      public function get curLife() : BigNumber
      {
         return this._curLife;
      }
      
      public function get avatar() : Avatar
      {
         return this._avatar;
      }
      
      public function get deathSignal() : Signal
      {
         return this._deathSignal;
      }
      
      override public function dispose() : void
      {
         super.dispose();
         this.avatar.dispose();
         this._deathSignal.removeAll();
      }
      
      public function isDead() : Boolean
      {
         return this._curLife.lteN(0);
      }
      
      public function isAlive() : Boolean
      {
         return this._curLife.gtN(0);
      }
      
      public function generateAvatar() : Avatar
      {
         this._avatar = new Avatar();
         this._avatar.initMonster(this);
         this._avatar.playIdle();
         return this._avatar;
      }
      
      public function get maxLife() : BigNumber
      {
         var _loc1_:Number = NaN;
         var _loc2_:BigNumber = null;
         var _loc3_:BigNumber = null;
         if(this.isTitan)
         {
            this._curMaxLife = getLegacyImmortalMaxHealth(this.level);
         }
         else if(this.isNewImmortal)
         {
            this._curMaxLife = GuildManager.getNewRaidImmortalMaxHealth(this.level);
         }
         else
         {
            _loc1_ = 1;
            if(this.id == 86)
            {
               if(Boolean((CurrentUser.instance as UserData).skillWildGold) && (CurrentUser.instance as UserData).skillWildGoldEnd > ServerTimeKeeper.instance.timestamp)
               {
                  _loc1_ = (CurrentUser.instance as UserData).ancients.treasureChestLifePercent.numberValue() * 0.01 + 1;
               }
            }
            _loc2_ = this._curMaxLife;
            this._curMaxLife = Formulas.instance.processMonsterFormula(this.lifeFormula,this).multiply(new BigNumber(_loc1_));
            if(Boolean(this._curLife) && !this._curLife.lteN(0))
            {
               if(!_loc2_.eq(this._curMaxLife))
               {
                  if(this._curLife && this._curLife.gtN(0) && _loc2_.gtN(0))
                  {
                     _loc3_ = this._curLife.divide(_loc2_);
                     this._curLife = this._curMaxLife.multiply(_loc3_);
                  }
               }
            }
         }
         return this._curMaxLife;
      }
      
      public function get goldReward() : BigNumber
      {
         return Formulas.instance.processMonsterFormula(this.goldFormula,this);
      }
      
      public function restore() : void
      {
         this._curLife = this.maxLife;
      }
      
      public function setCurLife(param1:BigNumber) : void
      {
         this._curLife = param1;
      }
      
      public function takeDamage(param1:BigNumber) : void
      {
         if(this._curLife.gtN(0))
         {
            this._curLife = this._curLife.subtract(param1);
            if(this._curLife.lteN(0))
            {
               this.die();
            }
         }
      }
      
      public function die() : void
      {
         this._avatar.playDie();
         this._deathSignal.dispatch(this);
      }
   }
}