typescript: interface conversion code (initial commit)

only support a few of the most basic features & legacycaller