/** * Defines a JSON serializer. * * @since v1.5.5 */ export declare abstract class JsonSerializer { /** * Contains the current character of the json string being deserialized. * * @since v1.5.5 */ private static __char; /** * Contains the index of the current character of the json string being * deserialized. * * @private * * @since v1.5.5 */ private static __charIndex; /** * Contains the escape characters to be replaced during deserialization * of the json string. * * @since v1.5.5 */ private static readonly __escapeesMap; /** * Contains a json deserialization reviver. * * @private * * @since v1.5.5 */ private static __reviver; /** * Contains the json string to be deserialized. * * @private * * @since v1.5.5 */ private static __json; /** * @constructor * * @private * * @since v1.5.5 */ constructor(); /** * Deserializes the specified JSON string. * * **Usage Examples:** * ```typescript * Objects.deserialize("{}"); // {} * Objects.deserialize('{"a":true}'); // {a: true} * Objects.deserialize('{"a":2,"b":"abc"}'); // {a: 2, b: "abc"} * ``` * * @param {String} json Contains a JSON string. * @param {Function} reviver Contains a JSON reviver function used for * transforming the result. * @return {T} the JavaScript object corresponding to the specified JSON. * * @since v1.5.5 */ static deserialize(json: string, reviver?: ((this: any, key: string, value: any) => any)): T; /** * Converts the specified JavaScript value to a JSON string. * * **Usage Examples:** * ```typescript * JsonSerializer.serialize({}); // "{}" * JsonSerializer.serialize({a: true}); // "{"a":true}" * JsonSerializer.serialize({a: 2, b: "abc"}); // "{"a":2,"b":"abc"}" * ``` * * @param {*} value Contains the JavaScript value to be serialized. * @return {String} a JSON string. * * @since v1.5.5 */ static serialize(value: T): string; /** * Deserializes a JSON array. * * @return {Array} a JavaScript array. * * @private * * @since v1.5.5 */ private static __deserializeArray; /** * Gets the deserialized value from the JSON string. * * @private * * @since v1.5.5 */ private static get __deserializedValue(); /** * Deserializes a JSON `true`, `false` or `null` value. * * @return {Boolean} `true`, `false` or `null`. * * @private * * @since v1.5.5 */ private static __deserializeBoolAndNull; /** * Deserializes a JSON number value. * * @return {Number} a JavaScript number value. * * @private * * @since v1.5.5 */ private static __deserializeNumber; /** * Deserializes a JSON object. * * @return {Object} a JavaScript object. * * @private * * @since v1.5.5 */ private static __deserializeObject; /** * Deserializes a JSON string. * * @return {*} either a JavaScript `Date` object if the JSON string * represents a date ISO string or a string. * * @private * * @since v1.5.5 */ private static __deserializeString; /** * Walks recursively through the specified holder object. * * @param {Object} holder Contains the holder object. * @param {String} key Contains an object key. * @return {*} * * @private * * @since v1.5.5 */ private static __iter; /** * Gets the next character of the JSON string. * * @param {String} char Contains the next character. * @return {String} the next character of the JSON string. * * @private * * @since v1.5.5 */ private static __next; /** * Skips the whitespace between non-space characters of the JSON string. */ private static __skipWhitespace; }