import type { IncomingMessage } from 'node:http';
import { type Encoding, type Options as RawBodyOptions } from 'raw-body';
import { type BodyParserJSONConfig } from '../types.ts';
/**
 * Prepares parser options for JSON body parsing by configuring strict mode
 * and value normalization through a reviver function.
 *
 * @param options - JSON body parser configuration
 */
export declare function prepareJSONParserOptions(options: Partial<BodyParserJSONConfig>): RawBodyOptions & {
    encoding: Encoding;
    strict: boolean;
    reviver?: (this: any, key: string, value: any) => any;
};
/**
 * Parses JSON request body with optional strict mode that enforces only
 * objects and arrays as valid JSON. Returns both parsed and raw representations.
 *
 * @param req - The incoming HTTP request
 * @param options - Parser options including encoding, limits, and strict mode
 *
 * @example
 * ```ts
 * const { parsed, raw } = await parseJSON(request, options)
 * // parsed: { username: 'virk', age: 28 }
 * // raw: '{"username":"virk","age":28}'
 * ```
 */
export declare function parseJSON(req: IncomingMessage, options: ReturnType<typeof prepareJSONParserOptions>): Promise<{
    parsed: any;
    raw: string;
}>;
