A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
678 B
28 lines
678 B
import * as messages from '../../shared/messages'; |
|
|
|
export default interface ConsoleClient { |
|
info(text: string): Promise<void>; |
|
error(text: string): Promise<void>; |
|
} |
|
|
|
export class ConsoleClientImpl implements ConsoleClient { |
|
async info(text: string): Promise<void> { |
|
await browser.runtime.sendMessage({ |
|
type: messages.CONSOLE_FRAME_MESSAGE, |
|
message: { |
|
type: messages.CONSOLE_SHOW_INFO, |
|
text, |
|
}, |
|
}); |
|
} |
|
|
|
async error(text: string): Promise<void> { |
|
await browser.runtime.sendMessage({ |
|
type: messages.CONSOLE_FRAME_MESSAGE, |
|
message: { |
|
type: messages.CONSOLE_SHOW_ERROR, |
|
text, |
|
}, |
|
}); |
|
} |
|
}
|
|
|