diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-10 22:27:20 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-10 23:00:59 +0900 |
commit | e76ca380f733b515c31297a285d8bea44e074a1b (patch) | |
tree | b476d9ca41a8bbbcbbad3b3ee13882da9d640d25 /src/content/client | |
parent | 05ef6a8ca35aaa801c11eb6b4896caa3690058af (diff) |
Make addon-enabled as a clean architecture
Diffstat (limited to 'src/content/client')
-rw-r--r-- | src/content/client/AddonIndicatorClient.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/content/client/AddonIndicatorClient.ts b/src/content/client/AddonIndicatorClient.ts new file mode 100644 index 0000000..afb9fa4 --- /dev/null +++ b/src/content/client/AddonIndicatorClient.ts @@ -0,0 +1,16 @@ +import * as messages from '../../shared/messages'; + +export default interface AddonIndicatorClient { + setEnabled(enabled: boolean): Promise<void>; + + // eslint-disable-next-line semi +} + +export class AddonIndicatorClientImpl implements AddonIndicatorClient { + setEnabled(enabled: boolean): Promise<void> { + return browser.runtime.sendMessage({ + type: messages.ADDON_ENABLED_RESPONSE, + enabled, + }); + } +} |