"""Stub file for reflex_enterprise/components/ag_grid/handlers.py"""

# ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------
from types import SimpleNamespace
from typing import Any, Type, TypeVar

import reflex as rx
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.sql.roles import WhereHavingRole
from sqlmodel import and_, or_
from sqlmodel.sql.expression import SelectOfScalar

M = TypeVar("M", bound=rx.Model)

def handle_text_filter(value: str, filter_def: dict[str, str]) -> bool: ...
def handle_number_filter(value: int, filter_def: dict) -> bool: ...
def handle_filter_def(value: Any, filter_def: dict) -> bool: ...
def handle_filter_model(row: list, filter_model: dict) -> bool: ...

_sql_operations = {"and": and_, "or": or_}

def where_text_filter(
    value: InstrumentedAttribute, filter_def: dict[str, str]
) -> WhereHavingRole: ...
def where_number_filter(
    value: InstrumentedAttribute, filter_def: dict[str, str | int | float]
) -> WhereHavingRole: ...
def where_filter_def(
    value: InstrumentedAttribute, filter_def: dict[str, Any]
) -> WhereHavingRole | None: ...
def where_filter_outer_def(
    model: Type[M], filter_def: dict[str, Any]
) -> WhereHavingRole | None: ...
def apply_filter_model(
    model: Type[M], filter_model: dict[str, dict[str, Any]]
) -> SelectOfScalar[M]: ...
def apply_sort_model(
    model: Type[M], query: SelectOfScalar[M], sort_model: list[dict[str, str]]
) -> SelectOfScalar[M]: ...

class HandlerNamespace(SimpleNamespace):
    text_filter = handle_text_filter
