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 IDocSectionEntrypoint {
slug: string;
firstPageSlug: string;
coverImageUrl: string;
title: string;
summary: string;
}
export interface Section {
slug: string;
title: string;
summary: string;
pagesBySlug: {
[pageSlug: string]: Page;
};
}
export interface PageSummary {
title: string;
subtitle?: string;
href: string;
}
export interface Page {
slug: string;
content: string;
tableOfContent: Array<{
title: string;
targetAnchor: string;
depth: number;
}>;
metas: {
[x: string]: any;
title?: string;
summary?: string;
showExamples?: string;
examplesFile?: string;
prevPage?: null | PageSummary;
nextPage?: null | PageSummary;
};
}
export type SectionsPagesIndex = {
[sectionSlug: string]: string[];
};
export type SectionsWithPages = {
[sectionSlug: string]: Section;
};
export interface CommonViewProps {
authenticated: boolean;
currentSectionSlug: string | undefined;
currentPageSlug: string | undefined;
menuDefinition: SectionsWithPages;
themeScheme: AppThemeScheme;
title?: string;
}
export type CommonProps = { commonProps: CommonViewProps };