2021-03-09 16:21:14 +01:00
|
|
|
import * as tg from "generic-type-guard";
|
|
|
|
|
|
|
|
const isButtonDescriptor =
|
|
|
|
new tg.IsInterface().withProperties({
|
|
|
|
label: tg.isString,
|
2021-03-09 18:57:25 +01:00
|
|
|
className: tg.isOptional(tg.isString)
|
2021-03-09 16:21:14 +01:00
|
|
|
}).get();
|
|
|
|
|
|
|
|
export const isOpenPopupEvent =
|
|
|
|
new tg.IsInterface().withProperties({
|
|
|
|
popupId: tg.isNumber,
|
|
|
|
targetObject: tg.isString,
|
|
|
|
message: tg.isString,
|
2021-03-09 18:05:07 +01:00
|
|
|
buttons: tg.isArray(isButtonDescriptor)
|
2021-03-09 16:21:14 +01:00
|
|
|
}).get();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A message sent from the iFrame to the game to add a message in the chat.
|
|
|
|
*/
|
|
|
|
export type OpenPopupEvent = tg.GuardedType<typeof isOpenPopupEvent>;
|