Skip to content

Commit 0cafd09

Browse files
committed
Merge pull request DefinitelyTyped#5812 from RWander/qs
Qs
2 parents b21ccc2 + cc925de commit 0cafd09

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

qs/qs-tests.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="./qs.d.ts" />
2+
3+
import qs = require('qs');
4+
5+
qs.stringify({ a: 'b' });
6+
qs.stringify({ a: 'b', c: 'd' }, { delimiter: '&' });
7+
8+
qs.parse('a=b');
9+
qs.parse('a=b&c=d', { delimiter: '&' });

qs/qs.d.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Type definitions for qs
2+
// Project: https://github.com/hapijs/qs
3+
// Definitions by: Roman Korneev <https://github.com/RWander>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
declare module QueryString {
7+
interface IStringifyOptions {
8+
delimiter?: string;
9+
strictNullHandling?: boolean;
10+
skipNulls?: boolean;
11+
encode?: boolean;
12+
filter?: any;
13+
arrayFormat?: any;
14+
indices?: string;
15+
}
16+
17+
interface IParseOptions {
18+
delimiter?: string;
19+
depth?: number;
20+
arrayLimit?: number;
21+
parseArrays?: boolean;
22+
allowDots?: boolean;
23+
plainObjects?: boolean;
24+
allowPrototypes?: boolean;
25+
parameterLimit?: number;
26+
strictNullHandling?: boolean;
27+
}
28+
29+
function stringify(obj: any, options?: IStringifyOptions): string;
30+
function parse(str: string, options?: IParseOptions): any;
31+
}
32+
33+
declare module "qs" {
34+
export = QueryString;
35+
}

0 commit comments

Comments
 (0)