From 1f27ec322f94371b487972f7d2ccae89af7ab6e8 Mon Sep 17 00:00:00 2001 From: Nigro Simone Date: Wed, 7 Oct 2026 18:15:15 +0200 Subject: [PATCH] fix(types): express() is an express Application again, callable, with the uWS listen overloads --- src/types.d.ts | 2 +- tests/types/index.test-d.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/types.d.ts b/src/types.d.ts index 7616e990..7008aa46 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -49,7 +49,7 @@ declare module "ultimate-express" { uwsApp: uWS.TemplatedApp; }; - type UltimateExpress = Omit & { + type UltimateExpress = e.Express & { readonly uwsApp: uWS.TemplatedApp; listen(port: number, callback?: (token: any) => void): UltimateExpressListen; listen(port: number, host: string, callback?: (token: any) => void): UltimateExpressListen; diff --git a/tests/types/index.test-d.ts b/tests/types/index.test-d.ts index fbfd2053..f487ac46 100644 --- a/tests/types/index.test-d.ts +++ b/tests/types/index.test-d.ts @@ -2,12 +2,16 @@ import { expectType, expectAssignable } from 'tsd'; import express from 'ultimate-express'; import type { Request, Response, NextFunction, - IRouter, RequestHandler, ErrorRequestHandler + IRouter, RequestHandler, ErrorRequestHandler, Application } from 'express'; -import type { Server } from 'http'; +import type { Server, RequestListener } from 'http'; const app = express(); +expectAssignable(app); +expectAssignable(app); +expectAssignable(app.listen(3000, (token: any) => {}).uwsApp); + // Common properties expectAssignable(app.mountpath); expectAssignable>(app.locals);