Skip to content

Commit a5034da

Browse files
committed
Merge branch 'keqingrong-type'
2 parents 606a612 + 9c67996 commit a5034da

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

index.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
declare namespace jsonp {
2+
interface Options {
3+
/** length limit for callback function name, default to `512` */
4+
limit?: number;
5+
/** replacer in `JSON.stringify(obj, [replacer, [space]])` */
6+
replacer?: Parameters<typeof JSON.stringify>[1];
7+
/** space in `JSON.stringify(obj, [replacer, [space]])` */
8+
space?: Parameters<typeof JSON.stringify>[2];
9+
}
10+
}
11+
12+
declare function jsonp(
13+
obj: any,
14+
callback?: string | string[],
15+
options?: jsonp.Options
16+
): string;
17+
18+
export = jsonp;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "Helper to create more safe jsonp response body for koa and other web framework.",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "mocha test/*.test.js",
89
"test-cov": "istanbul cover _mocha -- test/*.test.js"

0 commit comments

Comments
 (0)