mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-19 01:37:49 -05:00
34 lines
811 B
TypeScript
34 lines
811 B
TypeScript
import type { Mode } from ".prisma/client";
|
|
import { z } from "zod";
|
|
import type { Unpacked } from "~/utils";
|
|
import { assertType } from "./assertType";
|
|
|
|
type MapList = z.infer<typeof ModeSchema>;
|
|
assertType<Unpacked<MapList>, Mode>();
|
|
|
|
export const ModeSchema = z.enum(["TW", "SZ", "TC", "RM", "CB"]);
|
|
|
|
export type SeedVariations = z.infer<typeof SeedVariationsSchema>;
|
|
export const SeedVariationsSchema = z.enum([
|
|
"check-in",
|
|
"match",
|
|
"tournament-start",
|
|
"looking",
|
|
"looking-match",
|
|
]);
|
|
|
|
export type LoggedInUser = NonNullable<
|
|
z.infer<typeof LoggedInUserSchema>
|
|
>["user"];
|
|
export const LoggedInUserSchema = z
|
|
.object({
|
|
user: z
|
|
.object({
|
|
id: z.string(),
|
|
discordId: z.string(),
|
|
discordAvatar: z.string().nullable(),
|
|
})
|
|
.nullish(),
|
|
})
|
|
.nullish();
|