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

import altair as alt
from dataclasses import dataclass
from enum import Enum
from typing import Final, Literal, TYPE_CHECKING, TypedDict
from typing_extensions import TypeAlias
from streamlit.elements.lib.color_util import Color
from streamlit.errors import StreamlitAPIException
from collections.abc import Hashable, Sequence
from streamlit.dataframe_util import Data

"""Utilities for our built-in charts commands."""
if TYPE_CHECKING:
    ...
VegaLiteType: TypeAlias = Literal["quantitative", "ordinal", "temporal", "nominal"]
ChartStackType: TypeAlias = Literal["normalize", "center", "layered"]
class PrepDataColumns(TypedDict):
    """Columns used for the prep_data step in Altair Arrow charts."""
    x_column: str | None
    y_column_list: list[str]
    color_column: str | None
    size_column: str | None
    ...


@dataclass
class AddRowsMetadata:
    """Metadata needed by add_rows on native charts.

    This class is used to pass some important info to add_rows.
    """
    chart_command: str
    last_index: Hashable | None
    columns: PrepDataColumns
    ...


class ChartType(Enum):
    AREA = ...
    VERTICAL_BAR = ...
    HORIZONTAL_BAR = ...
    LINE = ...
    SCATTER = ...


_COLOR_LEGEND_SETTINGS: Final = ...
_SIZE_LEGEND_SETTINGS: Final = ...
_SEPARATED_INDEX_COLUMN_TITLE: Final = ...
_MELTED_Y_COLUMN_TITLE: Final = ...
_MELTED_COLOR_COLUMN_TITLE: Final = ...
_PROTECTION_SUFFIX: Final = ...
_SEPARATED_INDEX_COLUMN_NAME: Final = ...
_MELTED_Y_COLUMN_NAME: Final = ...
_MELTED_COLOR_COLUMN_NAME: Final = ...
_NON_EXISTENT_COLUMN_NAME: Final = ...
def maybe_raise_stack_warning(stack: bool | ChartStackType | None, command: str | None, docs_link: str): # -> None:
    ...

def generate_chart(chart_type: ChartType, data: Data | None, x_from_user: str | None = ..., y_from_user: str | Sequence[str] | None = ..., x_axis_label: str | None = ..., y_axis_label: str | None = ..., color_from_user: str | Color | list[Color] | None = ..., size_from_user: str | float | None = ..., width: int | None = ..., height: int | None = ..., stack: bool | ChartStackType | None = ...) -> tuple[alt.Chart | alt.LayerChart, AddRowsMetadata]:
    """Function to use the chart's type, data columns and indices to figure out the
    chart's spec.
    """
    ...

def prep_chart_data_for_add_rows(data: Data, add_rows_metadata: AddRowsMetadata) -> tuple[Data, AddRowsMetadata]:
    """Prepares the data for add_rows on our built-in charts.

    This includes aspects like conversion of the data to Pandas DataFrame,
    changes to the index, and melting the data if needed.
    """
    ...

class StreamlitColumnNotFoundError(StreamlitAPIException):
    def __init__(self, df, col_name, *args) -> None:
        ...
    


class StreamlitInvalidColorError(StreamlitAPIException):
    def __init__(self, df, color_from_user, *args) -> None:
        ...
    


class StreamlitColorLengthError(StreamlitAPIException):
    def __init__(self, color_values, y_column_list, *args) -> None:
        ...
    


