mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-09 11:40:07 +00:00
express-serve-static-core: Fix examples for send, json and jsonp (#33801)
This commit is contained in:
11
types/express-serve-static-core/index.d.ts
vendored
11
types/express-serve-static-core/index.d.ts
vendored
@@ -507,8 +507,7 @@ export interface Response extends http.ServerResponse, Express.Response {
|
||||
* res.send(new Buffer('wahoo'));
|
||||
* res.send({ some: 'json' });
|
||||
* res.send('<p>some html</p>');
|
||||
* res.send(404, 'Sorry, cant find that');
|
||||
* res.send(404);
|
||||
* res.status(404).send('Sorry, cant find that');
|
||||
*/
|
||||
send: Send;
|
||||
|
||||
@@ -519,8 +518,8 @@ export interface Response extends http.ServerResponse, Express.Response {
|
||||
*
|
||||
* res.json(null);
|
||||
* res.json({ user: 'tj' });
|
||||
* res.json(500, 'oh noes!');
|
||||
* res.json(404, 'I dont have that');
|
||||
* res.status(500).json('oh noes!');
|
||||
* res.status(404).json('I dont have that');
|
||||
*/
|
||||
json: Send;
|
||||
|
||||
@@ -531,8 +530,8 @@ export interface Response extends http.ServerResponse, Express.Response {
|
||||
*
|
||||
* res.jsonp(null);
|
||||
* res.jsonp({ user: 'tj' });
|
||||
* res.jsonp(500, 'oh noes!');
|
||||
* res.jsonp(404, 'I dont have that');
|
||||
* res.status(500).jsonp('oh noes!');
|
||||
* res.status(404).jsonp('I dont have that');
|
||||
*/
|
||||
jsonp: Send;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user