Rewrite options page in typescript