diff options
Diffstat (limited to 'src/background/usecases/FindUseCase.ts')
-rw-r--r-- | src/background/usecases/FindUseCase.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/background/usecases/FindUseCase.ts b/src/background/usecases/FindUseCase.ts new file mode 100644 index 0000000..d567800 --- /dev/null +++ b/src/background/usecases/FindUseCase.ts @@ -0,0 +1,30 @@ +import FindRepository from '../repositories/FindRepository'; +import TabPresenter from '../presenters/TabPresenter'; +import ConsoleClient from '../infrastructures/ConsoleClient'; + +export default class FindUseCase { + private tabPresenter: TabPresenter; + + private findRepository: FindRepository; + + private consoleClient: ConsoleClient; + + constructor() { + this.tabPresenter = new TabPresenter(); + this.findRepository = new FindRepository(); + this.consoleClient = new ConsoleClient(); + } + + getKeyword(): Promise<string> { + return this.findRepository.getKeyword(); + } + + setKeyword(keyword: string): Promise<any> { + return this.findRepository.setKeyword(keyword); + } + + async findStart(): Promise<any> { + let tab = await this.tabPresenter.getCurrent(); + return this.consoleClient.showFind(tab.id as number); + } +} |