typescript prohibits doing that.
You need to rethinking your task, because you are doing something wrong.
As says official site "TypeScript is a strongly typed programming language...". among other things it means variable is associated with the type at the time of declaration and the type cannot be changed later.
When you write
let foo = {
title: {
value: "text"
}
};
typescript now knows that foo type is object that consists of one property "title" with value type object that consists of one property "value" with value type string.
type T = {
title: {
value: string
}
}
When you write
foo = "string"
typescript compares two types T and string. Type T is not string. Here you got the type error.
temp.typeis{ title: { value: string } }. You can't change it to juststring, that defeats the whole point of a type system. Make a new, different object that is of the correct type where it'stypeproperty is just a string. On a related note, PLEASE don't use the word 'type' as an object property (or variable name) when asking Typescript questions: it creates confusion about whether you understand the difference between the runtime value of the object and the compile-time type of the object, and askers are essentially never given the benefit of the doubt.