import { JsonValue, LoadedJsonFile, ResolvedSafeJsonLoaderOptions, SafeJsonLoaderOptions, JsonLoadInput, LoggerContract } from "./types.js"; export declare function mergeOptions(opts?: SafeJsonLoaderOptions): ResolvedSafeJsonLoaderOptions; export declare function log(options: ResolvedSafeJsonLoaderOptions, level: keyof LoggerContract, message: string, meta?: unknown): void; import { SafeJsonError } from "./safeJsonError.js"; export declare class JsonLoaderError extends SafeJsonError { constructor(message: string, code: string, statusCode?: number); } /** * Deeply clones and strips dangerous keys to mitigate prototype pollution. * Uses Object.create(null) to avoid inheriting from Object.prototype. */ export declare function sanitizePrototypePollution(input: T, options?: { maxDepth?: number; }): T; /** * Load one or more JSON resources from: * - Local file (.json) * - Local directory (all .json files) * - Remote URL returning JSON (object/array) * - Remote URL acting as an index of JSON URLs (array or { files: [] }) * * Security features: * - Prototype‑pollution‑safe deep clone (strips __proto__, constructor, prototype) * - Max depth for parsed JSON structures * - Max file size and total directory size * - Concurrency limit for I/O (local and remote) * - HTTP timeout and content‑type checks * * This function does not enforce any domain/schema validation — callers * should layer their own validation on top of the loaded `data`. */ export declare function loadSafeJsonResources(input: JsonLoadInput, options?: SafeJsonLoaderOptions): Promise; /** * Safely parse and sanitize a JSON string. * * - Parses JSON with error handling * - Strips prototype pollution keys (__proto__, constructor, prototype) * - Enforces max depth * * @param input Raw JSON string * @param opts Loader options (maxJsonDepth, etc.) * @returns Safe, sanitized JSON object */ export declare function parseSafeJsonString(input: string, opts?: Pick): JsonValue; /** * Sanitize an already-parsed JSON object. * * - Strips prototype pollution keys (__proto__, constructor, prototype) * - Enforces max depth * * @param input Parsed JSON object (e.g. req.body in Express) * @param opts Loader options (maxJsonDepth, etc.) * @returns Safe, sanitized JSON object */ export declare function sanitizeParsedJsonObject(input: JsonValue, opts?: Pick): JsonValue;