import type { GoToPageEvent } from '../Events/GoToPageEvent'; import type { OpenTabEvent } from '../Events/OpenTabEvent'; import { IframeApiContribution, sendToWorkadventure } from './IframeApiContribution'; class WorkadventureNavigationCommands extends IframeApiContribution { readonly subObjectIdentifier = "nav" readonly addMethodsAtRoot = true callbacks = [] openTab(url: string): void { sendToWorkadventure({ "type": 'openTab', "data": { url } as OpenTabEvent }); } goToPage(url: string): void { sendToWorkadventure({ "type": 'goToPage', "data": { url } as GoToPageEvent }); } } export default new WorkadventureNavigationCommands();