Porting src/swf to TS