UNPKG

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