/**
 * Type-safe JSON parsing helpers.
 *
 * `JSON.parse` is typed as `any` in lib.es5.d.ts, which triggers
 * `no-unsafe-*` ESLint rules and destroys downstream inference. These
 * wrappers return `unknown` — callers narrow structurally via type
 * guards, `typeof` checks, or helpers like `asRecord`/`asString`.
 */
/**
 * Parse JSON and return it as `unknown` — the only entry point for untrusted JSON.
 *
 * The optional generic overload `parseJsonUnknown<T>(text)` returns `T` for
 * call sites that know the shape at parse time (e.g. MQTT payloads with a
 * known protocol schema). This is a **type-level bridge only** — no runtime
 * validation is performed. Callers that need runtime validation should parse
 * as `unknown` and narrow via Zod or structural guards.
 */
export declare function parseJsonUnknown<T = unknown>(text: string): T;
/** Narrow an unknown value to a plain `Record<string, unknown>` or return null. */
export declare function asJsonObject(value: unknown): Record<string, unknown> | null;
/** Narrow an unknown value to a `readonly unknown[]` or return an empty array. */
export declare function asJsonArray(value: unknown): readonly unknown[];
/** Safe string extraction from an unknown record field. */
export declare function asString(value: unknown, fallback?: string): string;
/** Safe number extraction from an unknown record field. */
export declare function asNumber(value: unknown, fallback?: number): number;
/** Safe boolean extraction from an unknown record field. */
export declare function asBoolean(value: unknown, fallback?: boolean): boolean;
/** Parse JSON + narrow to object in one step. */
export declare function parseJsonObject(text: string): Record<string, unknown> | null;
/** Parse JSON + narrow to array in one step. */
export declare function parseJsonArray(text: string): readonly unknown[] | null;
//# sourceMappingURL=json-safe.d.ts.map