You've already forked obsidian-visualiser
Add order in file schema and main projecct edition
This commit is contained in:
@@ -2,12 +2,13 @@ import { z } from "zod";
|
||||
|
||||
export const schema = z.object({
|
||||
path: z.string(),
|
||||
owner: z.number(),
|
||||
owner: z.number().finite(),
|
||||
title: z.string(),
|
||||
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
|
||||
content: z.string(),
|
||||
navigable: z.boolean(),
|
||||
private: z.boolean(),
|
||||
order: z.number().finite(),
|
||||
});
|
||||
|
||||
export type File = z.infer<typeof schema>;
|
||||
15
schemas/navigation.ts
Normal file
15
schemas/navigation.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const single = z.object({
|
||||
path: z.string(),
|
||||
owner: z.number().finite(),
|
||||
title: z.string(),
|
||||
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
|
||||
navigable: z.boolean(),
|
||||
private: z.boolean(),
|
||||
order: z.number().finite(),
|
||||
});
|
||||
export const table = z.array(single);
|
||||
|
||||
export type Navigation = z.infer<typeof table>;
|
||||
export type NavigationItem = z.infer<typeof single>;
|
||||
Reference in New Issue
Block a user