aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases/FindUseCase.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-06-14 23:14:51 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-07-05 21:32:43 +0900
commit65cf6f0842d8d5933dc13b3767b1baf398d68cd5 (patch)
treedf9a8b139fd98adb79f075ba655d1303bdf3fd1d /src/content/usecases/FindUseCase.ts
parentcaced372415a944c4297157397d0027ba629fff0 (diff)
Implement FindNextOperator
Diffstat (limited to 'src/content/usecases/FindUseCase.ts')
-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();
+ }
+}