Added world creation dialog
This commit is contained in:
@@ -1 +1,7 @@
|
||||
export type RPGColor = "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "black" | "white"
|
||||
import { z } from "zod"
|
||||
|
||||
export const rpgColors = ["red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose", "black", "white"] as const
|
||||
|
||||
export type RPGColor = typeof rpgColors[number];
|
||||
|
||||
export const rpgColorSchema = z.enum(rpgColors)
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
import { z } from "zod"
|
||||
import type { Calendar } from "./CalendarConfig"
|
||||
import { rpgColorSchema, type RPGColor } from "./Color"
|
||||
|
||||
export interface World {
|
||||
id: number
|
||||
uuid: string
|
||||
id?: number
|
||||
name: string
|
||||
description?: string
|
||||
color?: string,
|
||||
calendars?: Calendar[]
|
||||
color?: RPGColor,
|
||||
calendars?: Calendar[],
|
||||
gmId?: string
|
||||
}
|
||||
|
||||
export const postWorldSchema = z.object({
|
||||
name: z.string(),
|
||||
description: z.string().optional().nullable(),
|
||||
color: rpgColorSchema,
|
||||
gmId: z.string().optional().nullable(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user