diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-03-28 11:02:05 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-03-28 11:02:05 +0900 |
commit | 94483920f2a32071505b913881eb7b342c910535 (patch) | |
tree | 80fa6b52c84c957c21360f84e160bfeb789ad046 /src/background/usecases/ConsoleUseCase.ts | |
parent | 9d77f734fc5556217ddff14af6b067dfbea92854 (diff) |
Move classes to a correct directory
Diffstat (limited to 'src/background/usecases/ConsoleUseCase.ts')
-rw-r--r-- | src/background/usecases/ConsoleUseCase.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/background/usecases/ConsoleUseCase.ts b/src/background/usecases/ConsoleUseCase.ts new file mode 100644 index 0000000..329e4ee --- /dev/null +++ b/src/background/usecases/ConsoleUseCase.ts @@ -0,0 +1,21 @@ +import { inject, injectable } from "tsyringe"; +import ConsoleFrameClient from "../clients/ConsoleFrameClient"; +import TabPresenter from "../presenters/TabPresenter"; + +@injectable() +export default class ConsoleUseCase { + constructor( + @inject("TabPresenter") + private readonly tabPresenter: TabPresenter, + @inject("ConsoleFrameClient") + private readonly consoleFrameClient: ConsoleFrameClient + ) {} + + async resize(width: number, height: number): Promise<void> { + const tabId = (await this.tabPresenter.getCurrent()).id; + if (typeof tabId === "undefined") { + return; + } + return this.consoleFrameClient.resize(tabId, width, height); + } +} |