Closed
Description
Hi,
thank you for your work.
Describe the bug
Cannot pass a restana Service
object to the gateway in Typescript.
To Reproduce
import gateway from "fast-gateway";
import restana from "restana";
const server = gateway({
server: restana(),
routes: []
});
gives :
error TS2740: Type 'Service<Protocol.HTTP>' is missing the following properties from type 'Server': listen, address, getConnections, ref, and 25 more.
Expected behavior
It should compile.
Solution
in index.d.ts
change line 50 :
server?: restana.Server<P>;
to
server?: restana.Service<P>;
This is coherent with line 18 of index.js
:
const server = opts.server || restana(opts.restana)
and it works properly (for me).
Metadata
Metadata
Assignees
Labels
No labels