added missing definitions

This commit is contained in:
Tim Riddermann 2023-07-18 17:26:03 +02:00
parent 7f08ab2f28
commit f75029247f
5 changed files with 20 additions and 3 deletions

View file

@ -3,6 +3,10 @@ from construct.debug import *
from construct.expr import *
from construct.lib import *
from construct.version import *
from construct import lib
__author__: str
__version__: str
#===============================================================================
# exposed names

View file

@ -207,7 +207,16 @@ class Tunnel(
def _decode(self, data: bytes, context: Context, path: PathType) -> bytes: ...
def _encode(self, data: bytes, context: Context, path: PathType) -> bytes: ...
# TODO: Compiled
class Compiled(Construct[t.Any, t.Any]):
source: t.Optional[str]
defersubcon: t.Optional[Construct[t.Any, t.Any]]
parsefunc: t.Callable[[StreamType, Context], t.Any]
buildfunc: t.Callable[[t.Any, StreamType, Context], t.Any]
def __init__(
self,
parsefunc: t.Callable[[StreamType, Context], t.Any],
buildfunc: t.Callable[[t.Any, StreamType, Context], t.Any],
) -> None: ...
# ===============================================================================
# bytes and bits
@ -356,6 +365,8 @@ ZigZag: Construct[int, int]
# ===============================================================================
# strings
# ===============================================================================
possiblestringencodings: t.Dict[str, int]
class StringEncoded(Construct[str, str]):
if sys.version_info >= (3, 8):
ENCODING_1 = t.Literal["ascii", "utf8", "utf_8", "u8"]

View file

@ -1,4 +1,3 @@
import operator
import typing as t
from construct.core import *

View file

@ -1,6 +1,5 @@
import typing as t
class HexDisplayedInteger(int): ...
class HexDisplayedBytes(bytes): ...
@ -10,3 +9,6 @@ V = t.TypeVar("V")
class HexDisplayedDict(t.Dict[K, V]): ...
class HexDumpDisplayedBytes(bytes): ...
class HexDumpDisplayedDict(t.Dict[K, V]): ...
def hexdump(data: bytes, linesize: int) -> str: ...
def hexundump(data: str, linesize: int) -> bytes: ...

View file

@ -1,5 +1,6 @@
import typing as t
PY: t.Tuple[int, int]
PY2: bool
PY3: bool
PYPY: bool