The SPDY protocol is supported by major browsers and I think we really should start supporting it.
There is a implementation for node.js: node-spdy. It would be awesome to have TS definitions!
https://github.com/indutny/node-spdy
I think this can be closed, we have this:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/spdy/index.d.ts
Btw, the definitions are behind the library.
spdy: 3.4.4
@types/spdy 3.4.1
when you instantiate server like this ("spdy": "^3.4.4" , "@types/spdy": "^3.4.1")
const app = express();
spdy.createServer(opts, app);
then tsc gives this semantic error:
error TS2345: Argument of type 'Express' is not assignable to parameter of type '(request: IncomingMessage, response: ServerResponse) => void'.
Types of parameters 'res' and 'response' are incompatible.
Type 'ServerResponse' is not assignable to type 'Response'.
Property 'status' is missing in type 'ServerResponse'.
index.d.ts contains only the following mappings:
export function createServer(base: any,
options: ServerOptions,
handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
export function createServer(options: ServerOptions,
handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
export function createServer(handler: (request: IncomingMessage, response: ServerResponse) => void): Server;
Receiving exactly the same error, was there any recommendation or progress on how to resolve this issue?
@tony19 / @n0mer were you guys able to figure out why we are getting the following issue
error TS2345: Argument of type 'Express' is not assignable to parameter of type '(request: IncomingMessage, response: ServerResponse) => void'.
Types of parameters 'res' and 'response' are incompatible.
Type 'ServerResponse' is not assignable to type 'Response'.
Property 'status' is missing in type 'ServerResponse'.
when we do
const app = express();
spdy.createServer(opts, app);
will we have to change the index.d.ts file to have a new mapping or do you guys have other recommendations
@jcheenatcode spdy declares createServer() with its own extension of http.ServerResponse, which is incompatible with express's extension of http.ServerResponse. The solution seems to be changing spdy's createServer's declaration to use http.ServerResponse, as it's the common base class; and this works in my local tests.