codekingpro/portable-devtools
115k
1# SPDX-License-Identifier: (Apache-2.0 OR MIT)
2# Copyright ijl (2019-2026), Eric Jolibois (2022), Anders Kaseorg (2020)
3
4import json
5from collections.abc import Callable
6from typing import Any
7
8__version__: str
9
10def dumps(
11 __obj: Any,
12 default: Callable[[Any], Any] | None = ...,
13 option: int | None = ...,
14) -> bytes: ...
15def loads(__obj: bytes | bytearray | memoryview | str) -> Any: ...
16
17class JSONDecodeError(json.JSONDecodeError): ...
18class JSONEncodeError(TypeError): ...
19
20class Fragment(tuple):
21 contents: bytes | str
22
23OPT_APPEND_NEWLINE: int
24OPT_INDENT_2: int
25OPT_NAIVE_UTC: int
26OPT_NON_STR_KEYS: int
27OPT_OMIT_MICROSECONDS: int
28OPT_PASSTHROUGH_DATACLASS: int
29OPT_PASSTHROUGH_DATETIME: int
30OPT_PASSTHROUGH_SUBCLASS: int
31OPT_SERIALIZE_DATACLASS: int
32OPT_SERIALIZE_NUMPY: int
33OPT_SERIALIZE_UUID: int
34OPT_SORT_KEYS: int
35OPT_STRICT_INTEGER: int
36OPT_UTC_Z: int
37 