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

from dataclasses import dataclass
from enum import IntEnum, IntFlag, unique
from typing import TYPE_CHECKING
from dataclasses_json import dataclass_json
from graph_sitter.writer_decorators import apidoc
from graph_sitter.core.detached_symbols.function_call import FunctionCall
from graph_sitter.core.export import Export
from graph_sitter.core.expressions import Name
from graph_sitter.core.expressions.chained_attribute import ChainedAttribute
from graph_sitter.core.file import SourceFile
from graph_sitter.core.import_resolution import Import
from graph_sitter.core.symbol import Symbol

if TYPE_CHECKING:
    ...
@apidoc
@dataclass_json
@dataclass(frozen=True)
class Usage:
    """A reference to an exportable object in a file.

    Attributes:
        match: The exact match of the usage
        usage_symbol: The symbol this object is used in
        usage_type: How this symbol was used
        kind: Where this symbol was used (IE: in a type parameter or in the body of the class, etc)
    """
    match: Name | ChainedAttribute | FunctionCall
    usage_symbol: Import | Symbol | Export | SourceFile
    imported_by: Import | None
    usage_type: UsageType
    kind: UsageKind
    ...


@unique
@apidoc
class UsageType(IntFlag):
    """Describes how a symbol is used elsewhere. Used in conjunction with get_usages

    Attributes:
        DIRECT: Direct imports and usages within the same file
        CHAINED: Chained references (ie: module.foo)
        INDIRECT:  Indirect usages with the same name
        ALIASED: Aliased indirect usages
    """
    DIRECT = ...
    CHAINED = ...
    INDIRECT = ...
    ALIASED = ...


@apidoc
class UsageKind(IntEnum):
    """SymbolUsageType is an enumeration class that defines different types of symbol usage within Python code.

    Attributes:
        SUBCLASS: Used in symbol inheritance.
        TYPE_ANNOTATION:  Used as a type annotation on a parameter or assignment statement.
        BODY: Usage within the body of a function/method.
        DECORATOR: Usage within a decorator.
        RETURN_TYPE: Used as a return type annotation
        TYPE_DEFINITION: Used in a type alias.
        EXPORTED_SYMBOL: Used in an export statement.
        EXPORTED_WILDCARD: Re-exported by a wildcard export.
        GENERIC: Used as a type parameter to another type.
        IMPORTED: Imported with an import statement.
        DEFAULT_VALUE: Represents a default value in a function/method parameter.
    """
    SUBCLASS = ...
    TYPED_PARAMETER = ...
    TYPE_ANNOTATION = ...
    BODY = ...
    DECORATOR = ...
    RETURN_TYPE = ...
    TYPE_DEFINITION = ...
    EXPORTED_SYMBOL = ...
    EXPORTED_WILDCARD = ...
    GENERIC = ...
    IMPORTED = ...
    IMPORTED_WILDCARD = ...
    DEFAULT_VALUE = ...


