This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/background/usecases/FindUseCase.ts
2019-05-19 21:34:08 +09:00

27 lines
758 B
TypeScript

import { injectable } from 'tsyringe';
import FindRepository from '../repositories/FindRepository';
import TabPresenter from '../presenters/TabPresenter';
import ConsoleClient from '../infrastructures/ConsoleClient';
@injectable()
export default class FindUseCase {
constructor(
private tabPresenter: TabPresenter,
private findRepository: FindRepository,
private consoleClient: 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);
}
}