local BlackMarketModel = {} function BlackMarketModel:initData() self.blackMarketOpenTimestamp = ppdata.Base:getBlackMarketOpenTime() self.blackMarketRefreshTimes = ppdata.Base:getBlackMarketRefreshTimes() self.isGoToBlackMarketLayer = false end function BlackMarketModel:getBlackMarketOpenTimestamp() return self.blackMarketOpenTimestamp or 0 end function BlackMarketModel:setBlackMarketOpenTimestamp(val) self.blackMarketOpenTimestamp = val ppdata.Base:setBlackMarketOpenTime(val) end function BlackMarketModel:getBlackMarketRefreshTimes() return self.blackMarketRefreshTimes end function BlackMarketModel:setBlackMarketRefreshTimes(val) self.blackMarketRefreshTimes = val ppdata.Base:setBlackMarketRefreshTimes(val) end function BlackMarketModel:getIsGoToBlackMarketLayer() return self.isGoToBlackMarketLayer end function BlackMarketModel:setIsGoToBlackMarketLayer(val) self.isGoToBlackMarketLayer = val end return BlackMarketModel转成TS
时间: 2023-11-22 07:54:53 浏览: 75
vue-function-api:提供Vue的逻辑组合功能
```typescript
interface BlackMarketModel {
blackMarketOpenTimestamp: number | undefined;
blackMarketRefreshTimes: number | undefined;
isGoToBlackMarketLayer: boolean;
}
const BlackMarketModel = {
initData(this: BlackMarketModel): void {
this.blackMarketOpenTimestamp = ppdata.Base.getBlackMarketOpenTime();
this.blackMarketRefreshTimes = ppdata.Base.getBlackMarketRefreshTimes();
this.isGoToBlackMarketLayer = false;
},
getBlackMarketOpenTimestamp(this: BlackMarketModel): number | undefined {
return this.blackMarketOpenTimestamp;
},
setBlackMarketOpenTimestamp(this: BlackMarketModel, val: number): void {
this.blackMarketOpenTimestamp = val;
ppdata.Base.setBlackMarketOpenTime(val);
},
getBlackMarketRefreshTimes(this: BlackMarketModel): number | undefined {
return this.blackMarketRefreshTimes;
},
setBlackMarketRefreshTimes(this: BlackMarketModel, val: number): void {
this.blackMarketRefreshTimes = val;
ppdata.Base.setBlackMarketRefreshTimes(val);
},
getIsGoToBlackMarketLayer(this: BlackMarketModel): boolean {
return this.isGoToBlackMarketLayer;
},
setIsGoToBlackMarketLayer(this: BlackMarketModel, val: boolean): void {
this.isGoToBlackMarketLayer = val;
},
};
export default BlackMarketModel;
```
阅读全文