Installation
npm install --save @types/query-string-params
Summary
This package contains type definitions for query-string-params (https://github.com/bansalrachita/query-string-params#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/query-string-params.
/**
* Transforms complex object in a URL search string.
* For e.g. {orgType: ["a", "b", "c"], orgId: ["x ", "y"]} -> "orgType=a,b,c&orgId=x,y"
*/
export function propertyToUrl(obj: SearchParamOptions): string;
/**
* Transforms a URL search string to an object.
* For e.g. "?foo=xyz&bar=abc" -> {{foo: [xyz]}, {bar: [abc]}}
*/
export function urlToProperty(url: string): SearchParamOptions;
/**
* Transforms a URL search string to an object.
* For e.g. "?foo=xyz&bar=abc" -> [{foo: [xyz]}, {bar: [abc]}]
*/
export function urlToList(url: string): SearchParamOptions[];
/**
* Search params options.
* Can be in the form of key value pair where
* the key is a string and value is an array of strings.
*/
export interface SearchParamOptions {
[name: string]: string[];
}
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: none
Credits
These definitions were written by Rachita.