workadventure/back/src/Model/Websocket/PointInterface.ts

19 lines
468 B
TypeScript
Raw Normal View History

import * as tg from "generic-type-guard";
/*export interface PointInterface {
readonly x: number;
readonly y: number;
readonly direction: string;
readonly moving: boolean;
}*/
2021-06-24 10:09:10 +02:00
export const isPointInterface = new tg.IsInterface()
.withProperties({
x: tg.isNumber,
y: tg.isNumber,
direction: tg.isString,
2021-06-24 10:09:10 +02:00
moving: tg.isBoolean,
})
.get();
export type PointInterface = tg.GuardedType<typeof isPointInterface>;