import fastify from "fastify";
import type { AppThemeScheme, SectionsWithPages } from "../../app/types";
declare module "fastify" {
interface FastifyRequest {
cookies: {
theme_scheme: AppThemeScheme;
};
sectionsWithPages: SectionsWithPages;
namedViewsPathMap: Record<string, string>;
pathNamedViewsMap: Record<string, string>;
}
interface FastifyReply {
makeRequestHandler: (
request: FastifyRequest,
reply: FastifyReply
) => <T extends Record<string, any>>(
viewName: string,
props: T & CommonViewProps,
viewCtx?: ViewContext
) => Promise<
FastifyReply<
Server,
IncomingMessage,
ServerResponse,
RouteGenericInterface,
unknown
>
>;
}
}