workadventure/front/src/Api/Events/OpenCoWebsiteEvent.ts

25 lines
727 B
TypeScript
Raw Normal View History

2021-10-12 10:38:49 +02:00
import * as tg from "generic-type-guard";
export const isOpenCoWebsiteEvent = new tg.IsInterface()
.withProperties({
url: tg.isString,
allowApi: tg.isOptional(tg.isBoolean),
allowPolicy: tg.isOptional(tg.isString),
widthPercent: tg.isOptional(tg.isNumber),
2021-11-24 15:29:12 +01:00
position: tg.isOptional(tg.isNumber),
2022-01-05 10:30:27 +01:00
closable: tg.isOptional(tg.isBoolean),
lazy: tg.isOptional(tg.isBoolean),
2021-10-12 10:38:49 +02:00
})
.get();
2021-10-25 18:42:51 +02:00
export const isCoWebsite = new tg.IsInterface()
2021-10-12 10:38:49 +02:00
.withProperties({
id: tg.isString,
})
.get();
/**
* A message sent from the iFrame to the game to add a message in the chat.
*/
export type OpenCoWebsiteEvent = tg.GuardedType<typeof isOpenCoWebsiteEvent>;