diff --git a/packages/generators/src/app/templates/declarations.tpl.ts b/packages/generators/src/app/templates/declarations.tpl.ts index afdef9060d..70c1da3628 100644 --- a/packages/generators/src/app/templates/declarations.tpl.ts +++ b/packages/generators/src/app/templates/declarations.tpl.ts @@ -13,7 +13,7 @@ ${ : `import { ApplicationConfiguration } from './configuration'` } -export { NextFunction } +export type { NextFunction } // The types for app.get(name) and app.set(name) // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/packages/generators/src/authentication/templates/declarations.tpl.ts b/packages/generators/src/authentication/templates/declarations.tpl.ts index a1681ca7f3..d9911a71f0 100644 --- a/packages/generators/src/authentication/templates/declarations.tpl.ts +++ b/packages/generators/src/authentication/templates/declarations.tpl.ts @@ -28,7 +28,11 @@ export const generate = (ctx: AuthenticationGeneratorContext) => .then( when( (ctx) => ctx.language === 'ts', - inject(importTemplate, before('export { NextFunction }'), toDeclarationFile) + inject( + importTemplate, + before(/export \{ NextFunction \}|export type \{ NextFunction \}/), + toDeclarationFile + ) ) ) .then(when((ctx) => ctx.language === 'ts', inject(paramsTemplate, append(), toDeclarationFile)))