mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
A bunch of fixes to express declaration
- Move Express-prefixed interface names into internal module as unprefixed names - The importing code will use express.Response instead of ExpressServerResponse - Internal definitions can just use Response instead of ExpressServerResponse - Response should extend http.Response to be able to type check .end for example
This commit is contained in:
@@ -65,7 +65,7 @@ function authenticate(name, pass, fn) {
|
||||
})
|
||||
}
|
||||
|
||||
function restrict(req: ExpressServerRequest, res: ExpressServerResponse, next?: Function) {
|
||||
function restrict(req: express.Request, res: express.Response, next?: Function) {
|
||||
if (req.session.user) {
|
||||
next();
|
||||
} else {
|
||||
@@ -1337,7 +1337,7 @@ function test_general() {
|
||||
}
|
||||
|
||||
function test_request() {
|
||||
var req: ExpressServerRequest;
|
||||
var req: express.Request;
|
||||
req.params.name;
|
||||
req.params[0];
|
||||
req.query.q;
|
||||
@@ -1370,7 +1370,7 @@ function test_request() {
|
||||
}
|
||||
|
||||
function test_response() {
|
||||
var res: ExpressServerResponse;
|
||||
var res: express.Response;
|
||||
res.status(404).sendfile('path/to/404.png');
|
||||
res.set('Content-Type', 'text/plain');
|
||||
res.set({
|
||||
|
||||
Vendored
+1131
-1126
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user