Skip to content

Commit 165fe06

Browse files
fix(types): allow proxyFactory to return null or undefined (#98)
* fix(types): allow proxyFactory to return null or undefined * fix(types): improve formatting of proxyFactory type definition * fix(types): update Type and ProxyFactoryOpts for improved type safety
1 parent ce35aac commit 165fe06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as restana from 'restana'
22

33
declare namespace fastgateway {
4-
type Type = 'http' | 'lambda'
4+
type Type = 'http' | 'lambda' | (string & {})
55

66
type Method =
77
| 'GET'
@@ -20,7 +20,7 @@ declare namespace fastgateway {
2020
}
2121

2222
interface ProxyFactoryOpts {
23-
proxyType: string
23+
proxyType: Type
2424
opts: {}
2525
route: Route
2626
}
@@ -70,7 +70,7 @@ declare namespace fastgateway {
7070

7171
interface Options<P extends restana.Protocol> {
7272
server?: Object | restana.Service<P> | Express.Application
73-
proxyFactory?: (opts: ProxyFactoryOpts) => Function
73+
proxyFactory?: (opts: ProxyFactoryOpts) => Function | null | undefined
7474
restana?: {}
7575
middlewares?: Function[]
7676
pathRegex?: string

0 commit comments

Comments
 (0)