WIP API updates for tutorial and more

This commit is contained in:
Benedicte Quimbert 2021-11-10 19:04:06 +01:00
parent c53f0c6c8c
commit d672a2dead
7 changed files with 115 additions and 15 deletions

View file

@ -22,6 +22,8 @@ export const isEmbeddedWebsiteEvent = new tg.IsInterface()
y: tg.isNumber,
width: tg.isNumber,
height: tg.isNumber,
origin: tg.isSingletonStringUnion("player", "map"),
scale: tg.isNumber,
})
.get();
@ -35,6 +37,8 @@ export const isCreateEmbeddedWebsiteEvent = new tg.IsInterface()
visible: tg.isBoolean,
allowApi: tg.isBoolean,
allow: tg.isString,
origin: tg.isSingletonStringUnion("player", "map"),
scale: tg.isNumber,
})
.get();

View file

@ -215,6 +215,7 @@ export const isIframeQuery = (event: any): event is IframeQuery<keyof IframeQuer
const result = iframeQueryMapTypeGuards[type].query(event.data);
if (!result) {
console.warn('Received a query with type "' + type + '" but the payload is invalid.');
console.log(event);
}
return result;
};