vars.pyi 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. """ Generated with stubgen from mypy, then manually edited, do not regen."""
  2. from dataclasses import dataclass
  3. from _typeshed import Incomplete
  4. from reflex import constants as constants
  5. from reflex.base import Base as Base
  6. from reflex.state import State as State
  7. from reflex.utils import console as console, format as format, types as types
  8. from types import FunctionType
  9. from typing import (
  10. Any,
  11. Callable,
  12. Dict,
  13. List,
  14. Optional,
  15. Set,
  16. Type,
  17. Union,
  18. _GenericAlias, # type: ignore
  19. )
  20. USED_VARIABLES: Incomplete
  21. def get_unique_variable_name() -> str: ...
  22. class Var:
  23. _var_name: str
  24. _var_type: Type
  25. _var_state: str = ""
  26. _var_is_local: bool = False
  27. _var_is_string: bool = False
  28. @classmethod
  29. def create(
  30. cls, value: Any, _var_is_local: bool = False, _var_is_string: bool = False
  31. ) -> Optional[Var]: ...
  32. @classmethod
  33. def create_safe(
  34. cls, value: Any, _var_is_local: bool = False, _var_is_string: bool = False
  35. ) -> Var: ...
  36. @classmethod
  37. def __class_getitem__(cls, type_: str) -> _GenericAlias: ...
  38. def equals(self, other: Var) -> bool: ...
  39. def to_string(self) -> Var: ...
  40. def __hash__(self) -> int: ...
  41. def __format__(self, format_spec: str) -> str: ...
  42. def __getitem__(self, i: Any) -> Var: ...
  43. def __getattribute__(self, name: str) -> Var: ...
  44. def operation(
  45. self,
  46. op: str = ...,
  47. other: Optional[Var] = ...,
  48. type_: Optional[Type] = ...,
  49. flip: bool = ...,
  50. fn: Optional[str] = ...,
  51. ) -> Var: ...
  52. def compare(self, op: str, other: Var) -> Var: ...
  53. def __invert__(self) -> Var: ...
  54. def __neg__(self) -> Var: ...
  55. def __abs__(self) -> Var: ...
  56. def length(self) -> Var: ...
  57. def __eq__(self, other: Var) -> Var: ...
  58. def __ne__(self, other: Var) -> Var: ...
  59. def __gt__(self, other: Var) -> Var: ...
  60. def __ge__(self, other: Var) -> Var: ...
  61. def __lt__(self, other: Var) -> Var: ...
  62. def __le__(self, other: Var) -> Var: ...
  63. def __add__(self, other: Var) -> Var: ...
  64. def __radd__(self, other: Var) -> Var: ...
  65. def __sub__(self, other: Var) -> Var: ...
  66. def __rsub__(self, other: Var) -> Var: ...
  67. def __mul__(self, other: Var) -> Var: ...
  68. def __rmul__(self, other: Var) -> Var: ...
  69. def __pow__(self, other: Var) -> Var: ...
  70. def __rpow__(self, other: Var) -> Var: ...
  71. def __truediv__(self, other: Var) -> Var: ...
  72. def __rtruediv__(self, other: Var) -> Var: ...
  73. def __floordiv__(self, other: Var) -> Var: ...
  74. def __mod__(self, other: Var) -> Var: ...
  75. def __rmod__(self, other: Var) -> Var: ...
  76. def __and__(self, other: Var) -> Var: ...
  77. def __rand__(self, other: Var) -> Var: ...
  78. def __or__(self, other: Var) -> Var: ...
  79. def __ror__(self, other: Var) -> Var: ...
  80. def __contains__(self, _: Any) -> Var: ...
  81. def contains(self, other: Any) -> Var: ...
  82. def reverse(self) -> Var: ...
  83. def foreach(self, fn: Callable) -> Var: ...
  84. def to(self, type_: Type) -> Var: ...
  85. @property
  86. def _var_full_name(self) -> str: ...
  87. def _var_set_state(self, state: Type[State]) -> Any: ...
  88. @dataclass(eq=False)
  89. class BaseVar(Var):
  90. _var_name: str
  91. _var_type: Any
  92. _var_state: str = ""
  93. _var_is_local: bool = False
  94. _var_is_string: bool = False
  95. def __hash__(self) -> int: ...
  96. def get_default_value(self) -> Any: ...
  97. def get_setter_name(self, include_state: bool = ...) -> str: ...
  98. def get_setter(self) -> Callable[[State, Any], None]: ...
  99. @dataclass(init=False)
  100. class ComputedVar(Var):
  101. _var_cache: bool
  102. fget: FunctionType
  103. @property
  104. def _cache_attr(self) -> str: ...
  105. def __get__(self, instance, owner): ...
  106. def _deps(self, objclass: Type, obj: Optional[FunctionType] = ...) -> Set[str]: ...
  107. def mark_dirty(self, instance) -> None: ...
  108. def _determine_var_type(self) -> Type: ...
  109. def __init__(self, func) -> None: ...
  110. def cached_var(fget: Callable[[Any], Any]) -> ComputedVar: ...
  111. class ImportVar(Base):
  112. tag: Optional[str]
  113. is_default: Optional[bool] = False
  114. alias: Optional[str] = None
  115. install: Optional[bool] = True
  116. render: Optional[bool] = True
  117. @property
  118. def name(self) -> str: ...
  119. def __hash__(self) -> int: ...
  120. class NoRenderImportVar(ImportVar):
  121. """A import that doesn't need to be rendered."""
  122. def get_local_storage(key: Optional[Union[Var, str]] = ...) -> BaseVar: ...