npm.io
1.7.2 • Published 2 years ago

@types/query-string-params

Licence
MIT
Version
1.7.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

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.

index.d.ts

/**
 * 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 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Rachita.