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

from typing import TYPE_CHECKING
from tree_sitter import Node as TSNode
from graph_sitter.core.autocommit import reader, writer
from graph_sitter.core.expressions import Expression
from graph_sitter.core.expressions.name import Name
from graph_sitter.core.interfaces.has_name import HasName
from graph_sitter.core.interfaces.has_value import HasValue
from graph_sitter.typescript.detached_symbols.jsx.expression import JSXExpression
from graph_sitter.writer_decorators import ts_apidoc
from graph_sitter.core.function import Function
from graph_sitter.typescript.detached_symbols.jsx.element import JSXElement

if TYPE_CHECKING:
    ...
@ts_apidoc
class JSXProp(Expression["Function | JSXElement | JSXProp"], HasName, HasValue):
    """Abstract representation of TSX/JSX prop, e.g <Component prop="value" />."""
    _name_node: Name | None
    _expression_node: JSXExpression | None
    def __init__(self, ts_node: TSNode, parent: Function | JSXElement | JSXProp) -> None:
        ...
    
    @property
    @reader
    def expression(self) -> JSXExpression | None:
        """Retrieves the JSX expression associated with this JSX prop.

        Returns the JSX expression node if this prop has one, e.g., for props like prop={expression}.
        For boolean props or string literal props, returns None.

        Returns:
            JSXExpression | None: The JSX expression node if present, None otherwise.
        """
        ...
    
    @writer
    def insert_after(self, new_src: str, fix_indentation: bool = ..., newline: bool = ..., priority: int = ..., dedupe: bool = ...) -> None:
        """Inserts source code after a JSX prop in a TypeScript/JSX file.

        Inserts the provided source code after the current JSX prop, adding necessary spacing.

        Args:
            new_src (str): The source code to insert after the prop.
            fix_indentation (bool, optional): Whether to fix the indentation of the inserted code. Defaults to False.
            newline (bool, optional): Whether to add a newline after the inserted code. Defaults to True.
            priority (int, optional): The priority of the insertion. Defaults to 0.
            dedupe (bool, optional): Whether to prevent duplicate insertions. Defaults to True.

        Returns:
            None
        """
        ...
    
    @writer
    def insert_before(self, new_src: str, fix_indentation: bool = ..., newline: bool = ..., priority: int = ..., dedupe: bool = ...) -> None:
        """Insert a new source code string before a JSX prop in a React component.

        Inserts a new string of source code before a JSX prop, maintaining proper spacing.
        Automatically adds a trailing space after the inserted code.

        Args:
            new_src (str): The source code string to insert before the prop.
            fix_indentation (bool, optional): Whether to adjust the indentation of the inserted code. Defaults to False.
            newline (bool, optional): Whether to add a newline after the inserted code. Defaults to True.
            priority (int, optional): Priority of this insertion relative to others. Defaults to 0.
            dedupe (bool, optional): Whether to avoid duplicate insertions. Defaults to True.

        Returns:
            None
        """
        ...
    


