Skip to content

Commit

Permalink
Added abstract methods to stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC committed Feb 27, 2024
1 parent 4a60303 commit f34ccea
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/amulet_nbt/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from typing import (
Mapping,
Optional,
)
from collections.abc import MutableSequence, MutableMapping, Sequence
from collections.abc import MutableSequence, MutableMapping
import numpy
from numpy.typing import NDArray, ArrayLike

Expand Down Expand Up @@ -389,6 +389,30 @@ class ListTag(AbstractBaseMutableTag, MutableSequence[AnyNBTT]):
def get_int_array(self, index: int) -> IntArrayTag: ...
def get_long_array(self, index: int) -> LongArrayTag: ...

def insert(self, index: int, value: AnyNBT) -> None:
pass

@overload
def __getitem__(self, index: int) -> AnyNBT: ...

@overload
def __getitem__(self, index: slice) -> list[AnyNBT]: ...

@overload
def __setitem__(self, index: int, value: AnyNBT) -> None: ...

@overload
def __setitem__(self, index: slice, value: Iterable[AnyNBT]) -> None: ...

@overload
def __delitem__(self, index: int) -> None: ...

@overload
def __delitem__(self, index: slice) -> None: ...

def __len__(self) -> int:
pass

_TagT = TypeVar("_TagT", bound=AbstractBaseTag)

class CompoundTag(AbstractBaseMutableTag, MutableMapping[str | bytes, AnyNBT]):
Expand Down Expand Up @@ -536,6 +560,16 @@ class CompoundTag(AbstractBaseMutableTag, MutableMapping[str | bytes, AnyNBT]):
self, key: str | bytes, default: LongArrayTag | None = None
) -> LongArrayTag: ...

def __setitem__(self, key: str | bytes, value: AnyNBT) -> None:...

def __delitem__(self, key: str | bytes) -> None:...

def __getitem__(self, key: str | bytes) -> AnyNBT:...

def __len__(self) -> int:...

def __iter__(self) -> Iterator[str | bytes]:...

class AbstractBaseArrayTag(AbstractBaseMutableTag):
def __init__(self, value: Iterable[SupportsInt] = ()) -> None: ...
@property
Expand Down

0 comments on commit f34ccea

Please sign in to comment.