aboutsummaryrefslogtreecommitdiff
path: root/src/content/controllers/FindController.ts
blob: 3087d5d3821f1c8f8dc8b64215963e4ed2aadc26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { injectable } from "tsyringe";
import * as messages from "../../shared/messages";
import FindUseCase from "../usecases/FindUseCase";

@injectable()
export default class FindController {
  constructor(private findUseCase: FindUseCase) {}

  async start(m: messages.ConsoleEnterFindMessage): Promise<void> {
    await this.findUseCase.startFind(m.text);
  }

  async next(_: messages.FindNextMessage): Promise<void> {
    await this.findUseCase.findNext();
  }

  async prev(_: messages.FindPrevMessage): Promise<void> {
    await this.findUseCase.findPrev();
  }
}