diff options
Diffstat (limited to 'src/background/usecases')
-rw-r--r-- | src/background/usecases/CommandUseCase.ts | 16 | ||||
-rw-r--r-- | src/background/usecases/FindUseCase.ts | 2 | ||||
-rw-r--r-- | src/background/usecases/LinkUseCase.ts | 8 | ||||
-rw-r--r-- | src/background/usecases/MarkUseCase.ts | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/src/background/usecases/CommandUseCase.ts b/src/background/usecases/CommandUseCase.ts index 18ddd4d..29e6e7c 100644 --- a/src/background/usecases/CommandUseCase.ts +++ b/src/background/usecases/CommandUseCase.ts @@ -58,7 +58,7 @@ export default class CommandUseCase { } // eslint-disable-next-line max-statements - async buffer(keywords: string): Promise<any> { + async buffer(keywords: string): Promise<void> { if (keywords.length === 0) { return; } @@ -95,7 +95,7 @@ export default class CommandUseCase { return this.tabPresenter.select(tabs[0].id as number); } - async bdelete(force: boolean, keywords: string): Promise<any> { + async bdelete(force: boolean, keywords: string): Promise<void> { const excludePinned = !force; const tabs = await this.tabPresenter.getByKeyword(keywords, excludePinned); if (tabs.length === 0) { @@ -106,32 +106,32 @@ export default class CommandUseCase { return this.tabPresenter.remove([tabs[0].id as number]); } - async bdeletes(force: boolean, keywords: string): Promise<any> { + async bdeletes(force: boolean, keywords: string): Promise<void> { const excludePinned = !force; const tabs = await this.tabPresenter.getByKeyword(keywords, excludePinned); const ids = tabs.map((tab) => tab.id as number); return this.tabPresenter.remove(ids); } - async quit(): Promise<any> { + async quit(): Promise<void> { const tab = await this.tabPresenter.getCurrent(); return this.tabPresenter.remove([tab.id as number]); } - async quitAll(): Promise<any> { + async quitAll(): Promise<void> { const tabs = await this.tabPresenter.getAll(); const ids = tabs.map((tab) => tab.id as number); this.tabPresenter.remove(ids); } - async addbookmark(title: string): Promise<any> { + async addbookmark(title: string): Promise<void> { const tab = await this.tabPresenter.getCurrent(); const item = await this.bookmarkRepository.create(title, tab.url as string); const message = "Saved current page: " + item.url; return this.consoleClient.showInfo(tab.id as number, message); } - async set(keywords: string): Promise<any> { + async set(keywords: string): Promise<void> { if (keywords.length === 0) { return; } @@ -145,7 +145,7 @@ export default class CommandUseCase { return this.helpPresenter.open(); } - private async urlOrSearch(keywords: string): Promise<any> { + private async urlOrSearch(keywords: string): Promise<string> { const settings = await this.cachedSettingRepository.get(); return urls.searchUrl(keywords, settings.search); } diff --git a/src/background/usecases/FindUseCase.ts b/src/background/usecases/FindUseCase.ts index ce96e03..cc111f2 100644 --- a/src/background/usecases/FindUseCase.ts +++ b/src/background/usecases/FindUseCase.ts @@ -9,7 +9,7 @@ export default class FindUseCase { return this.findRepository.getKeyword(); } - setKeyword(keyword: string): Promise<any> { + setKeyword(keyword: string): Promise<void> { return this.findRepository.setKeyword(keyword); } } diff --git a/src/background/usecases/LinkUseCase.ts b/src/background/usecases/LinkUseCase.ts index d2cd464..7fa3d9c 100644 --- a/src/background/usecases/LinkUseCase.ts +++ b/src/background/usecases/LinkUseCase.ts @@ -5,15 +5,15 @@ import TabPresenter from "../presenters/TabPresenter"; export default class LinkUseCase { constructor(@inject("TabPresenter") private tabPresenter: TabPresenter) {} - openToTab(url: string, tabId: number): Promise<any> { - return this.tabPresenter.open(url, tabId); + async openToTab(url: string, tabId: number): Promise<void> { + await this.tabPresenter.open(url, tabId); } async openNewTab( url: string, openerId: number, background: boolean - ): Promise<any> { + ): Promise<void> { const properties: any = { active: !background }; const platform = await browser.runtime.getPlatformInfo(); @@ -22,6 +22,6 @@ export default class LinkUseCase { properties.openerTabId = openerId; } - return this.tabPresenter.create(url, properties); + await this.tabPresenter.create(url, properties); } } diff --git a/src/background/usecases/MarkUseCase.ts b/src/background/usecases/MarkUseCase.ts index 57e04b4..e9640ee 100644 --- a/src/background/usecases/MarkUseCase.ts +++ b/src/background/usecases/MarkUseCase.ts @@ -15,13 +15,13 @@ export default class MarkUseCase { private readonly contentMessageClient: ContentMessageClient ) {} - async setGlobal(key: string, x: number, y: number): Promise<any> { + async setGlobal(key: string, x: number, y: number): Promise<void> { const tab = await this.tabPresenter.getCurrent(); const mark = { tabId: tab.id as number, url: tab.url as string, x, y }; return this.markRepository.setMark(key, mark); } - async jumpGlobal(key: string): Promise<any> { + async jumpGlobal(key: string): Promise<void> { const current = await this.tabPresenter.getCurrent(); const mark = await this.markRepository.getMark(key); |