2021-08-24 17:35:06 +02:00
|
|
|
import * as tg from "generic-type-guard";
|
|
|
|
|
|
|
|
/**
|
2021-08-27 10:34:03 +02:00
|
|
|
* A message sent from a script to the game to remove a custom menu from the menu
|
2021-08-24 17:35:06 +02:00
|
|
|
*/
|
2021-08-27 10:34:03 +02:00
|
|
|
export const isUnregisterMenuEvent = new tg.IsInterface()
|
2021-08-24 17:35:06 +02:00
|
|
|
.withProperties({
|
2021-08-27 10:34:03 +02:00
|
|
|
name: tg.isString,
|
2021-08-24 17:35:06 +02:00
|
|
|
})
|
|
|
|
.get();
|
|
|
|
|
2021-08-27 10:34:03 +02:00
|
|
|
export type UnregisterMenuEvent = tg.GuardedType<typeof isUnregisterMenuEvent>;
|
2021-08-24 17:35:06 +02:00
|
|
|
|
2021-08-27 10:34:03 +02:00
|
|
|
export const isMenuRegisterOptions = new tg.IsInterface()
|
2021-08-24 17:35:06 +02:00
|
|
|
.withProperties({
|
2021-08-27 10:34:03 +02:00
|
|
|
allowApi: tg.isBoolean,
|
2021-08-24 17:35:06 +02:00
|
|
|
})
|
|
|
|
.get();
|
|
|
|
|
|
|
|
/**
|
2021-08-27 10:34:03 +02:00
|
|
|
* A message sent from a script to the game to add a custom menu from the menu
|
2021-08-24 17:35:06 +02:00
|
|
|
*/
|
2021-08-27 10:34:03 +02:00
|
|
|
export const isMenuRegisterEvent = new tg.IsInterface()
|
2021-08-24 17:35:06 +02:00
|
|
|
.withProperties({
|
|
|
|
name: tg.isString,
|
2021-08-27 10:34:03 +02:00
|
|
|
iframe: tg.isUnion(tg.isString, tg.isUndefined),
|
|
|
|
options: isMenuRegisterOptions,
|
2021-08-24 17:35:06 +02:00
|
|
|
})
|
|
|
|
.get();
|
|
|
|
|
2021-08-27 10:34:03 +02:00
|
|
|
export type MenuRegisterEvent = tg.GuardedType<typeof isMenuRegisterEvent>;
|