aboutsummaryrefslogtreecommitdiff
path: root/src/background/infrastructures
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/infrastructures')
-rw-r--r--src/background/infrastructures/ConsoleClient.ts20
-rw-r--r--src/background/infrastructures/ContentMessageListener.ts21
2 files changed, 22 insertions, 19 deletions
diff --git a/src/background/infrastructures/ConsoleClient.ts b/src/background/infrastructures/ConsoleClient.ts
index 2a1df5b..f2d0e8a 100644
--- a/src/background/infrastructures/ConsoleClient.ts
+++ b/src/background/infrastructures/ConsoleClient.ts
@@ -2,47 +2,47 @@ import { injectable } from "tsyringe";
import * as messages from "../../shared/messages";
export default interface ConsoleClient {
- showCommand(tabId: number, command: string): Promise<any>;
+ showCommand(tabId: number, command: string): Promise<void>;
- showFind(tabId: number): Promise<any>;
+ showFind(tabId: number): Promise<void>;
- showInfo(tabId: number, message: string): Promise<any>;
+ showInfo(tabId: number, message: string): Promise<void>;
- showError(tabId: number, message: string): Promise<any>;
+ showError(tabId: number, message: string): Promise<void>;
- hide(tabId: number): Promise<any>;
+ hide(tabId: number): Promise<void>;
}
@injectable()
export class ConsoleClientImpl implements ConsoleClient {
- showCommand(tabId: number, command: string): Promise<any> {
+ showCommand(tabId: number, command: string): Promise<void> {
return browser.tabs.sendMessage(tabId, {
type: messages.CONSOLE_SHOW_COMMAND,
command,
});
}
- showFind(tabId: number): Promise<any> {
+ showFind(tabId: number): Promise<void> {
return browser.tabs.sendMessage(tabId, {
type: messages.CONSOLE_SHOW_FIND,
});
}
- showInfo(tabId: number, message: string): Promise<any> {
+ showInfo(tabId: number, message: string): Promise<void> {
return browser.tabs.sendMessage(tabId, {
type: messages.CONSOLE_SHOW_INFO,
text: message,
});
}
- showError(tabId: number, message: string): Promise<any> {
+ showError(tabId: number, message: string): Promise<void> {
return browser.tabs.sendMessage(tabId, {
type: messages.CONSOLE_SHOW_ERROR,
text: message,
});
}
- hide(tabId: number): Promise<any> {
+ hide(tabId: number): Promise<void> {
return browser.tabs.sendMessage(tabId, {
type: messages.CONSOLE_HIDE,
});
diff --git a/src/background/infrastructures/ContentMessageListener.ts b/src/background/infrastructures/ContentMessageListener.ts
index 6978d35..26f98ab 100644
--- a/src/background/infrastructures/ContentMessageListener.ts
+++ b/src/background/infrastructures/ContentMessageListener.ts
@@ -61,7 +61,7 @@ export default class ContentMessageListener {
onMessage(
message: messages.Message,
senderTab: browser.tabs.Tab
- ): Promise<any> | any {
+ ): Promise<unknown> | unknown {
switch (message.type) {
case messages.CONSOLE_GET_COMPLETION_TYPES:
return this.completionController.getCompletionTypes();
@@ -110,11 +110,11 @@ export default class ContentMessageListener {
throw new Error("unsupported message: " + message.type);
}
- onConsoleEnterCommand(text: string): Promise<any> {
+ onConsoleEnterCommand(text: string): Promise<unknown> {
return this.commandController.exec(text);
}
- async onSettingsQuery(): Promise<any> {
+ async onSettingsQuery(): Promise<unknown> {
return (await this.settingController.getSetting()).toJSON();
}
@@ -122,11 +122,11 @@ export default class ContentMessageListener {
return this.findController.getKeyword();
}
- onFindSetKeyword(keyword: string): Promise<any> {
+ onFindSetKeyword(keyword: string): Promise<void> {
return this.findController.setKeyword(keyword);
}
- onAddonEnabledResponse(enabled: boolean): Promise<any> {
+ onAddonEnabledResponse(enabled: boolean): Promise<void> {
return this.addonEnabledController.indicate(enabled);
}
@@ -135,22 +135,25 @@ export default class ContentMessageListener {
url: string,
openerId: number,
background: boolean
- ): Promise<any> {
+ ): Promise<void> {
if (newTab) {
return this.linkController.openNewTab(url, openerId, background);
}
return this.linkController.openToTab(url, openerId);
}
- onBackgroundOperation(count: number, op: operations.Operation): Promise<any> {
+ onBackgroundOperation(
+ count: number,
+ op: operations.Operation
+ ): Promise<void> {
return this.operationController.exec(count, op);
}
- onMarkSetGlobal(key: string, x: number, y: number): Promise<any> {
+ onMarkSetGlobal(key: string, x: number, y: number): Promise<void> {
return this.markController.setGlobal(key, x, y);
}
- onMarkJumpGlobal(key: string): Promise<any> {
+ onMarkJumpGlobal(key: string): Promise<void> {
return this.markController.jumpGlobal(key);
}