import * as messages from "../../shared/messages"; export default interface NavigateClient { historyNext(tabId: number): Promise; historyPrev(tabId: number): Promise; linkNext(tabId: number): Promise; linkPrev(tabId: number): Promise; } export class NavigateClientImpl implements NavigateClient { async historyNext(tabId: number): Promise { await browser.tabs.sendMessage(tabId, { type: messages.NAVIGATE_HISTORY_NEXT, }); } async historyPrev(tabId: number): Promise { await browser.tabs.sendMessage(tabId, { type: messages.NAVIGATE_HISTORY_PREV, }); } async linkNext(tabId: number): Promise { await browser.tabs.sendMessage(tabId, { type: messages.NAVIGATE_LINK_NEXT, }); } async linkPrev(tabId: number): Promise { await browser.tabs.sendMessage(tabId, { type: messages.NAVIGATE_LINK_PREV, }); } }