-
Notifications
You must be signed in to change notification settings - Fork 30.6k
connect: Add NextFunction for next, fix err parameter
#24883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| // Type definitions for connect v3.4.0 | ||
| // Project: https://github.com/senchalabs/connect | ||
| // Definitions by: Maxime LUCE <https://github.com/SomaticIT> | ||
| // Evan Hahn <https://github.com/EvanHahn> | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
|
||
| /// <reference types="node" /> | ||
|
|
@@ -17,9 +18,11 @@ declare function createServer(): createServer.Server; | |
| declare namespace createServer { | ||
| export type ServerHandle = HandleFunction | http.Server; | ||
|
|
||
| type NextFunction = (err?: any) => void; | ||
|
|
||
| export type SimpleHandleFunction = (req: http.IncomingMessage, res: http.ServerResponse) => void; | ||
| export type NextHandleFunction = (req: http.IncomingMessage, res: http.ServerResponse, next: Function) => void; | ||
| export type ErrorHandleFunction = (err: Error, req: http.IncomingMessage, res: http.ServerResponse, next: Function) => void; | ||
| export type NextHandleFunction = (req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; | ||
| export type ErrorHandleFunction = (err: any, req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => void; | ||
| export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @EvanHahn I think that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That looks right to me. Would you be able to make a pull request? I don't think I'll have time, but could review it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've never done pull requests before... But I'll try to do it later.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feel free to email me at me@evanhahn.com if I can help! |
||
|
|
||
| export interface ServerStackItem { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't error
null | Error?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these are valid in Connect: