*.pyi: fix types, add missing attrs

This commit is contained in:
Thomas Waldmann 2023-01-30 02:02:38 +01:00
parent 77977d988a
commit 90a9a124d4
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
3 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
from typing import Any, Type
from typing import Any, Type, Dict, Tuple
API_VERSION: str
@ -12,8 +12,8 @@ class CompressionSpec:
class Compressor:
def __init__(self, name: Any = ..., **kwargs) -> None: ...
def compress(self, data: bytes) -> bytes: ...
def decompress(self, data: bytes) -> bytes: ...
def compress(self, meta: Dict, data: bytes) -> Tuple[Dict, bytes]: ...
def decompress(self, meta: Dict, data: bytes) -> Tuple[Dict, bytes]: ...
@staticmethod
def detect(data: bytes) -> Any: ...

View File

@ -28,9 +28,8 @@ class IndexBase:
class ChunkIndexEntry(NamedTuple):
refcount: int
size: int
csize: int
CIE = Union[Tuple[int, int, int], Type[ChunkIndexEntry]]
CIE = Union[Tuple[int, int], Type[ChunkIndexEntry]]
class ChunkKeyIterator:
def __init__(self, keysize: int) -> None: ...
@ -38,7 +37,7 @@ class ChunkKeyIterator:
def __next__(self) -> Tuple[bytes, Type[ChunkIndexEntry]]: ...
class ChunkIndex(IndexBase):
def add(self, key: bytes, refs: int, size: int, csize: int) -> None: ...
def add(self, key: bytes, refs: int, size: int) -> None: ...
def decref(self, key: bytes) -> CIE: ...
def incref(self, key: bytes) -> CIE: ...
def iteritems(self, marker: bytes = ...) -> Iterator: ...
@ -65,12 +64,14 @@ class NSIndex(IndexBase):
def __contains__(self, key: bytes) -> bool: ...
def __getitem__(self, key: bytes) -> Any: ...
def __setitem__(self, key: bytes, value: Any) -> None: ...
def flags(self, key: bytes, mask: int, value: int = None) -> int: ...
class NSIndex1(IndexBase): # legacy
def iteritems(self, *args, **kwargs) -> Iterator: ...
def __contains__(self, key: bytes) -> bool: ...
def __getitem__(self, key: bytes) -> Any: ...
def __setitem__(self, key: bytes, value: Any) -> None: ...
def flags(self, key: bytes, mask: int, value: int = None) -> int: ...
class FuseVersionsIndex(IndexBase):
def __contains__(self, key: bytes) -> bool: ...

View File

@ -4,7 +4,7 @@ from .helpers import StableDict
API_VERSION: str
def want_bytes(v: Any, *, errors: str) -> bytes: ...
def want_bytes(v: Any, *, errors: str = ...) -> bytes: ...
def chunks_contents_equal(chunks1: Iterator, chunks2: Iterator) -> bool: ...
class PropDict:
@ -106,7 +106,6 @@ class ArchiveItem(PropDict):
class ChunkListEntry(NamedTuple):
id: bytes
size: int
csize: int
class Item(PropDict):
@property
@ -178,6 +177,10 @@ class Item(PropDict):
@deleted.setter
def deleted(self, val: bool) -> None: ...
@property
def hlid(self) -> bytes: ...
@hlid.setter
def hlid(self, val: bytes) -> None: ...
@property
def hardlink_master(self) -> bool: ...
@hardlink_master.setter
def hardlink_master(self, val: bool) -> None: ...