@types/query-string-params
TypeScript icon, indicating that this package has built-in type declarations

1.7.2 • Public • Published

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 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Rachita.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/query-string-params

Weekly Downloads

7

Version

1.7.2

License

MIT

Unpacked Size

4.21 kB

Total Files

5

Last publish

Collaborators

  • types