下面是重构后的代码:
```typescript
function timestampToMinutes(timeStamp: number): string {
// 时间戳 --> 分钟
var timeInterval = (60 * 60 * 24) + (60 * 60 * 5) + (60 * 3) + (20);
var dateStr = "";
if (timeInterval >= 60 * 60 * 24) {
let v = timeInterval / (60 * 60 * 24);
timeInterval -= (60 * 60 * 24) * v;
dateStr += `${v}天`;
}
if (timeInterval >= 60 * 60) {
let v = timeInterval / (60 * 60);
timeInterval -= (60 * 60) * v;
dateStr += `${v}小时`;
}
if (timeInterval >= 60) {
let v = timeInterval / (60);
timeInterval -= (60) * v;
dateStr += `${v}分`;
}
dateStr += `${timeInterval}秒`;
return dateStr;
}
// Example usage:
console.log(timestampToMinutes(1728931202)); // Output: "2天5小时3分20秒"
```