diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-01 11:04:24 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-02 22:07:53 +0900 |
commit | 678020a3a27713e77ec8d74483122b4258fbc829 (patch) | |
tree | 6c84d0965f05918e6fd58a0a155c15035474d563 /src/background/controllers/OperationController.ts | |
parent | 0cffb09e249832291be73be039dc1b9bb38115f9 (diff) |
Types on src/background
Diffstat (limited to 'src/background/controllers/OperationController.ts')
-rw-r--r-- | src/background/controllers/OperationController.ts | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/background/controllers/OperationController.ts b/src/background/controllers/OperationController.ts index 416aa9c..4e9c106 100644 --- a/src/background/controllers/OperationController.ts +++ b/src/background/controllers/OperationController.ts @@ -6,6 +6,16 @@ import TabSelectUseCase from '../usecases/TabSelectUseCase'; import ZoomUseCase from '../usecases/ZoomUseCase'; export default class OperationController { + private findUseCase: FindUseCase; + + private consoleUseCase: ConsoleUseCase; + + private tabUseCase: TabUseCase; + + private tabSelectUseCase: TabSelectUseCase; + + private zoomUseCase: ZoomUseCase; + constructor() { this.findUseCase = new FindUseCase(); this.consoleUseCase = new ConsoleUseCase(); @@ -15,7 +25,7 @@ export default class OperationController { } // eslint-disable-next-line complexity, max-lines-per-function - exec(operation) { + exec(operation: any): Promise<any> { switch (operation.type) { case operations.TAB_CLOSE: return this.tabUseCase.close(false); @@ -72,6 +82,7 @@ export default class OperationController { case operations.CANCEL: return this.consoleUseCase.hideConsole(); } + throw new Error('unknown operation: ' + operation.type); } } |