"""
This type stub file was generated by pyright.
"""

import enum

from llvmlite import ir
from llvmlite.binding import ffi

class TypeKind(enum.IntEnum):
    void = ...
    half = ...
    float = ...
    double = ...
    x86_fp80 = ...
    fp128 = ...
    ppc_fp128 = ...
    label = ...
    integer = ...
    function = ...
    struct = ...
    array = ...
    pointer = ...
    vector = ...
    metadata = ...
    x86_mmx = ...
    token = ...
    scalable_vector = ...
    bfloat = ...
    x86_amx = ...

_TypeKindToIRType = ...

class TypeRef(ffi.ObjectRef):
    """A weak reference to a LLVM type"""
    @property
    def name(self):  # -> str | None:
        """
        Get type name
        """
        ...

    @property
    def is_struct(self):
        """
        Returns true if the type is a struct type.
        """
        ...

    @property
    def is_pointer(self):
        """
        Returns true if the type is a pointer type.
        """
        ...

    @property
    def is_array(self):
        """
        Returns true if the type is an array type.
        """
        ...

    @property
    def is_vector(self):
        """
        Returns true if the type is a vector type.
        """
        ...

    @property
    def is_function(self):
        """
        Returns true if the type is a function type.
        """
        ...

    @property
    def is_function_vararg(self):
        """
        Returns true if a function type accepts a variable number of arguments.
        When the type is not a function, raises exception.
        """
        ...

    @property
    def elements(self):  # -> _TypeListIterator:
        """
        Returns iterator over enclosing types
        """
        ...

    @property
    def element_count(self):
        """
        Returns the number of elements in an array or a vector. For scalable
        vectors, returns minimum number of elements. When the type is neither
        an array nor a vector, raises exception.
        """
        ...

    @property
    def type_width(self):
        """
        Return the basic size of this type if it is a primitive type. These are
        fixed by LLVM and are not target-dependent.
        This will return zero if the type does not have a size or is not a
        primitive type.

        If this is a scalable vector type, the scalable property will be set and
        the runtime size will be a positive integer multiple of the base size.

        Note that this may not reflect the size of memory allocated for an
        instance of the type or the number of bytes that are written when an
        instance of the type is stored to memory.
        """
        ...

    @property
    def type_kind(self):  # -> TypeKind:
        """
        Returns the LLVMTypeKind enumeration of this type.
        """
        ...

    @property
    def is_packed_struct(self): ...
    @property
    def is_literal_struct(self): ...
    @property
    def is_opaque_struct(self): ...
    def get_function_parameters(self) -> tuple[TypeRef]: ...
    def get_function_return(self) -> TypeRef: ...
    def as_ir(self, ir_ctx: ir.Context) -> ir.Type:
        """Convert into a ``llvmlite.ir.Type``."""
        ...

class _TypeIterator(ffi.ObjectRef):
    def __next__(self):  # -> TypeRef:
        ...

    next = ...
    def __iter__(self):  # -> Self:
        ...

class _TypeListIterator(_TypeIterator): ...
