aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/ConsoleUseCase.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/usecases/ConsoleUseCase.ts')
-rw-r--r--src/background/usecases/ConsoleUseCase.ts34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/background/usecases/ConsoleUseCase.ts b/src/background/usecases/ConsoleUseCase.ts
index 2de5bc1..195c70f 100644
--- a/src/background/usecases/ConsoleUseCase.ts
+++ b/src/background/usecases/ConsoleUseCase.ts
@@ -1,59 +1,57 @@
-import { inject, injectable } from 'tsyringe';
-import TabPresenter from '../presenters/TabPresenter';
-import ConsoleClient from '../infrastructures/ConsoleClient';
+import { inject, injectable } from "tsyringe";
+import TabPresenter from "../presenters/TabPresenter";
+import ConsoleClient from "../infrastructures/ConsoleClient";
@injectable()
export default class ConsoleUseCase {
-
constructor(
- @inject('TabPresenter') private tabPresenter: TabPresenter,
- private consoleClient: ConsoleClient,
- ) {
- }
+ @inject("TabPresenter") private tabPresenter: TabPresenter,
+ private consoleClient: ConsoleClient
+ ) {}
async showCommand(): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
- return this.consoleClient.showCommand(tab.id as number, '');
+ return this.consoleClient.showCommand(tab.id as number, "");
}
async showOpenCommand(alter: boolean): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
- let command = 'open ';
+ let command = "open ";
if (alter) {
- command += tab.url || '';
+ command += tab.url || "";
}
return this.consoleClient.showCommand(tab.id as number, command);
}
async showTabopenCommand(alter: boolean): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
- let command = 'tabopen ';
+ let command = "tabopen ";
if (alter) {
- command += tab.url || '';
+ command += tab.url || "";
}
return this.consoleClient.showCommand(tab.id as number, command);
}
async showWinopenCommand(alter: boolean): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
- let command = 'winopen ';
+ let command = "winopen ";
if (alter) {
- command += tab.url || '';
+ command += tab.url || "";
}
return this.consoleClient.showCommand(tab.id as number, command);
}
async showBufferCommand(): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
- const command = 'buffer ';
+ const command = "buffer ";
return this.consoleClient.showCommand(tab.id as number, command);
}
async showAddbookmarkCommand(alter: boolean): Promise<any> {
const tab = await this.tabPresenter.getCurrent();
- let command = 'addbookmark ';
+ let command = "addbookmark ";
if (alter) {
- command += tab.title || '';
+ command += tab.title || "";
}
return this.consoleClient.showCommand(tab.id as number, command);
}