135 lines
5.6 KiB
Python
135 lines
5.6 KiB
Python
"""Stub file for reflex/experimental/memo.py"""
|
|
|
|
# ------------------- DO NOT EDIT ----------------------
|
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
# ------------------------------------------------------
|
|
import dataclasses
|
|
import inspect
|
|
from collections.abc import Callable, Mapping, Sequence
|
|
from typing import Any
|
|
|
|
from reflex_base.components.component import Component
|
|
from reflex_base.event import EventType, PointerEventInfo
|
|
from reflex_base.vars.base import Var
|
|
from reflex_base.vars.function import ArgsFunctionOperation, FunctionVar
|
|
from reflex_components_core.core.breakpoints import Breakpoints
|
|
|
|
@dataclasses.dataclass(frozen=True, slots=True, kw_only=True)
|
|
class MemoParam:
|
|
name: str
|
|
annotation: Any
|
|
kind: inspect._ParameterKind
|
|
default: Any
|
|
js_prop_name: str | None
|
|
placeholder_name: str
|
|
is_children: bool
|
|
is_rest: bool
|
|
|
|
@dataclasses.dataclass(frozen=True, slots=True)
|
|
class ExperimentalMemoDefinition:
|
|
fn: Callable[..., Any]
|
|
python_name: str
|
|
params: tuple[MemoParam, ...]
|
|
|
|
@dataclasses.dataclass(frozen=True, slots=True)
|
|
class ExperimentalMemoFunctionDefinition(ExperimentalMemoDefinition):
|
|
function: ArgsFunctionOperation
|
|
imported_var: FunctionVar
|
|
|
|
@dataclasses.dataclass(frozen=True, slots=True)
|
|
class ExperimentalMemoComponentDefinition(ExperimentalMemoDefinition):
|
|
export_name: str
|
|
component: Component
|
|
passthrough_hole_child: Component | None
|
|
|
|
class ExperimentalMemoComponent(Component):
|
|
@classmethod
|
|
def create(
|
|
cls,
|
|
*children,
|
|
style: Sequence[Mapping[str, Any]]
|
|
| Mapping[str, Any]
|
|
| Var[Mapping[str, Any]]
|
|
| Breakpoints
|
|
| None = None,
|
|
key: Any | None = None,
|
|
id: Any | None = None,
|
|
ref: Var | None = None,
|
|
class_name: Any | None = None,
|
|
custom_attrs: dict[str, Any | Var] | None = None,
|
|
on_blur: EventType[()] | None = None,
|
|
on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
|
|
on_focus: EventType[()] | None = None,
|
|
on_mount: EventType[()] | None = None,
|
|
on_mouse_down: EventType[()] | None = None,
|
|
on_mouse_enter: EventType[()] | None = None,
|
|
on_mouse_leave: EventType[()] | None = None,
|
|
on_mouse_move: EventType[()] | None = None,
|
|
on_mouse_out: EventType[()] | None = None,
|
|
on_mouse_over: EventType[()] | None = None,
|
|
on_mouse_up: EventType[()] | None = None,
|
|
on_scroll: EventType[()] | None = None,
|
|
on_scroll_end: EventType[()] | None = None,
|
|
on_unmount: EventType[()] | None = None,
|
|
**props,
|
|
) -> ExperimentalMemoComponent:
|
|
"""Create the component.
|
|
|
|
Args:
|
|
*children: The children of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
ref: The Var to pass as the ref to the component.
|
|
class_name: The class name for the component.
|
|
custom_attrs: Attributes passed directly to the component.
|
|
on_focus: Fired when the element (or some element inside of it) receives focus. For example, it is called when the user clicks on a text input.
|
|
on_blur: Fired when focus has left the element (or left some element inside of it). For example, it is called when the user clicks outside of a focused text input.
|
|
on_click: Fired when the user clicks on an element. For example, it's called when the user clicks on a button.
|
|
on_context_menu: Fired when the user right-clicks on an element.
|
|
on_double_click: Fired when the user double-clicks on an element.
|
|
on_mouse_down: Fired when the user presses a mouse button on an element.
|
|
on_mouse_enter: Fired when the mouse pointer enters the element.
|
|
on_mouse_leave: Fired when the mouse pointer leaves the element.
|
|
on_mouse_move: Fired when the mouse pointer moves over the element.
|
|
on_mouse_out: Fired when the mouse pointer moves out of the element.
|
|
on_mouse_over: Fired when the mouse pointer moves onto the element.
|
|
on_mouse_up: Fired when the user releases a mouse button on an element.
|
|
on_scroll: Fired when the user scrolls the element.
|
|
on_scroll_end: Fired when scrolling ends on the element.
|
|
on_mount: Fired when the component is mounted to the page.
|
|
on_unmount: Fired when the component is removed from the page. Only called during navigation, not on page refresh.
|
|
**props: The props of the component.
|
|
|
|
Returns:
|
|
The component.
|
|
"""
|
|
|
|
EXPERIMENTAL_MEMOS: dict[str, ExperimentalMemoDefinition]
|
|
|
|
class _ExperimentalMemoFunctionWrapper:
|
|
def __call__(self, *args: Any, **kwargs: Any) -> Var: ...
|
|
def call(self, *args: Any, **kwargs: Any) -> Var: ...
|
|
def partial(self, *args: Any, **kwargs: Any) -> FunctionVar: ...
|
|
|
|
class _ExperimentalMemoComponentWrapper:
|
|
def __call__(self, *children: Any, **props: Any) -> ExperimentalMemoComponent: ...
|
|
|
|
def create_passthrough_component_memo(
|
|
component: Component,
|
|
) -> tuple[
|
|
Callable[..., ExperimentalMemoComponent], ExperimentalMemoComponentDefinition
|
|
]: ...
|
|
def memo(fn: Callable[..., Any]) -> Callable[..., Any]: ...
|
|
|
|
__all__ = [
|
|
"EXPERIMENTAL_MEMOS",
|
|
"ExperimentalMemoComponent",
|
|
"ExperimentalMemoComponentDefinition",
|
|
"ExperimentalMemoDefinition",
|
|
"ExperimentalMemoFunctionDefinition",
|
|
"create_passthrough_component_memo",
|
|
"memo",
|
|
]
|