import typing

import java
import java.chaquopy
import java.lang
import java.util

class JSONArray(java.lang.Object):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, array: java.lang.Object | int | bool | float | str, /) -> None: ...
    @typing.overload
    def __init__(self, json: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, copyFrom: java.util.Collection, /) -> None: ...
    @typing.overload
    def __init__(self, readFrom: JSONTokener, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def get(self, index: int | java.jint | java.lang.Integer, /) -> java.lang.Object: ...
    def getBoolean(self, index: int | java.jint | java.lang.Integer, /) -> bool: ...
    def getDouble(self, index: int | java.jint | java.lang.Integer, /) -> float: ...
    def getInt(self, index: int | java.jint | java.lang.Integer, /) -> int: ...
    def getJSONArray(self, index: int | java.jint | java.lang.Integer, /) -> JSONArray: ...
    def getJSONObject(self, index: int | java.jint | java.lang.Integer, /) -> JSONObject: ...
    def getLong(self, index: int | java.jint | java.lang.Integer, /) -> int: ...
    def getString(self, index: int | java.jint | java.lang.Integer, /) -> str: ...
    def hashCode(self) -> int: ...
    def isNull(self, index: int | java.jint | java.lang.Integer, /) -> bool: ...
    def join(self, separator: str | java.lang.String, /) -> str: ...
    def length(self) -> int: ...
    def opt(self, index: int | java.jint | java.lang.Integer, /) -> java.lang.Object: ...
    @typing.overload
    def optBoolean(self, index: int | java.jint | java.lang.Integer, /) -> bool: ...
    @typing.overload
    def optBoolean(self, index: int | java.jint | java.lang.Integer, fallback: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    @typing.overload
    def optDouble(self, index: int | java.jint | java.lang.Integer, /) -> float: ...
    @typing.overload
    def optDouble(self, index: int | java.jint | java.lang.Integer, fallback: float | java.jdouble | java.lang.Double, /) -> float: ...
    @typing.overload
    def optInt(self, index: int | java.jint | java.lang.Integer, /) -> int: ...
    @typing.overload
    def optInt(self, index: int | java.jint | java.lang.Integer, fallback: int | java.jint | java.lang.Integer, /) -> int: ...
    def optJSONArray(self, index: int | java.jint | java.lang.Integer, /) -> JSONArray: ...
    def optJSONObject(self, index: int | java.jint | java.lang.Integer, /) -> JSONObject: ...
    @typing.overload
    def optLong(self, index: int | java.jint | java.lang.Integer, /) -> int: ...
    @typing.overload
    def optLong(self, index: int | java.jint | java.lang.Integer, fallback: int | java.jlong | java.lang.Long, /) -> int: ...
    @typing.overload
    def optString(self, index: int | java.jint | java.lang.Integer, /) -> str: ...
    @typing.overload
    def optString(self, index: int | java.jint | java.lang.Integer, fallback: str | java.lang.String, /) -> str: ...
    @typing.overload
    def put(self, value: float | java.jdouble | java.lang.Double, /) -> JSONArray: ...
    @typing.overload
    def put(self, value: int | java.jint | java.lang.Integer, /) -> JSONArray: ...
    @typing.overload
    def put(self, value: int | java.jlong | java.lang.Long, /) -> JSONArray: ...
    @typing.overload
    def put(self, value: java.lang.Object | int | bool | float | str, /) -> JSONArray: ...
    @typing.overload
    def put(self, value: bool | java.jboolean | java.lang.Boolean, /) -> JSONArray: ...
    @typing.overload
    def put(self, index: int | java.jint | java.lang.Integer, value: float | java.jdouble | java.lang.Double, /) -> JSONArray: ...
    @typing.overload
    def put(self, index: int | java.jint | java.lang.Integer, value: int | java.jint | java.lang.Integer, /) -> JSONArray: ...
    @typing.overload
    def put(self, index: int | java.jint | java.lang.Integer, value: int | java.jlong | java.lang.Long, /) -> JSONArray: ...
    @typing.overload
    def put(self, index: int | java.jint | java.lang.Integer, value: java.lang.Object | int | bool | float | str, /) -> JSONArray: ...
    @typing.overload
    def put(self, index: int | java.jint | java.lang.Integer, value: bool | java.jboolean | java.lang.Boolean, /) -> JSONArray: ...
    def remove(self, index: int | java.jint | java.lang.Integer, /) -> java.lang.Object: ...
    def toJSONObject(self, names: JSONArray, /) -> JSONObject: ...
    @typing.overload
    def toString(self) -> str: ...
    @typing.overload
    def toString(self, indentSpaces: int | java.jint | java.lang.Integer, /) -> str: ...

class JSONException(java.lang.Exception):
    @typing.overload
    def __init__(self, s: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class JSONObject(java.lang.Object):
    NULL: typing.ClassVar[java.lang.Object] = ...
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, json: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, copyFrom: java.util.Map, /) -> None: ...
    @typing.overload
    def __init__(self, readFrom: JSONTokener, /) -> None: ...
    @typing.overload
    def __init__(self, copyFrom: JSONObject, names: java.chaquopy.JavaArray[java.lang.String], /) -> None: ...
    def accumulate(self, name: str | java.lang.String, value: java.lang.Object | int | bool | float | str, /) -> JSONObject: ...
    def append(self, name: str | java.lang.String, value: java.lang.Object | int | bool | float | str, /) -> JSONObject: ...
    def get(self, name: str | java.lang.String, /) -> java.lang.Object: ...
    def getBoolean(self, name: str | java.lang.String, /) -> bool: ...
    def getDouble(self, name: str | java.lang.String, /) -> float: ...
    def getInt(self, name: str | java.lang.String, /) -> int: ...
    def getJSONArray(self, name: str | java.lang.String, /) -> JSONArray: ...
    def getJSONObject(self, name: str | java.lang.String, /) -> JSONObject: ...
    def getLong(self, name: str | java.lang.String, /) -> int: ...
    def getString(self, name: str | java.lang.String, /) -> str: ...
    def has(self, name: str | java.lang.String, /) -> bool: ...
    def isNull(self, name: str | java.lang.String, /) -> bool: ...
    def keys(self) -> java.util.Iterator[java.lang.String]: ...
    def length(self) -> int: ...
    def names(self) -> JSONArray: ...
    @staticmethod
    def numberToString(number: java.lang.Number, /) -> str: ...
    def opt(self, name: str | java.lang.String, /) -> java.lang.Object: ...
    @typing.overload
    def optBoolean(self, name: str | java.lang.String, /) -> bool: ...
    @typing.overload
    def optBoolean(self, name: str | java.lang.String, fallback: bool | java.jboolean | java.lang.Boolean, /) -> bool: ...
    @typing.overload
    def optDouble(self, name: str | java.lang.String, /) -> float: ...
    @typing.overload
    def optDouble(self, name: str | java.lang.String, fallback: float | java.jdouble | java.lang.Double, /) -> float: ...
    @typing.overload
    def optInt(self, name: str | java.lang.String, /) -> int: ...
    @typing.overload
    def optInt(self, name: str | java.lang.String, fallback: int | java.jint | java.lang.Integer, /) -> int: ...
    def optJSONArray(self, name: str | java.lang.String, /) -> JSONArray: ...
    def optJSONObject(self, name: str | java.lang.String, /) -> JSONObject: ...
    @typing.overload
    def optLong(self, name: str | java.lang.String, /) -> int: ...
    @typing.overload
    def optLong(self, name: str | java.lang.String, fallback: int | java.jlong | java.lang.Long, /) -> int: ...
    @typing.overload
    def optString(self, name: str | java.lang.String, /) -> str: ...
    @typing.overload
    def optString(self, name: str | java.lang.String, fallback: str | java.lang.String, /) -> str: ...
    @typing.overload
    def put(self, name: str | java.lang.String, value: float | java.jdouble | java.lang.Double, /) -> JSONObject: ...
    @typing.overload
    def put(self, name: str | java.lang.String, value: int | java.jint | java.lang.Integer, /) -> JSONObject: ...
    @typing.overload
    def put(self, name: str | java.lang.String, value: int | java.jlong | java.lang.Long, /) -> JSONObject: ...
    @typing.overload
    def put(self, name: str | java.lang.String, value: java.lang.Object | int | bool | float | str, /) -> JSONObject: ...
    @typing.overload
    def put(self, name: str | java.lang.String, value: bool | java.jboolean | java.lang.Boolean, /) -> JSONObject: ...
    def putOpt(self, name: str | java.lang.String, value: java.lang.Object | int | bool | float | str, /) -> JSONObject: ...
    @staticmethod
    def quote(data: str | java.lang.String, /) -> str: ...
    def remove(self, name: str | java.lang.String, /) -> java.lang.Object: ...
    def toJSONArray(self, names: JSONArray, /) -> JSONArray: ...
    @typing.overload
    def toString(self) -> str: ...
    @typing.overload
    def toString(self, indentSpaces: int | java.jint | java.lang.Integer, /) -> str: ...
    @staticmethod
    def wrap(o: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...

class JSONStringer(java.lang.Object):
    def __init__(self) -> None: ...
    def array(self) -> JSONStringer: ...
    def endArray(self) -> JSONStringer: ...
    def endObject(self) -> JSONStringer: ...
    def key(self, name: str | java.lang.String, /) -> JSONStringer: ...
    def object(self) -> JSONStringer: ...
    def toString(self) -> str: ...
    @typing.overload
    def value(self, value: float | java.jdouble | java.lang.Double, /) -> JSONStringer: ...
    @typing.overload
    def value(self, value: int | java.jlong | java.lang.Long, /) -> JSONStringer: ...
    @typing.overload
    def value(self, value: java.lang.Object | int | bool | float | str, /) -> JSONStringer: ...
    @typing.overload
    def value(self, value: bool | java.jboolean | java.lang.Boolean, /) -> JSONStringer: ...

class JSONTokener(java.lang.Object):
    def __init__(self, in_: str | java.lang.String, /) -> None: ...
    def back(self) -> None: ...
    @staticmethod
    def dehexchar(hex: str | java.jchar | java.lang.Character, /) -> int: ...
    def more(self) -> bool: ...
    @typing.overload
    def next(self) -> str: ...
    @typing.overload
    def next(self, c: str | java.jchar | java.lang.Character, /) -> str: ...
    @typing.overload
    def next(self, length: int | java.jint | java.lang.Integer, /) -> str: ...
    def nextClean(self) -> str: ...
    def nextString(self, quote: str | java.jchar | java.lang.Character, /) -> str: ...
    @typing.overload
    def nextTo(self, excluded: str | java.jchar | java.lang.Character, /) -> str: ...
    @typing.overload
    def nextTo(self, excluded: str | java.lang.String, /) -> str: ...
    def nextValue(self) -> java.lang.Object: ...
    def skipPast(self, thru: str | java.lang.String, /) -> None: ...
    def skipTo(self, to: str | java.jchar | java.lang.Character, /) -> str: ...
    def syntaxError(self, message: str | java.lang.String, /) -> JSONException: ...
    def toString(self) -> str: ...
