Hints as a classes
This commit is contained in:
parent
8cef5981b8
commit
fb8b4d28ce
7 changed files with 318 additions and 177 deletions
|
@ -1,18 +1,22 @@
|
|||
import * as messages from '../../shared/messages';
|
||||
|
||||
export default interface TabsClient {
|
||||
openUrl(url: string, newTab: boolean): Promise<void>;
|
||||
openUrl(url: string, newTab: boolean, background?: boolean): Promise<void>;
|
||||
|
||||
// eslint-disable-next-line semi
|
||||
}
|
||||
|
||||
export class TabsClientImpl {
|
||||
async openUrl(url: string, newTab: boolean): Promise<void> {
|
||||
export class TabsClientImpl implements TabsClient {
|
||||
async openUrl(
|
||||
url: string,
|
||||
newTab: boolean,
|
||||
background?: boolean,
|
||||
): Promise<void> {
|
||||
await browser.runtime.sendMessage({
|
||||
type: messages.OPEN_URL,
|
||||
url,
|
||||
newTab,
|
||||
background,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue