From 647ff417903b6d71bfb16596bf44709220570fb9 Mon Sep 17 00:00:00 2001 From: Vincent de Vreede Date: Mon, 12 May 2025 14:23:20 +0200 Subject: [PATCH 1/3] fix(types): allow proxyFactory to return null or undefined --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 8d1da52..f04f54f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -70,7 +70,7 @@ declare namespace fastgateway { interface Options

{ server?: Object | restana.Service

| Express.Application - proxyFactory?: (opts: ProxyFactoryOpts) => Function + proxyFactory?: (opts: ProxyFactoryOpts) => Function|null|undefined restana?: {} middlewares?: Function[] pathRegex?: string From 76d36cccb96e51076d74b9cf76a30d502c2e3826 Mon Sep 17 00:00:00 2001 From: Vincent de Vreede Date: Mon, 12 May 2025 14:30:01 +0200 Subject: [PATCH 2/3] fix(types): improve formatting of proxyFactory type definition --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index f04f54f..f0e5256 100644 --- a/index.d.ts +++ b/index.d.ts @@ -70,7 +70,7 @@ declare namespace fastgateway { interface Options

{ server?: Object | restana.Service

| Express.Application - proxyFactory?: (opts: ProxyFactoryOpts) => Function|null|undefined + proxyFactory?: (opts: ProxyFactoryOpts) => Function | null | undefined restana?: {} middlewares?: Function[] pathRegex?: string From e56ae139362742603e69d14927e232900abe2356 Mon Sep 17 00:00:00 2001 From: Vincent de Vreede Date: Mon, 12 May 2025 14:59:27 +0200 Subject: [PATCH 3/3] fix(types): update Type and ProxyFactoryOpts for improved type safety --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index f0e5256..9cb42dd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,7 +1,7 @@ import * as restana from 'restana' declare namespace fastgateway { - type Type = 'http' | 'lambda' + type Type = 'http' | 'lambda' | (string & {}) type Method = | 'GET' @@ -20,7 +20,7 @@ declare namespace fastgateway { } interface ProxyFactoryOpts { - proxyType: string + proxyType: Type opts: {} route: Route }