From ccbe08cf66e16084c919f0b2fa2da81258c01d41 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 25 May 2019 21:33:33 +0900 Subject: Repeat last operation --- src/content/client/BackgroundClient.ts | 13 ------------- src/content/client/OperationClient.ts | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) delete mode 100644 src/content/client/BackgroundClient.ts create mode 100644 src/content/client/OperationClient.ts (limited to 'src/content/client') diff --git a/src/content/client/BackgroundClient.ts b/src/content/client/BackgroundClient.ts deleted file mode 100644 index 4a41184..0000000 --- a/src/content/client/BackgroundClient.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { injectable } from 'tsyringe'; -import * as operations from '../../shared/operations'; -import * as messages from '../../shared/messages'; - -@injectable() -export default class BackgroundClient { - execBackgroundOp(op: operations.Operation): Promise { - return browser.runtime.sendMessage({ - type: messages.BACKGROUND_OPERATION, - operation: op, - }); - } -} diff --git a/src/content/client/OperationClient.ts b/src/content/client/OperationClient.ts new file mode 100644 index 0000000..d699fec --- /dev/null +++ b/src/content/client/OperationClient.ts @@ -0,0 +1,15 @@ +import * as operations from '../../shared/operations'; +import * as messages from '../../shared/messages'; + +export default interface OperationClient { + execBackgroundOp(op: operations.Operation): Promise; +} + +export class OperationClientImpl implements OperationClient { + execBackgroundOp(op: operations.Operation): Promise { + return browser.runtime.sendMessage({ + type: messages.BACKGROUND_OPERATION, + operation: op, + }); + } +} -- cgit v1.2.3