import { LazyError } from "../error"; export interface JsonOptions { space: number; tag_index: string; tag_value: string; } type JsonParser = (input: unknown) => T | null; export declare class LazyJson { private space; private tag_index; private tag_value; constructor(options?: Partial); /** * Converts a value into a JSON string. * Handles special types like Map, Set, Date, and undefined values. * * @param input The JavaScript value to stringify * @param spaceOverride Optional number of spaces to use for indentation * @returns A tuple containing either [stringified value, null] if successful, or [null, error] if stringifying fails * * @example * ```ts * // json instance is reusable, therefore is preferred to be created once and reused * const json = new LazyJson(); * * const [output, error] = json.stringify({ key: "value" }); * if (error) { * console.error(error.message); * } * else { * console.log(output); * } * ``` */ stringify(input: unknown, spaceOverride?: number): [string, null] | [null, LazyError]; /** * Parses a JSON string into a JavaScript value. * Handles special types like Map, Set, Date, and undefined values. * * @param input The JSON string to parse * @param schema Optional parser function to validate or transform the parsed value * @returns A tuple containing either [parsed value, null] if successful, or [null, error] if parsing fails * * @example * ```ts * // json instance is reusable, therefore is preferred to be created once and reused * const json = new LazyJson(); * * const [output, error] = json.parse('{"key":"value"}'); * if (error) { * console.error(error.message); * } * else { * console.log(output); * } */ parse>(input: unknown, schema?: T): [ReturnType, null] | [null, LazyError]; } export {};