import * as messages from '../../shared/messages'; export default interface ConsoleClient { info(text: string): Promise; error(text: string): Promise; // eslint-disable-next-line semi } export class ConsoleClientImpl implements ConsoleClient { async info(text: string): Promise { await browser.runtime.sendMessage({ type: messages.CONSOLE_FRAME_MESSAGE, message: { type: messages.CONSOLE_SHOW_INFO, text, }, }); } async error(text: string): Promise { await browser.runtime.sendMessage({ type: messages.CONSOLE_FRAME_MESSAGE, message: { type: messages.CONSOLE_SHOW_ERROR, text, }, }); } }