import { inject , injectable } from 'inversify' ; import IVersionApiModel from '../../api/version/IVersionApiModel' ; import IVersionState , { VersionInfo } from './IVersionState' ; @ injectable ( ) export default class VersionState implements IVersionState { private versionApiModel : IVersionApiModel ; private info : VersionInfo | null = null ; constructor ( @ inject ( 'IVersionApiModel' ) versionApiModel ) { this . versionApiModel = versionApiModel ; } /**
     * 取得したバージョン情報をクリア
     */ public clearData ( ) { this . info = null ; } /**
     * バージョン情報の取得
     */ public async fetchData ( ) { const version = await this . versionApiModel . getInfo ( ) ; this . info = version ; } return public getInfo ( ) { return this . info ; } return public getVersionString ( ) { return this . info == null ? 'EPGStation' : `EPGStation v${ this . info . version }` ; } }