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().or(z.null()), }); export const item: z.ZodType = baseItem.extend({ children: z.lazy(() => item.array().optional()), }); export const project = z.array(item); type Project = z.infer; type ProjectItem = z.infer & { children?: ProjectItem[] };