16 lines
445 B
TypeScript
16 lines
445 B
TypeScript
import { z } from "zod";
|
|
|
|
export const fileType = z.enum(['folder', 'file', 'markdown', 'canvas', 'map']);
|
|
export const schema = z.object({
|
|
path: z.string(),
|
|
owner: z.number().finite(),
|
|
title: z.string(),
|
|
type: fileType,
|
|
content: z.string(),
|
|
navigable: z.boolean(),
|
|
private: z.boolean(),
|
|
order: z.number().finite(),
|
|
});
|
|
|
|
export type FileType = z.infer<typeof fileType>;
|
|
export type File = z.infer<typeof schema>;
|