Bubble [WIP] (still need to do the javascript part)

This commit is contained in:
jonny 2021-05-28 01:18:00 +02:00
parent 540e5783b6
commit fd5b598b63
3 changed files with 25 additions and 17 deletions

View file

@ -0,0 +1,20 @@
import { IframeApiContribution } from './IframeApiContribution';
class WorkadventureNavigationCommands extends IframeApiContribution<WorkadventureNavigationCommands> {
readonly subObjectIdentifier = "bubble"
readonly addMethodsAtRoot = true
callbacks = []
displayBubble(): void {
window.parent.postMessage({ 'type': 'displayBubble' }, '*');
}
removeBubble(): void {
window.parent.postMessage({ 'type': 'removeBubble' }, '*');
}
}
export default new WorkadventureNavigationCommands();

View file

@ -20,7 +20,7 @@ export interface IframeCallbackContribution<Guard extends tg.TypeGuard<unknown>,
callback: (payloadData: T) => void
}
export type PossibleSubobjects = "zone" | "chat" | "ui" | "nav" | "sound" | "cowebsite" | "player"
export type PossibleSubobjects = "zone" | "chat" | "ui" | "nav" | "sound" | "cowebsite" | "player" | "bubble"
/**
* !! be aware that the implemented attributes (addMethodsAtRoot and subObjectIdentifier) must be readonly
*