TsSimpleAst
Renaming
Given the source file for following code:
enum MyEnum {
myMember
}
const myVar = MyEnum.myMember;
Renaming can be done as follows:
const myEnum = sourceFile.getEnum("MyEnum")!;
myEnum.setName("NewEnum");
Which will rename MyEnum to NewEnum across all files.
So the file above would now contain the following code:
enum NewEnum {
myMember
}
const myVar = NewEnum.myMember;