/** * Compare if two values are the same by converting them to JSON strings * @example: * React.memo(func, isEqualJSON) * * @param {any} oldVal - to compare * @param {any} newVal - to compare * @returns {Boolean} true - if JSON string of given values are the same */ export function isEqualJSON(oldVal: any, newVal: any): boolean; /** * Converts given value to a JSON string if necessary * * @param {any} data - to convert * @param {any} args - additional options * @return {string} */ export function toJSON(data: any, ...args: any): string; /** * Attempts to parse a JSON string. * * @param {string} data - the string to be parsed * @return {Object|Null} - a JavaScript object if parsed successfully, null if not */ export function fromJSON(data: string): Object | null; /** * Checks to see if the data passed is valid JSON. * * @param {string} data - the json to parse. * @return {boolean} */ export function isJSON(data: string): boolean; /** * Converts any Javascript value to literal string for use as source code. * @example: * toText({a: 8}) * >>> '{a: 8}' * * @param {*} value - to convert to text * @return {string} */ export function toText(value: any): string; export { CircularJSON }; export namespace Json { export { toJSON as encode }; export { fromJSON as decode }; }