export interface SuccessHandler { success: true; session: UserSession; } export interface ErrorHandler { success: false; error: Error | ZodError; } export type Return = SuccessHandler | ErrorHandler; export interface Project { id: number; name: string; owner: number; home: string; summary: string; } export interface Navigation { title: string; path: string; type: string; private: boolean; children?: Navigation[]; } export type FileMetadata = Record; export type FileType = 'markdown' | 'canvas' | 'file' | 'folder'; export interface File { project: number; path: string; owner: number; title: string; order: number; type: FileType; content: string; navigable: boolean; private: boolean; metadata: FileMetadata; } export interface Comment { project: number; path: number; user_id: number; sequence: number; position: number; length: number; content: string; } export interface User { id: number; username: string; } export interface Tag { tag: string; project: number; description: string; } export type ProjectSearch = Project & { pages: number; username: string; } export type FileSearch = Omit & { comments: number; username: string; } export type CommentSearch = Comment & { username: string; } export type UserSearch = User & { } export type CommentedFile = File & { comments: CommentSearch[]; } export interface Search { projects: ProjectSearch[]; files: FileSearch[]; users: UserSearch[]; }