Admin /api/map endpoint return type is now generated with generic type guards

This commit is contained in:
David Négrier 2021-07-16 09:52:51 +02:00
parent d0d191fc28
commit a4a123c331
9 changed files with 60 additions and 22 deletions

View file

@ -0,0 +1,11 @@
import * as tg from "generic-type-guard";
export const isCharacterTexture = new tg.IsInterface()
.withProperties({
id: tg.isNumber,
level: tg.isNumber,
url: tg.isString,
rights: tg.isString,
})
.get();
export type CharacterTexture = tg.GuardedType<typeof isCharacterTexture>;