/* Native, implemented in Java
 * This class allows you to create and manipulate JSON objects.
 * Import with 'import Json from util.Json'
 */
class Json {
    /*
     * This writes the Json to a file
     * Parameter - File (file): the file that you want to write to
     * Throws - Error: There was an error writing the file: ...
     */
    fun writeToFile(file);

    /*
     * This converts the Json back into a Value
     * Returns - Value: the Value parsed from the Json
     */
    fun getValue();

    /*
     * This converts a map into a Json, an important thing to note is that
     * any values that are not Numbers, Booleans, Lists, Maps, or Null will use their
     * toString() member to convert them to a string
     * Parameter - Map (map): the map that you want to parse into a Json
     * Returns - Json: the Json parsed from the map
     */
    static fun fromMap(map);

    /*
     * This converts a list into a Json, an important thing to note is that
     * any values that are not Numbers, Booleans, Lists, Maps, or Null will use their
     * toString() member to convert them to a string
     * Parameter - List (list): the list that you want to parse into a Json
     * Returns - Json: the Json parsed from the list
     */
    static fun fromList(list);

    /*
     * This converts a string into a Json provided it is formatted correctly
     * Parameter - String (string): the string that you want to parse into a Json
     * Returns - Json: the Json parsed from the string
     * Throws - Error: Json could not be parsed
     */
    static fun fromString(string);
}


