Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 41a3ee1

Browse files
Updated typings, use a tsd.json.
1 parent c972fee commit 41a3ee1

File tree

6 files changed

+210
-23
lines changed

6 files changed

+210
-23
lines changed

imageboard/tsd.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": "v4",
3+
"repo": "borisyankov/DefinitelyTyped",
4+
"ref": "master",
5+
"path": "typings",
6+
"bundle": "typings/tsd.d.ts",
7+
"installed": {
8+
"mime/mime.d.ts": {
9+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
10+
},
11+
"serve-static/serve-static.d.ts": {
12+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
13+
},
14+
"express/express.d.ts": {
15+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
16+
},
17+
"mongodb/mongodb.d.ts": {
18+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
19+
},
20+
"node/node.d.ts": {
21+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
22+
},
23+
"method-override/method-override.d.ts": {
24+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
25+
},
26+
"errorhandler/errorhandler.d.ts": {
27+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
28+
},
29+
"body-parser/body-parser.d.ts": {
30+
"commit": "c560ba6f0f55ce6f50e9d06e37b5bc0e2b9117b0"
31+
}
32+
}
33+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// Type definitions for body-parser
2+
// Project: http://expressjs.com
3+
// Definitions by: Santi Albo <https://github.com/santialbo/>, VILIC VANE <https://vilic.info>, Jonathan Häberle <https://github.com/dreampulse/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../express/express.d.ts" />
7+
8+
declare module "body-parser" {
9+
import * as express from "express";
10+
11+
/**
12+
* bodyParser: use individual json/urlencoded middlewares
13+
* @deprecated
14+
*/
15+
16+
function bodyParser(options?: {
17+
/**
18+
* if deflated bodies will be inflated. (default: true)
19+
*/
20+
inflate?: boolean;
21+
/**
22+
* maximum request body size. (default: '100kb')
23+
*/
24+
limit?: any;
25+
/**
26+
* function to verify body content, the parsing can be aborted by throwing an error.
27+
*/
28+
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
29+
/**
30+
* only parse objects and arrays. (default: true)
31+
*/
32+
strict?: boolean;
33+
/**
34+
* passed to JSON.parse().
35+
*/
36+
receiver?: (key: string, value: any) => any;
37+
/**
38+
* parse extended syntax with the qs module. (default: true)
39+
*/
40+
extended?: boolean;
41+
}): express.RequestHandler;
42+
43+
module bodyParser {
44+
export function json(options?: {
45+
/**
46+
* if deflated bodies will be inflated. (default: true)
47+
*/
48+
inflate?: boolean;
49+
/**
50+
* maximum request body size. (default: '100kb')
51+
*/
52+
limit?: any;
53+
/**
54+
* request content-type to parse, passed directly to the type-is library. (default: 'json')
55+
*/
56+
type?: any;
57+
/**
58+
* function to verify body content, the parsing can be aborted by throwing an error.
59+
*/
60+
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
61+
/**
62+
* only parse objects and arrays. (default: true)
63+
*/
64+
strict?: boolean;
65+
/**
66+
* passed to JSON.parse().
67+
*/
68+
receiver?: (key: string, value: any) => any;
69+
}): express.RequestHandler;
70+
71+
export function raw(options?: {
72+
/**
73+
* if deflated bodies will be inflated. (default: true)
74+
*/
75+
inflate?: boolean;
76+
/**
77+
* maximum request body size. (default: '100kb')
78+
*/
79+
limit?: any;
80+
/**
81+
* request content-type to parse, passed directly to the type-is library. (default: 'application/octet-stream')
82+
*/
83+
type?: any;
84+
/**
85+
* function to verify body content, the parsing can be aborted by throwing an error.
86+
*/
87+
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
88+
}): express.RequestHandler;
89+
90+
export function text(options?: {
91+
/**
92+
* if deflated bodies will be inflated. (default: true)
93+
*/
94+
inflate?: boolean;
95+
/**
96+
* maximum request body size. (default: '100kb')
97+
*/
98+
limit?: any;
99+
/**
100+
* request content-type to parse, passed directly to the type-is library. (default: 'text/plain')
101+
*/
102+
type?: any;
103+
/**
104+
* function to verify body content, the parsing can be aborted by throwing an error.
105+
*/
106+
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
107+
/**
108+
* the default charset to parse as, if not specified in content-type. (default: 'utf-8')
109+
*/
110+
defaultCharset?: string;
111+
}): express.RequestHandler;
112+
113+
export function urlencoded(options?: {
114+
/**
115+
* if deflated bodies will be inflated. (default: true)
116+
*/
117+
inflate?: boolean;
118+
/**
119+
* maximum request body size. (default: '100kb')
120+
*/
121+
limit?: any;
122+
/**
123+
* request content-type to parse, passed directly to the type-is library. (default: 'urlencoded')
124+
*/
125+
type?: any;
126+
/**
127+
* function to verify body content, the parsing can be aborted by throwing an error.
128+
*/
129+
verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void;
130+
/**
131+
* parse extended syntax with the qs module. (default: true)
132+
*/
133+
extended?: boolean;
134+
}): express.RequestHandler;
135+
}
136+
137+
export = bodyParser;
138+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Type definitions for errorhandler
2+
// Project: https://github.com/expressjs/errorhandler
3+
// Definitions by: Santi Albo <https://github.com/santialbo/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../express/express.d.ts" />
7+
8+
declare module "errorhandler" {
9+
import express = require('express');
10+
function e(options?: {log?: any}): express.ErrorRequestHandler;
11+
export = e;
12+
}

imageboard/typings/express/express-middleware.d.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Type definitions for method-override
2+
// Project: https://github.com/expressjs/method-override
3+
// Definitions by: Santi Albo <https://github.com/santialbo/>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../express/express.d.ts" />
7+
8+
declare module Express {
9+
export interface Request {
10+
originalMethod?: string;
11+
}
12+
}
13+
14+
declare module "method-override" {
15+
import express = require('express');
16+
module e {
17+
interface MethodOverrideOptions {
18+
methods: string[];
19+
}
20+
}
21+
function e(getter: string, options?: any): express.RequestHandler;
22+
function e(getter: (req: express.Request, res: express.Response) => string, options?: any): express.RequestHandler;
23+
export = e;
24+
}

imageboard/typings/tsd.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
/// <reference path="mongodb/mongodb.d.ts" />
44
/// <reference path="node/node.d.ts" />
55
/// <reference path="serve-static/serve-static.d.ts" />
6+
/// <reference path="body-parser/body-parser.d.ts" />
7+
/// <reference path="errorhandler/errorhandler.d.ts" />
8+
/// <reference path="method-override/method-override.d.ts" />

0 commit comments

Comments
 (0)