/** Options for the {@link stringify} function */ export interface StringifyOptions { /** Separator the querystring should get */ separator?: string; /** Equals sign the querystring should use */ equals?: string; /** Whether the querystring should be automatically prefixed with a `?` */ includeQuestion?: boolean; /** * Whether to use [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) * on the parameters * * @default true */ encodeUriComponents?: boolean; } /** Options for the {@link parse} function */ export interface ParseOptions { /** Separator the querystring has */ separator?: string; /** Equals sign the querystring has */ equals?: string; } /** * Checks what kind of primitive type the property is and transforms accordingly * * @remarks * Used for stringify * * @param v Input to check for primitive type */ export declare function stringifyPrimitive(v: T, encode: boolean | undefined): string; /** * Stringifies an object * * @param obj Object to stringify * @param options Options for the stringify, see {@link StringifyOptions} * @returns The stringified query object * @example * ```ts * stringify({prop: 'value', prop2: 'value2'}) * ``` * * @example * ```ts * stringify({prop: 'value', prop2: 'value2'}, {separator: '&', equals: '=', includeQuestion: false}) * ``` * * @example * ```ts * stringify({prop: 'value', prop2: 'value2'}, {separator: '&&', equals: '=', includeQuestion: true}) * ``` */ export declare function stringify(obj: I, options?: StringifyOptions): string; /** * Parses a querystring back to an object * * @param qs Querystring to parse * @param options Options for the parse, see {@link IParseOptions} * @returns A JavaScript object of the parsed parameters * @example * ```ts * parse('?prop=value&prop2=value2') * ``` * * @example * ```ts * parse('?prop=value&prop2=value2', {separator: '&', equals: '='}) * ``` * * @example * ```ts * parse('prop=value&&prop2=value2', {separator: '&&', equals: '='}) * ``` */ export declare function parse = Record>(qs?: string, options?: ParseOptions): R; //# sourceMappingURL=index.d.ts.map