import type * as tg from "generic-type-guard"; import type { IframeEvent, IframeEventMap, IframeResponseEventMap } from '../Events/IframeEvent'; export function sendToWorkadventure(content: IframeEvent) { window.parent.postMessage(content, "*") } type GuardedType> = Guard extends tg.TypeGuard ? T : never export interface IframeCallback> { typeChecker: Guard, callback: (payloadData: T) => void } export interface IframeCallbackContribution extends IframeCallback { type: Key } /** * !! be aware that the implemented attributes (addMethodsAtRoot and subObjectIdentifier) must be readonly * * */ export abstract class IframeApiContribution>, }> { abstract callbacks: T["callbacks"] }