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:
Sam Gronblom
2013-09-24 12:00:17 +09:00
parent 060269ee39
commit 55d38312e9
2 changed files with 1134 additions and 1129 deletions
+3 -3
View File
@@ -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({
+1131 -1126
View File
File diff suppressed because it is too large Load Diff