/** * Attempts to parse a JSON string or find the last valid JSON object/array within a string. * First tries to parse the entire string as JSON. If that fails, it searches for the last * valid JSON object or array in the string by tracking opening and closing braces/brackets. * * @param str - The input string that may contain JSON * @returns {object | number | string | undefined} The parsed JSON object/array, or undefined if no valid JSON is found * * @example // Returns parsed JSON if entire string is valid JSON * safelyParseLastJsonFromString('"value"') // returns "value" * * @example // Returns last valid JSON object in string with other content * safelyParseLastJsonFromString('some text {"key": "value"}') // returns {key: "value"} * * @example // Returns undefined if no valid JSON is found * safelyParseLastJsonFromString('invalid json') // returns undefined */ export declare function safelyParseLastJsonFromString(str: string): object | number | string | undefined; //# sourceMappingURL=safelyParseJsonFromString.d.ts.map