mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
Add missing types for aliases querystring.encode and querystring.decode to v12 & v11 (#35694)
* Added definitions - encode & decode aliases These have existed since @ least v10 and are documented here: https://nodejs.org/api/querystring.html * corrected order of comments for encode & decode * Added definitions for encode & decode aliases These have existed since at least v10 and are documented here: https://nodejs.org/api/querystring.html * corrected 'ParsedUrlQueryInput' & jsdoc comments * Corrected jsdoc alignment * Corrected jsdoc comment * refactored encode and decode aliases with typeof
This commit is contained in:
committed by
Sheetal Nandi
parent
04031dd4ae
commit
32db7fc4ed
Vendored
+11
-3
@@ -12,13 +12,21 @@ declare module "querystring" {
|
||||
|
||||
interface ParsedUrlQueryInput {
|
||||
[key: string]:
|
||||
// The value type here is a "poor man's `unknown`". When these types support TypeScript
|
||||
// 3.0+, we can replace this with `unknown`.
|
||||
{} | null | undefined;
|
||||
// The value type here is a "poor man's `unknown`". When these types support TypeScript
|
||||
// 3.0+, we can replace this with `unknown`.
|
||||
{} | null | undefined;
|
||||
}
|
||||
|
||||
function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
|
||||
function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
|
||||
/**
|
||||
* The querystring.encode() function is an alias for querystring.stringify().
|
||||
*/
|
||||
const encode: typeof stringify;
|
||||
/**
|
||||
* The querystring.decode() function is an alias for querystring.parse().
|
||||
*/
|
||||
const decode: typeof parse;
|
||||
function escape(str: string): string;
|
||||
function unescape(str: string): string;
|
||||
}
|
||||
|
||||
Vendored
+11
-3
@@ -12,13 +12,21 @@ declare module "querystring" {
|
||||
|
||||
interface ParsedUrlQueryInput {
|
||||
[key: string]:
|
||||
// The value type here is a "poor man's `unknown`". When these types support TypeScript
|
||||
// 3.0+, we can replace this with `unknown`.
|
||||
{} | null | undefined;
|
||||
// The value type here is a "poor man's `unknown`". When these types support TypeScript
|
||||
// 3.0+, we can replace this with `unknown`.
|
||||
{} | null | undefined;
|
||||
}
|
||||
|
||||
function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
|
||||
function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
|
||||
/**
|
||||
* The querystring.encode() function is an alias for querystring.stringify().
|
||||
*/
|
||||
const encode: typeof stringify;
|
||||
/**
|
||||
* The querystring.decode() function is an alias for querystring.parse().
|
||||
*/
|
||||
const decode: typeof parse;
|
||||
function escape(str: string): string;
|
||||
function unescape(str: string): string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user