type RenameKey<
BaseObj,
FromKey extends KeysOfUnion<BaseObj>,
ToKey extends PropertyKey
> = { [K in keyof BaseObj as K extends FromKey ? ToKey : K]: BaseObj[K] };type RenameKey<
BaseObj,
FromKey extends KeysOfUnion<BaseObj>,
ToKey extends PropertyKey
> = { [K in keyof BaseObj as K extends FromKey ? ToKey : K]: BaseObj[K] };BaseObj
The object type containing the key to rename
BaseObjBaseObjFromKey
The key to rename
FromKey extends KeysOfUnion<BaseObj>FromKey extends KeysOfUnion<BaseObj>ToKey
The new name for the key
ToKey extends PropertyKeyToKey extends PropertyKey