From 14041a319cace03cfc23c0a919ed81fb141f88ce Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Fri, 25 Apr 2025 21:43:39 -0700 Subject: Refactor to have email service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move hbsInstance back to app * Add email and hbs to req so typescript 🎉🎉🎉 * Init Email and config once --- src/index.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/index.d.ts') diff --git a/src/index.d.ts b/src/index.d.ts index 292e5d3..4811f7f 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,14 +1,17 @@ import "express"; -import { GathioConfig } from "./lib/config.js"; +import { GathioConfig } from "./lib/config.ts"; +import { EmailService } from "./lib/email.ts"; +import { ExpressHandlebars } from "express-handlebars"; interface Locals { config: GathioConfig; } -declare module "express" { - export interface Response { - locals: { - config?: GathioConfig; - }; +declare global { + namespace Express { + interface Request extends Express.Request { + hbsInstance: ExpressHandlebars; + emailService: EmailService; + } } -} +} \ No newline at end of file -- cgit v1.2.3