UNPKG

1.05 kBTypeScriptView Raw
1declare module 'querystring' {
2 interface StringifyOptions {
3 encodeURIComponent?: (str: string) => string;
4 }
5
6 interface ParseOptions {
7 maxKeys?: number;
8 decodeURIComponent?: (str: string) => string;
9 }
10
11 interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
12
13 interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {
14 }
15
16 function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
17 function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
18 /**
19 * The querystring.encode() function is an alias for querystring.stringify().
20 */
21 const encode: typeof stringify;
22 /**
23 * The querystring.decode() function is an alias for querystring.parse().
24 */
25 const decode: typeof parse;
26 function escape(str: string): string;
27 function unescape(str: string): string;
28}