workadventure/pusher/src/Services/AdminApi/MapDetailsData.ts
GRL78 3f1c5246f8
TO MERGE : Contact page from Admin or Environment Variable (#1401)
* Contact page from Admin or Environment Variable

* Get contact page from admin by pusher

* Changes requested

* Modify contactPageStore management

* documentation environment variables

Co-authored-by: Gregoire Parant <g.parant@thecodingmachine.com>
2021-09-21 20:24:53 +02:00

23 lines
828 B
TypeScript

import * as tg from "generic-type-guard";
import { GameRoomPolicyTypes } from "_Model/PusherRoom";
import { isCharacterTexture } from "./CharacterTexture";
import { isAny, isNumber } from "generic-type-guard";
/*const isNumericEnum =
<T extends { [n: number]: string }>(vs: T) =>
(v: any): v is T =>
typeof v === "number" && v in vs;*/
export const isMapDetailsData = new tg.IsInterface()
.withProperties({
roomSlug: tg.isOptional(tg.isString), // deprecated
mapUrl: tg.isString,
policy_type: isNumber, //isNumericEnum(GameRoomPolicyTypes),
tags: tg.isArray(tg.isString),
textures: tg.isArray(isCharacterTexture),
contactPage: tg.isUnion(tg.isString, tg.isUndefined),
})
.get();
export type MapDetailsData = tg.GuardedType<typeof isMapDetailsData>;