import * as messages from '../../shared/messages'; export default interface ConsoleClient { info(text: string): Promise; error(text: string): Promise; } 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, }, }); } }