Merge branch 'develop' of github.com:thecodingmachine/workadventure into develop
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
import * as tg from "generic-type-guard";
|
||||
import { z } from "zod";
|
||||
|
||||
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),
|
||||
position: tg.isOptional(tg.isNumber),
|
||||
closable: tg.isOptional(tg.isBoolean),
|
||||
lazy: tg.isOptional(tg.isBoolean),
|
||||
hint: tg.isOptional(tg.isString),
|
||||
})
|
||||
.get();
|
||||
export const isOpenCoWebsiteEvent = z.object({
|
||||
url: z.string(),
|
||||
allowApi: z.optional(z.boolean()),
|
||||
allowPolicy: z.optional(z.string()),
|
||||
widthPercent: z.optional(z.number()),
|
||||
position: z.optional(z.number()),
|
||||
closable: z.optional(z.boolean()),
|
||||
lazy: z.optional(z.boolean()),
|
||||
hint: z.optional(z.string()),
|
||||
});
|
||||
|
||||
export const isCoWebsite = new tg.IsInterface()
|
||||
.withProperties({
|
||||
id: tg.isString,
|
||||
})
|
||||
.get();
|
||||
export const isCoWebsite = z.object({
|
||||
id: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* A message sent from the iFrame to the game to add a message in the chat.
|
||||
*/
|
||||
export type OpenCoWebsiteEvent = tg.GuardedType<typeof isOpenCoWebsiteEvent>;
|
||||
export type OpenCoWebsiteEvent = z.infer<typeof isOpenCoWebsiteEvent>;
|
||||
|
||||
Reference in New Issue
Block a user