import * as messages from "../../shared/messages"; export default interface FindClient { getGlobalLastKeyword(): Promise; setGlobalLastKeyword(keyword: string): Promise; } export class FindClientImpl implements FindClient { async getGlobalLastKeyword(): Promise { const keyword = await browser.runtime.sendMessage({ type: messages.FIND_GET_KEYWORD, }); return keyword as string; } async setGlobalLastKeyword(keyword: string): Promise { await browser.runtime.sendMessage({ type: messages.FIND_SET_KEYWORD, keyword: keyword, }); } }