from typing import overload


class Struct:
    """Some documentation"""

    @overload
    def __init__(self) -> None: ...

    @overload
    def __init__(self, arg: int, /) -> None: ...

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

    def value_plus(self, arg0: int, arg1: int, arg2: int, arg3: int, arg4: int, arg5: int, arg6: int, /) -> int: ...

    def set_value(self, value: int) -> None: ...

    def self(self) -> Struct: ...

    def none(self) -> Struct: ...

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

    def __setstate__(self, arg: int, /) -> None: ...

    @overload
    @staticmethod
    def static_test(arg: int, /) -> int: ...

    @overload
    @staticmethod
    def static_test(arg: float, /) -> int: ...

    @staticmethod
    def create_move() -> Struct: ...

    @staticmethod
    def create_reference() -> Struct: ...

    @staticmethod
    def create_copy() -> Struct: ...

    @staticmethod
    def create_take() -> Struct: ...

class PairStruct:
    def __init__(self) -> None: ...

    @property
    def s1(self) -> Struct:
        """A documented property"""

    @s1.setter
    def s1(self, arg: Struct, /) -> None: ...

    @property
    def s2(self) -> Struct: ...

    @s2.setter
    def s2(self, arg: Struct, /) -> None: ...

class OptionalNoneTest:
    def __init__(self) -> None: ...

    def compute(self, i: int, j: int | None = None, k: int = 0) -> int: ...

def stats() -> dict: ...

def reset() -> None: ...

class Big:
    """
    A class
    with a multi-line
    docstring..
    """

    def __init__(self) -> None: ...

class BigAligned:
    def __init__(self) -> None: ...

class Animal:
    def __init__(self) -> None:
        """A constructor"""

    def name(self) -> str:
        """A method"""

    def what(self) -> str: ...

class Dog(Animal):
    def __init__(self, arg: str, /) -> None: ...

class Cat(Animal):
    def __init__(self, arg: str, /) -> None: ...

class SiameseCat(Cat):
    pass

def go(arg: Animal, /) -> str: ...

def animal_passthrough(arg: Animal, /) -> Animal: ...

def dog_passthrough(arg: Dog, /) -> Dog: ...

def void_ret(arg: Animal, /) -> None: ...

def call_function(arg: object, /) -> object: ...

def call_method(arg: object, /) -> object: ...

class Foo:
    pass

def i2p(arg: int, /) -> Foo: ...

def p2i(x: Foo | None = None) -> int: ...

class A:
    def __init__(self, arg: int, /) -> None: ...

class B:
    def __init__(self, arg: int, /) -> None: ...

class B2(B):
    def __init__(self, arg: int, /) -> None: ...

class C:
    def __init__(self, arg: int, /) -> None: ...

class D:
    @overload
    def __init__(self, arg: A, /) -> None: ...

    @overload
    def __init__(self, arg: B, /) -> None: ...

    @overload
    def __init__(self, arg: int, /) -> None: ...

    @overload
    def __init__(self, arg: float, /) -> None: ...

    @property
    def value(self) -> int: ...

    @value.setter
    def value(self, arg: int, /) -> None: ...

def get_d(arg: D, /) -> int: ...

def get_optional_d(arg: D | None) -> int: ...

def get_d_via_cast(arg: object, /) -> tuple: ...

def get_d_via_try_cast(arg: object, /) -> tuple: ...

class Int:
    def __init__(self, arg: int, /) -> None: ...

    def __add__(self, arg: Int, /) -> Int: ...

    def __iadd__(self, arg: Int, /) -> Int: ...

    def __sub__(self, arg: float, /) -> Int: ...

    def __repr__(self) -> str: ...

def keep_alive_arg(arg0: object, arg1: object, /) -> object: ...

def keep_alive_ret(arg0: object, arg1: object, /) -> object: ...

def f() -> None: ...

class MyClass:
    def __init__(self) -> None: ...

    class NestedClass:
        def f(self) -> None: ...

    def f(self) -> None: ...

class StaticProperties:
    value: int = ...
    """Static property docstring"""

    @staticmethod
    def get() -> int: ...

class StaticProperties2(StaticProperties):
    pass

class ClassWithSupplement:
    def __init__(self) -> None: ...

def check_supplement(arg: object, /) -> bool: ...

class ClassWithLen:
    def __init__(self) -> None: ...

    def __len__(self, /):
        """Return len(self)."""

def test_lowlevel() -> tuple: ...

def test_handle_t(arg: Struct, /) -> object: ...

def test_type_object_t(arg: type[Struct], /) -> object: ...

def none_0(arg: Struct, /) -> bool: ...

def none_1(arg: Struct) -> bool: ...

def none_2(arg: Struct) -> bool: ...

def none_3(arg: Struct | None) -> bool: ...

def none_4(arg: Struct | None) -> bool: ...

class FinalType:
    def __init__(self) -> None: ...

class StructWithAttr(Struct):
    def __init__(self, arg: int, /) -> None: ...

class Wrapper:
    def __init__(self) -> None: ...

    @property
    def value(self) -> Wrapper: ...

    @value.setter
    def value(self, arg: Wrapper, /) -> None: ...

class NonCopyableVec:
    pass

class PrivateNonCopyable:
    @staticmethod
    def get_instance() -> PrivateNonCopyable: ...

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

def is_int_1(arg: object, /) -> bool: ...

def is_int_2(arg: object, /) -> bool: ...

def is_struct(arg: object, /) -> bool: ...

class Base:
    pass

class Subclass:
    pass

class PolymorphicBase:
    pass

class PolymorphicSubclass:
    pass

def polymorphic_factory() -> PolymorphicBase: ...

def polymorphic_factory_2() -> PolymorphicBase: ...

def factory() -> Base: ...

def factory_2() -> Base: ...

def check_shared(arg: "Shared", /) -> None: ...

def try_cast_1(arg: object | None) -> tuple[bool, Struct]: ...

def try_cast_2(arg: object | None) -> tuple[bool, Struct]: ...

def try_cast_3(arg: object | None) -> tuple[bool, Struct]: ...

def try_cast_4(arg: object, /) -> tuple[bool, int]: ...

def test_slots() -> tuple: ...

class IncrementingStruct(Struct):
    def __init__(self, arg: Struct, /) -> None: ...

def get_destructed() -> list: ...

def get_incrementing_struct_value(arg: IncrementingStruct, /) -> Struct: ...

class StructWithWeakrefs(Struct):
    def __init__(self, arg: int, /) -> None: ...

class StructWithWeakrefsAndDynamicAttrs(Struct):
    def __init__(self, arg: int, /) -> None: ...

class StructWithWeakrefsOnly(Struct):
    def __init__(self, arg: int, /) -> None: ...

class Union:
    def __init__(self) -> None: ...

    @property
    def i(self) -> int: ...

    @i.setter
    def i(self, arg: int, /) -> None: ...

    @property
    def f(self) -> float: ...

    @f.setter
    def f(self, arg: float, /) -> None: ...

class BoundDerived:
    def __init__(self) -> None: ...

    @property
    def value(self) -> int: ...

    @value.setter
    def value(self, arg: int, /) -> None: ...

    @property
    def prop(self) -> int: ...

    @prop.setter
    def prop(self, arg: int, /) -> None: ...

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

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

class UniqueInt:
    @overload
    def __init__(self, arg: int, /) -> None: ...

    @overload
    def __init__(self, s: str) -> None: ...

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

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

class NewNone:
    def __init__(self) -> None: ...

class NewDflt:
    def __init__(self, value: int = 42) -> None: ...

    @property
    def value(self) -> int: ...

class NewStarPosOnly:
    def __init__(self, *args, value: int = 42) -> None: ...

    @property
    def value(self) -> int: ...

class NewStar:
    def __init__(self, *args, value: int = 42, **kwargs) -> None: ...

    @property
    def value(self) -> int: ...

class MonkeyPatchable:
    def __init__(self) -> None: ...

    @staticmethod
    def custom_init(arg: MonkeyPatchable, /) -> None: ...

    @property
    def value(self) -> int: ...

    @value.setter
    def value(self, arg: int, /) -> None: ...

class StaticPropertyOverride:
    x: int = ...
    """(arg: object, /) -> int"""

class StaticPropertyOverride2(StaticPropertyOverride):
    x: int = ...
    """(arg: object, /) -> int"""

class ConstexprClass:
    def __init__(self, arg: int, /) -> None: ...

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

def constexpr_call_getInt(arg: ConstexprClass, /) -> int: ...

class NeverDestruct:
    @staticmethod
    def make_ref() -> NeverDestruct: ...

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

    def set_var(self, arg: int, /) -> None: ...
