mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
[express-serve-static-core] Fix listen callback type (#35883)
* [express-serve-static-core] Add tests * [express-serve-static-core] listen's callback can take some parameters * [express-serve-static-core] Add a definitions by section
This commit is contained in:
parent
e1e63171f3
commit
34f4572c07
@ -1,3 +1,7 @@
|
||||
import * as express from 'express-serve-static-core';
|
||||
|
||||
// null test file - everything should be tested from express.d.ts and serve-static.d.ts
|
||||
const app: express.Application = {} as any;
|
||||
app.listen(3000);
|
||||
app.listen(3000, (err: any) => {
|
||||
// no-op error callback
|
||||
});
|
||||
|
||||
11
types/express-serve-static-core/index.d.ts
vendored
11
types/express-serve-static-core/index.d.ts
vendored
@ -5,6 +5,7 @@
|
||||
// Kacper Polak <https://github.com/kacepe>
|
||||
// Satana Charuwichitratana <https://github.com/micksatana>
|
||||
// Sami Jaber <https://github.com/samijaber>
|
||||
// aereal <https://github.com/aereal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@ -996,11 +997,11 @@ export interface Application extends EventEmitter, IRouter, Express.Application
|
||||
* http.createServer(app).listen(80);
|
||||
* https.createServer({ ... }, app).listen(443);
|
||||
*/
|
||||
listen(port: number, hostname: string, backlog: number, callback?: () => void): http.Server;
|
||||
listen(port: number, hostname: string, callback?: () => void): http.Server;
|
||||
listen(port: number, callback?: () => void): http.Server;
|
||||
listen(callback?: () => void): http.Server;
|
||||
listen(path: string, callback?: () => void): http.Server;
|
||||
listen(port: number, hostname: string, backlog: number, callback?: (...args: any[]) => void): http.Server;
|
||||
listen(port: number, hostname: string, callback?: (...args: any[]) => void): http.Server;
|
||||
listen(port: number, callback?: (...args: any[]) => void): http.Server;
|
||||
listen(callback?: (...args: any[]) => void): http.Server;
|
||||
listen(path: string, callback?: (...args: any[]) => void): http.Server;
|
||||
listen(handle: any, listeningListener?: () => void): http.Server;
|
||||
|
||||
router: string;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user