Add endpoints on pusher to resolve wokas

This commit is contained in:
Alexis Faizeau
2022-02-17 15:02:11 +01:00
committed by David Négrier
parent f993aa4f5a
commit 2161a40e05
12 changed files with 1880 additions and 1 deletions
+64
View File
@@ -0,0 +1,64 @@
import * as tg from "generic-type-guard";
//The list of all the player textures, both the default models and the partial textures used for customization
export const isWokaTexture = new tg.IsInterface()
.withProperties({
id: tg.isString,
name: tg.isString,
url: tg.isString,
position: tg.isNumber,
})
.withOptionalProperties({
tags: tg.isArray(tg.isString),
tintable: tg.isBoolean,
})
.get();
export type WokaTexture = tg.GuardedType<typeof isWokaTexture>;
export const isWokaTextureCollection = new tg.IsInterface()
.withProperties({
name: tg.isString,
position: tg.isNumber,
textures: tg.isArray(isWokaTexture),
})
.get();
export type WokaTextureCollection = tg.GuardedType<typeof isWokaTextureCollection>;
export const isWokaPartType = new tg.IsInterface()
.withProperties({
collections: tg.isArray(isWokaTextureCollection),
})
.withOptionalProperties({
required: tg.isBoolean,
})
.get();
export type WokaPartType = tg.GuardedType<typeof isWokaPartType>;
export const isWokaList = new tg.IsInterface().withStringIndexSignature(isWokaPartType).get();
export type WokaList = tg.GuardedType<typeof isWokaList>;
export const wokaPartNames = ["woka", "body", "eyes", "hair", "clothes", "hat", "accessory"];
export const isWokaDetail = new tg.IsInterface()
.withProperties({
id: tg.isString,
})
.withOptionalProperties({
texture: tg.isString,
})
.get();
export type WokaDetail = tg.GuardedType<typeof isWokaDetail>;
export const isWokaDetailsResult = new tg.IsInterface()
.withProperties({
details: tg.isArray(isWokaDetail),
})
.get();
export type WokaDetailsResult = tg.GuardedType<typeof isWokaDetailsResult>;