import { z } from "zod"; import { fileType } from "./file"; const baseItem = z.object({ path: z.string(), parent: z.string(), name: z.string(), title: z.string(), type: fileType, navigable: z.boolean(), private: z.boolean(), order: z.number().finite(), content: z.string().optional(), }); export const item: z.ZodType = baseItem.extend({ children: z.lazy(() => item.array().optional()), }); export const project = z.object({ items: z.array(item), }); export type Project = z.infer; export type ProjectItem = z.infer & { children?: ProjectItem[] };