@types/qs

  • Version 6.9.17
  • Published
  • 7.46 kB
  • No dependencies
  • MIT license

Install

npm i @types/qs
yarn add @types/qs
pnpm add @types/qs

Overview

TypeScript definitions for qs

Index

Functions

function parse

parse: {
(
str: string,
options?: IParseOptions<BooleanOptional> & { decoder?: never | undefined }
): ParsedQs;
(
str: string | Record<string, string>,
options?: IParseOptions<BooleanOptional>
): { [key: string]: unknown };
};

    function stringify

    stringify: (obj: any, options?: IStringifyOptions<BooleanOptional>) => string;

      Interfaces

      interface IParseBaseOptions

      interface IParseBaseOptions {}

        property allowEmptyArrays

        allowEmptyArrays?: boolean | undefined;

          property allowPrototypes

          allowPrototypes?: boolean | undefined;

            property allowSparse

            allowSparse?: boolean | undefined;

              property arrayLimit

              arrayLimit?: number | undefined;

                property charset

                charset?: 'utf-8' | 'iso-8859-1' | undefined;

                  property charsetSentinel

                  charsetSentinel?: boolean | undefined;

                    property comma

                    comma?: boolean | undefined;

                      property decoder

                      decoder?:
                      | ((
                      str: string,
                      defaultDecoder: defaultDecoder,
                      charset: string,
                      type: 'key' | 'value'
                      ) => any)
                      | undefined;

                        property delimiter

                        delimiter?: string | RegExp | undefined;

                          property depth

                          depth?: number | false | undefined;

                            property duplicates

                            duplicates?: 'combine' | 'first' | 'last' | undefined;

                              property ignoreQueryPrefix

                              ignoreQueryPrefix?: boolean | undefined;

                                property interpretNumericEntities

                                interpretNumericEntities?: boolean | undefined;

                                  property parameterLimit

                                  parameterLimit?: number | undefined;

                                    property parseArrays

                                    parseArrays?: boolean | undefined;

                                      property plainObjects

                                      plainObjects?: boolean | undefined;

                                        property strictDepth

                                        strictDepth?: boolean | undefined;

                                          property strictNullHandling

                                          strictNullHandling?: boolean | undefined;

                                            interface IStringifyBaseOptions

                                            interface IStringifyBaseOptions {}

                                              property addQueryPrefix

                                              addQueryPrefix?: boolean | undefined;

                                                property allowEmptyArrays

                                                allowEmptyArrays?: boolean | undefined;

                                                  property arrayFormat

                                                  arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma' | undefined;

                                                    property charset

                                                    charset?: 'utf-8' | 'iso-8859-1' | undefined;

                                                      property charsetSentinel

                                                      charsetSentinel?: boolean | undefined;

                                                        property commaRoundTrip

                                                        commaRoundTrip?: boolean | undefined;

                                                          property delimiter

                                                          delimiter?: string | undefined;

                                                            property encode

                                                            encode?: boolean | undefined;

                                                              property encoder

                                                              encoder?:
                                                              | ((
                                                              str: any,
                                                              defaultEncoder: defaultEncoder,
                                                              charset: string,
                                                              type: 'key' | 'value'
                                                              ) => string)
                                                              | undefined;

                                                                property encodeValuesOnly

                                                                encodeValuesOnly?: boolean | undefined;

                                                                  property filter

                                                                  filter?:
                                                                  | Array<string | number>
                                                                  | ((prefix: string, value: any) => any)
                                                                  | undefined;

                                                                    property format

                                                                    format?: 'RFC1738' | 'RFC3986' | undefined;

                                                                      property indices

                                                                      indices?: boolean | undefined;

                                                                        property serializeDate

                                                                        serializeDate?: ((d: Date) => string) | undefined;

                                                                          property skipNulls

                                                                          skipNulls?: boolean | undefined;

                                                                            property sort

                                                                            sort?: ((a: string, b: string) => number) | undefined;

                                                                              property strictNullHandling

                                                                              strictNullHandling?: boolean | undefined;

                                                                                interface ParsedQs

                                                                                interface ParsedQs {}

                                                                                  index signature

                                                                                  [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[];

                                                                                    Type Aliases

                                                                                    type BooleanOptional

                                                                                    type BooleanOptional = boolean | undefined;

                                                                                      type defaultDecoder

                                                                                      type defaultDecoder = (str: string, decoder?: any, charset?: string) => string;

                                                                                        type defaultEncoder

                                                                                        type defaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string;

                                                                                          type IParseDynamicOptions

                                                                                          type IParseDynamicOptions<AllowDots extends BooleanOptional> = AllowDots extends true
                                                                                          ? { allowDots?: AllowDots; decodeDotInKeys?: boolean }
                                                                                          : { allowDots?: boolean; decodeDotInKeys?: false };

                                                                                            type IParseOptions

                                                                                            type IParseOptions<AllowDots extends BooleanOptional = undefined> =
                                                                                            IParseBaseOptions & IParseDynamicOptions<AllowDots>;

                                                                                              type IStringifyDynamicOptions

                                                                                              type IStringifyDynamicOptions<AllowDots extends BooleanOptional> =
                                                                                              AllowDots extends true
                                                                                              ? { allowDots?: AllowDots; encodeDotInKeys?: boolean }
                                                                                              : { allowDots?: boolean; encodeDotInKeys?: false };

                                                                                                type IStringifyOptions

                                                                                                type IStringifyOptions<AllowDots extends BooleanOptional = undefined> =
                                                                                                IStringifyBaseOptions & IStringifyDynamicOptions<AllowDots>;

                                                                                                  Package Files (1)

                                                                                                  Dependencies (0)

                                                                                                  No dependencies.

                                                                                                  Dev Dependencies (0)

                                                                                                  No dev dependencies.

                                                                                                  Peer Dependencies (0)

                                                                                                  No peer dependencies.

                                                                                                  Badge

                                                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/qs.

                                                                                                  • Markdown
                                                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/qs)
                                                                                                  • HTML
                                                                                                    <a href="https://www.jsdocs.io/package/@types/qs"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>