"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
*!
Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2026)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from collections import abc as _abc
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
from streamlit.proto import ArrowData_pb2 as _ArrowData_pb2
import builtins as _builtins
import sys
import typing as _typing

if sys.version_info >= (3, 11):
    from typing import TypeAlias as _TypeAlias, Never as _Never
else:
    from typing_extensions import TypeAlias as _TypeAlias, Never as _Never

DESCRIPTOR: _descriptor.FileDescriptor

@_typing.final
class Dataframe(_message.Message):
    """Proto message for st.dataframe and st.data_editor elements."""

    DESCRIPTOR: _descriptor.Descriptor

    class _EditingMode:
        ValueType = _typing.NewType("ValueType", _builtins.int)
        V: _TypeAlias = ValueType  # noqa: Y015

    class _EditingModeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[Dataframe._EditingMode.ValueType], _builtins.type):
        DESCRIPTOR: _descriptor.EnumDescriptor
        READ_ONLY: Dataframe._EditingMode.ValueType  # 0
        """Read-only table."""
        FIXED: Dataframe._EditingMode.ValueType  # 1
        """Activates editing but only allow editing of existing cells."""
        DYNAMIC: Dataframe._EditingMode.ValueType  # 2
        """Activates editing and allow adding & deleting rows."""
        ADD_ONLY: Dataframe._EditingMode.ValueType  # 3
        """Activates editing and allow adding rows (no deleting)."""
        DELETE_ONLY: Dataframe._EditingMode.ValueType  # 4
        """Activates editing and allow deleting rows (no adding)."""

    class EditingMode(_EditingMode, metaclass=_EditingModeEnumTypeWrapper):
        """Available editing modes:"""

    READ_ONLY: Dataframe.EditingMode.ValueType  # 0
    """Read-only table."""
    FIXED: Dataframe.EditingMode.ValueType  # 1
    """Activates editing but only allow editing of existing cells."""
    DYNAMIC: Dataframe.EditingMode.ValueType  # 2
    """Activates editing and allow adding & deleting rows."""
    ADD_ONLY: Dataframe.EditingMode.ValueType  # 3
    """Activates editing and allow adding rows (no deleting)."""
    DELETE_ONLY: Dataframe.EditingMode.ValueType  # 4
    """Activates editing and allow deleting rows (no adding)."""

    class _SelectionMode:
        ValueType = _typing.NewType("ValueType", _builtins.int)
        V: _TypeAlias = ValueType  # noqa: Y015

    class _SelectionModeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[Dataframe._SelectionMode.ValueType], _builtins.type):
        DESCRIPTOR: _descriptor.EnumDescriptor
        SINGLE_ROW: Dataframe._SelectionMode.ValueType  # 0
        """Only one row can be selected at a time."""
        MULTI_ROW: Dataframe._SelectionMode.ValueType  # 1
        """Multiple rows can be selected at a time."""
        SINGLE_COLUMN: Dataframe._SelectionMode.ValueType  # 2
        """Only one column can be selected at a time."""
        MULTI_COLUMN: Dataframe._SelectionMode.ValueType  # 3
        """Multiple columns can be selected at a time."""
        SINGLE_CELL: Dataframe._SelectionMode.ValueType  # 4
        """Only one cell can be selected at a time."""
        MULTI_CELL: Dataframe._SelectionMode.ValueType  # 5
        """Multiple cells (continuous range) can be selected."""
        SINGLE_ROW_REQUIRED: Dataframe._SelectionMode.ValueType  # 6
        """Single row, cannot be cleared (radio-like behavior)."""

    class SelectionMode(_SelectionMode, metaclass=_SelectionModeEnumTypeWrapper):
        """Available selection modes:"""

    SINGLE_ROW: Dataframe.SelectionMode.ValueType  # 0
    """Only one row can be selected at a time."""
    MULTI_ROW: Dataframe.SelectionMode.ValueType  # 1
    """Multiple rows can be selected at a time."""
    SINGLE_COLUMN: Dataframe.SelectionMode.ValueType  # 2
    """Only one column can be selected at a time."""
    MULTI_COLUMN: Dataframe.SelectionMode.ValueType  # 3
    """Multiple columns can be selected at a time."""
    SINGLE_CELL: Dataframe.SelectionMode.ValueType  # 4
    """Only one cell can be selected at a time."""
    MULTI_CELL: Dataframe.SelectionMode.ValueType  # 5
    """Multiple cells (continuous range) can be selected."""
    SINGLE_ROW_REQUIRED: Dataframe.SelectionMode.ValueType  # 6
    """Single row, cannot be cleared (radio-like behavior)."""

    @_typing.final
    class ButtonClickWidgetsEntry(_message.Message):
        DESCRIPTOR: _descriptor.Descriptor

        KEY_FIELD_NUMBER: _builtins.int
        VALUE_FIELD_NUMBER: _builtins.int
        key: _builtins.str
        value: _builtins.str
        def __init__(
            self,
            *,
            key: _builtins.str = ...,
            value: _builtins.str = ...,
        ) -> None: ...
        _HasFieldArgType: _TypeAlias = _Never  # noqa: Y015
        def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
        _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"]  # noqa: Y015
        def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
        def WhichOneof(self, oneof_group: _Never) -> None: ...

    ARROW_DATA_FIELD_NUMBER: _builtins.int
    ID_FIELD_NUMBER: _builtins.int
    COLUMNS_FIELD_NUMBER: _builtins.int
    EDITING_MODE_FIELD_NUMBER: _builtins.int
    DISABLED_FIELD_NUMBER: _builtins.int
    FORM_ID_FIELD_NUMBER: _builtins.int
    COLUMN_ORDER_FIELD_NUMBER: _builtins.int
    SELECTION_MODE_FIELD_NUMBER: _builtins.int
    ROW_HEIGHT_FIELD_NUMBER: _builtins.int
    PLACEHOLDER_FIELD_NUMBER: _builtins.int
    SELECTION_STATE_FIELD_NUMBER: _builtins.int
    SELECTION_DEFAULT_FIELD_NUMBER: _builtins.int
    BUTTON_CLICK_WIDGETS_FIELD_NUMBER: _builtins.int
    LAZY_DATA_FIELD_NUMBER: _builtins.int
    ALT_FIELD_NUMBER: _builtins.int
    id: _builtins.str
    """The id of the widget, this is required if the dataframe is editable"""
    columns: _builtins.str
    """Column configuration as JSON"""
    editing_mode: Global___Dataframe.EditingMode.ValueType
    """Activate table editing"""
    disabled: _builtins.bool
    """Deactivates editing"""
    form_id: _builtins.str
    """The form ID of the widget, this is required if the dataframe is editable"""
    row_height: _builtins.int
    """Row height in pixels"""
    placeholder: _builtins.str
    """Placeholder string used when rendering missing values (e.g. nulls, NaNs)."""
    selection_state: _builtins.str
    """Selection state (JSON serialized), set when selection is changed programmatically
    via session state. When present, frontend applies this selection.
    When absent, frontend manages its own selection state.
    """
    selection_default: _builtins.str
    """Default selection state (JSON serialized), set when selection_default is provided.
    Applied by the frontend only when there is no stored selection state.
    """
    alt: _builtins.str
    """Author-provided accessible name for the grid (st.dataframe / st.data_editor).
    Unset means the grid has no element-level name. Glide's canvas keeps its own
    cell-level accessibility tree regardless.
    """
    @_builtins.property
    def arrow_data(self) -> _ArrowData_pb2.ArrowData:
        """The Arrow data to display"""

    @_builtins.property
    def column_order(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]:
        """Defines the order in which columns are displayed"""

    @_builtins.property
    def selection_mode(self) -> _containers.RepeatedScalarFieldContainer[Global___Dataframe.SelectionMode.ValueType]:
        """Activated dataframe selections events"""

    @_builtins.property
    def button_click_widgets(self) -> _containers.ScalarMap[_builtins.str, _builtins.str]:
        """Map of column name → widget ID for button column click events.
        Each ButtonColumn with a key parameter registers a single widget that is
        shared by all rows of that column (one entry per column, not per row). The
        clicked row index and button label are sent as part of that widget's value,
        so a single widget ID per column is sufficient to handle clicks on any row.
        """

    @_builtins.property
    def lazy_data(self) -> Global___LazyDataframe:
        """Lazy-loading metadata. When set, the frontend renders this dataframe in
        lazy mode: it requests row chunks from the backend on demand instead of
        receiving the full data in `arrow_data`. The eager `arrow_data` field is
        left empty for lazy dataframes.
        """

    def __init__(
        self,
        *,
        arrow_data: _ArrowData_pb2.ArrowData | None = ...,
        id: _builtins.str = ...,
        columns: _builtins.str = ...,
        editing_mode: Global___Dataframe.EditingMode.ValueType = ...,
        disabled: _builtins.bool = ...,
        form_id: _builtins.str = ...,
        column_order: _abc.Iterable[_builtins.str] | None = ...,
        selection_mode: _abc.Iterable[Global___Dataframe.SelectionMode.ValueType] | None = ...,
        row_height: _builtins.int | None = ...,
        placeholder: _builtins.str | None = ...,
        selection_state: _builtins.str | None = ...,
        selection_default: _builtins.str | None = ...,
        button_click_widgets: _abc.Mapping[_builtins.str, _builtins.str] | None = ...,
        lazy_data: Global___LazyDataframe | None = ...,
        alt: _builtins.str | None = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["_alt", b"_alt", "_lazy_data", b"_lazy_data", "_placeholder", b"_placeholder", "_row_height", b"_row_height", "_selection_default", b"_selection_default", "_selection_state", b"_selection_state", "alt", b"alt", "arrow_data", b"arrow_data", "lazy_data", b"lazy_data", "placeholder", b"placeholder", "row_height", b"row_height", "selection_default", b"selection_default", "selection_state", b"selection_state"]  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["_alt", b"_alt", "_lazy_data", b"_lazy_data", "_placeholder", b"_placeholder", "_row_height", b"_row_height", "_selection_default", b"_selection_default", "_selection_state", b"_selection_state", "alt", b"alt", "arrow_data", b"arrow_data", "button_click_widgets", b"button_click_widgets", "column_order", b"column_order", "columns", b"columns", "disabled", b"disabled", "editing_mode", b"editing_mode", "form_id", b"form_id", "id", b"id", "lazy_data", b"lazy_data", "placeholder", b"placeholder", "row_height", b"row_height", "selection_default", b"selection_default", "selection_mode", b"selection_mode", "selection_state", b"selection_state"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    _WhichOneofReturnType__alt: _TypeAlias = _typing.Literal["alt"]  # noqa: Y015
    _WhichOneofArgType__alt: _TypeAlias = _typing.Literal["_alt", b"_alt"]  # noqa: Y015
    _WhichOneofReturnType__lazy_data: _TypeAlias = _typing.Literal["lazy_data"]  # noqa: Y015
    _WhichOneofArgType__lazy_data: _TypeAlias = _typing.Literal["_lazy_data", b"_lazy_data"]  # noqa: Y015
    _WhichOneofReturnType__placeholder: _TypeAlias = _typing.Literal["placeholder"]  # noqa: Y015
    _WhichOneofArgType__placeholder: _TypeAlias = _typing.Literal["_placeholder", b"_placeholder"]  # noqa: Y015
    _WhichOneofReturnType__row_height: _TypeAlias = _typing.Literal["row_height"]  # noqa: Y015
    _WhichOneofArgType__row_height: _TypeAlias = _typing.Literal["_row_height", b"_row_height"]  # noqa: Y015
    _WhichOneofReturnType__selection_default: _TypeAlias = _typing.Literal["selection_default"]  # noqa: Y015
    _WhichOneofArgType__selection_default: _TypeAlias = _typing.Literal["_selection_default", b"_selection_default"]  # noqa: Y015
    _WhichOneofReturnType__selection_state: _TypeAlias = _typing.Literal["selection_state"]  # noqa: Y015
    _WhichOneofArgType__selection_state: _TypeAlias = _typing.Literal["_selection_state", b"_selection_state"]  # noqa: Y015
    @_typing.overload
    def WhichOneof(self, oneof_group: _WhichOneofArgType__alt) -> _WhichOneofReturnType__alt | None: ...
    @_typing.overload
    def WhichOneof(self, oneof_group: _WhichOneofArgType__lazy_data) -> _WhichOneofReturnType__lazy_data | None: ...
    @_typing.overload
    def WhichOneof(self, oneof_group: _WhichOneofArgType__placeholder) -> _WhichOneofReturnType__placeholder | None: ...
    @_typing.overload
    def WhichOneof(self, oneof_group: _WhichOneofArgType__row_height) -> _WhichOneofReturnType__row_height | None: ...
    @_typing.overload
    def WhichOneof(self, oneof_group: _WhichOneofArgType__selection_default) -> _WhichOneofReturnType__selection_default | None: ...
    @_typing.overload
    def WhichOneof(self, oneof_group: _WhichOneofArgType__selection_state) -> _WhichOneofReturnType__selection_state | None: ...

Global___Dataframe: _TypeAlias = Dataframe  # noqa: Y015

@_typing.final
class LazyDataframe(_message.Message):
    """Metadata for a lazily loaded dataframe. The data itself is fetched on demand
    in row chunks via BackendOperationRequest/BackendOperationResponse, keyed by
    `source_id`.
    """

    DESCRIPTOR: _descriptor.Descriptor

    class _AccessMode:
        ValueType = _typing.NewType("ValueType", _builtins.int)
        V: _TypeAlias = ValueType  # noqa: Y015

    class _AccessModeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[LazyDataframe._AccessMode.ValueType], _builtins.type):
        DESCRIPTOR: _descriptor.EnumDescriptor
        ACCESS_MODE_UNSPECIFIED: LazyDataframe._AccessMode.ValueType  # 0
        RANDOM_ACCESS: LazyDataframe._AccessMode.ValueType  # 1
        """Arbitrary row ranges can be requested (known-size sources)."""
        SEQUENTIAL: LazyDataframe._AccessMode.ValueType  # 2
        """Rows can only be read sequentially (reserved for future streaming
        sources).
        """

    class AccessMode(_AccessMode, metaclass=_AccessModeEnumTypeWrapper): ...
    ACCESS_MODE_UNSPECIFIED: LazyDataframe.AccessMode.ValueType  # 0
    RANDOM_ACCESS: LazyDataframe.AccessMode.ValueType  # 1
    """Arbitrary row ranges can be requested (known-size sources)."""
    SEQUENTIAL: LazyDataframe.AccessMode.ValueType  # 2
    """Rows can only be read sequentially (reserved for future streaming
    sources).
    """

    SOURCE_ID_FIELD_NUMBER: _builtins.int
    ROW_COUNT_FIELD_NUMBER: _builtins.int
    PAGE_SIZE_FIELD_NUMBER: _builtins.int
    ACCESS_MODE_FIELD_NUMBER: _builtins.int
    INITIAL_CHUNK_FIELD_NUMBER: _builtins.int
    SORTABLE_FIELD_NUMBER: _builtins.int
    source_id: _builtins.str
    """Session-scoped, unguessable id of the backend data source. Used by the
    frontend to request row chunks. Not usable across sessions.
    """
    row_count: _builtins.int
    """Total number of rows in the source. Always set in the first version
    (known-size sources). Reserved as optional for future sequential sources.
    """
    page_size: _builtins.int
    """Number of rows the backend serves per chunk. The frontend aligns its chunk
    requests to this page size.
    """
    access_mode: Global___LazyDataframe.AccessMode.ValueType
    """How the source can be accessed."""
    sortable: _builtins.bool
    """Whether server-side sorting is enabled for this source."""
    @_builtins.property
    def initial_chunk(self) -> _ArrowData_pb2.ArrowData:
        """The initial row chunk as an Arrow IPC table including the full schema.
        For lazy dataframes this carries the schema and the first visible rows.
        """

    def __init__(
        self,
        *,
        source_id: _builtins.str = ...,
        row_count: _builtins.int | None = ...,
        page_size: _builtins.int = ...,
        access_mode: Global___LazyDataframe.AccessMode.ValueType = ...,
        initial_chunk: _ArrowData_pb2.ArrowData | None = ...,
        sortable: _builtins.bool = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _typing.Literal["_row_count", b"_row_count", "initial_chunk", b"initial_chunk", "row_count", b"row_count"]  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["_row_count", b"_row_count", "access_mode", b"access_mode", "initial_chunk", b"initial_chunk", "page_size", b"page_size", "row_count", b"row_count", "sortable", b"sortable", "source_id", b"source_id"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    _WhichOneofReturnType__row_count: _TypeAlias = _typing.Literal["row_count"]  # noqa: Y015
    _WhichOneofArgType__row_count: _TypeAlias = _typing.Literal["_row_count", b"_row_count"]  # noqa: Y015
    def WhichOneof(self, oneof_group: _WhichOneofArgType__row_count) -> _WhichOneofReturnType__row_count | None: ...

Global___LazyDataframe: _TypeAlias = LazyDataframe  # noqa: Y015

@_typing.final
class SortState(_message.Message):
    """Server-side sort state for a lazy dataframe. The `column` value is a stable
    backend field name from the Arrow schema, not the displayed column label.
    """

    DESCRIPTOR: _descriptor.Descriptor

    class _SortDirection:
        ValueType = _typing.NewType("ValueType", _builtins.int)
        V: _TypeAlias = ValueType  # noqa: Y015

    class _SortDirectionEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[SortState._SortDirection.ValueType], _builtins.type):
        DESCRIPTOR: _descriptor.EnumDescriptor
        SORT_DIRECTION_UNSPECIFIED: SortState._SortDirection.ValueType  # 0
        ASCENDING: SortState._SortDirection.ValueType  # 1
        DESCENDING: SortState._SortDirection.ValueType  # 2

    class SortDirection(_SortDirection, metaclass=_SortDirectionEnumTypeWrapper): ...
    SORT_DIRECTION_UNSPECIFIED: SortState.SortDirection.ValueType  # 0
    ASCENDING: SortState.SortDirection.ValueType  # 1
    DESCENDING: SortState.SortDirection.ValueType  # 2

    COLUMN_FIELD_NUMBER: _builtins.int
    DIRECTION_FIELD_NUMBER: _builtins.int
    column: _builtins.str
    direction: Global___SortState.SortDirection.ValueType
    def __init__(
        self,
        *,
        column: _builtins.str = ...,
        direction: Global___SortState.SortDirection.ValueType = ...,
    ) -> None: ...
    _HasFieldArgType: _TypeAlias = _Never  # noqa: Y015
    def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
    _ClearFieldArgType: _TypeAlias = _typing.Literal["column", b"column", "direction", b"direction"]  # noqa: Y015
    def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
    def WhichOneof(self, oneof_group: _Never) -> None: ...

Global___SortState: _TypeAlias = SortState  # noqa: Y015
