import type { Logger } from '../../Logger'; import { type RawSearchParams } from '../../types'; import { type ISearchParamsParser } from '../types'; type JSONParsedSearchParamsPrimitive = string | boolean | number | null | undefined; export type JSONParsedSearchParamsAllowedValue = JSONParsedSearchParamsPrimitive | Record | Array>; export type JSONParsedSearchParams = Record; /** * Использует для парсинга и сериализации JSON.stringify и JSON.parse * @example * ```ts * const parser = new JSONSearchParamsParser(); * * const searchParams = parser.serialize({ * string: 'test', * number: 123, * boolean: true, * array: [1, 2, 3], * object: { a: 1, b: 2, c: 3 }, * }); * * const parsed = parser.parse(searchParams); * // { string: 'test', number: 123, boolean: true, array: [1, 2, 3], object: { a: 1, b: 2, c: 3 } } * ``` */ export declare class JSONSearchParamsParser implements ISearchParamsParser { private readonly _logger; constructor(_logger: Logger); parse(rawSearchParams: RawSearchParams): JSONParsedSearchParams; serialize: (searchParams: JSONParsedSearchParams) => RawSearchParams; } export {};