from typing import Any, List, Mapping, Tuple

from bson.codec_options import CodecOptions

class DatetimeRepresentation:
    LEGACY: int = ...
    NUMBERLONG: int = ...
    ISO8601: int = ...

class JSONMode:
    LEGACY: int = ...
    RELAXED: int = ...
    CANONICAL: int = ...

class JSONOptions(CodecOptions):
    json_mode: int = ...
    strict_number_long: bool = ...
    datetime_representation: int = ...
    strict_uuid: bool = ...
    def __new__(
        cls,
        strict_number_long: bool = ...,
        datetime_representation: int = ...,
        strict_uuid: bool = ...,
        json_mode: int = ...,
        *args: Any,
        **kwargs: Any,
    ) -> JSONOptions: ...
    def with_options(self, **kwargs: Any) -> JSONOptions: ...

LEGACY_JSON_OPTIONS: JSONOptions
DEFAULT_JSON_OPTIONS: JSONOptions
CANONICAL_JSON_OPTIONS: JSONOptions
RELAXED_JSON_OPTIONS: JSONOptions
STRICT_JSON_OPTIONS: JSONOptions

def dumps(obj: Any, *args: Any, json_options: JSONOptions = ..., **kwargs: Any) -> str: ...
def loads(s: str, *args: Any, json_options: JSONOptions = ..., **kwargs: Any) -> Any: ...
def object_pairs_hook(pairs: List[Tuple[str, Any]], json_options: JSONOptions = ...) -> Any: ...
def object_hook(dct: Mapping[str, Any], json_options: JSONOptions = ...) -> Any: ...
def default(obj: Any, json_options: JSONOptions = ...) -> Any: ...
