Migrate CommonUtils and Viewbox to TS.