import type { Prisma, GlobalRole } from "@prisma/client";
export type AppThemeScheme = "light" | "dark";
export type WithThemeSchemeProp = {
themeScheme: AppThemeScheme;
};
export interface AppSessionData extends Prisma.JsonObject {
sessionId: null | string;
authenticated: boolean;
flash_message: null | string;
flash_message_shown_once: boolean;
curr_user_avatar_uri: null | string;
curr_user_uid: null | string;
curr_user_username: null | string;
curr_user_role: null | GlobalRole;
two_factor_lock: boolean;
two_factor_complete: boolean;
}
export interface CommonViewProps {
authenticated: boolean;
themeScheme: AppThemeScheme;
title?: string;
}
export type CommonProps = { commonProps: CommonViewProps };
export interface LanguageDetectFn {
(path: string, callback: (err: Error, language: string | null) => void): void;
sync: (path: string | null) => string | null;
contents: (path: string, content: string) => string | null;
filename: (path: string) => string | null;
shebang: (content: string) => string | null;
classify: (content: string) => string | null;
}
export interface RepositoryHead {
treeId: string;
parentId: null | string;
author: {
name: string;
email: string;
timestamp: number;
timezone: string;
};
committer: {
name: string;
email: string;
timestamp: number;
timezone: string;
};
commitMessage: string;
}
export interface RepositoryFile {
id: string;
name: string;
permissions: string;
type: "blob" | "tree";
}
export interface RepositoryFileContent {
content: string;
mimeType: string;
}