Typescript: Dynamic Update