aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/usecases')
-rw-r--r--src/content/usecases/FindUseCase.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/content/usecases/FindUseCase.ts b/src/content/usecases/FindUseCase.ts
new file mode 100644
index 0000000..9e77124
--- /dev/null
+++ b/src/content/usecases/FindUseCase.ts
@@ -0,0 +1,22 @@
+import { inject, injectable } from "tsyringe";
+import FindPresenter from "../presenters/FindPresenter";
+
+@injectable()
+export default class FindUseCase {
+ constructor(
+ @inject("FindPresenter")
+ private readonly findPresenter: FindPresenter
+ ) {}
+
+ findNext(keyword: string): boolean {
+ return this.findPresenter.find(keyword, false);
+ }
+
+ findPrev(keyword: string): boolean {
+ return this.findPresenter.find(keyword, true);
+ }
+
+ clearSelection() {
+ this.findPresenter.clearSelection();
+ }
+}