error_boundary.pyi 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. """Stub file for reflex/components/base/error_boundary.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Optional, Tuple, Union, overload
  6. from reflex.components.component import Component
  7. from reflex.event import BASE_STATE, EventType
  8. from reflex.style import Style
  9. from reflex.vars.base import Var
  10. from reflex.vars.object import ObjectVar
  11. def on_error_spec(
  12. error: ObjectVar[Dict[str, str]], info: ObjectVar[Dict[str, str]]
  13. ) -> Tuple[Var[str], Var[str]]: ...
  14. class ErrorBoundary(Component):
  15. @overload
  16. @classmethod
  17. def create( # type: ignore
  18. cls,
  19. *children,
  20. fallback_render: Optional[Union[Component, Var[Component]]] = None,
  21. style: Optional[Style] = None,
  22. key: Optional[Any] = None,
  23. id: Optional[Any] = None,
  24. class_name: Optional[Any] = None,
  25. autofocus: Optional[bool] = None,
  26. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  27. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  28. on_click: Optional[EventType[[], BASE_STATE]] = None,
  29. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  30. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  31. on_error: Optional[
  32. Union[
  33. EventType[[], BASE_STATE],
  34. EventType[[str], BASE_STATE],
  35. EventType[[str, str], BASE_STATE],
  36. ]
  37. ] = None,
  38. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  39. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  40. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  41. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  42. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  43. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  44. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  45. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  46. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  47. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  48. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  49. **props,
  50. ) -> "ErrorBoundary":
  51. """Create an ErrorBoundary component.
  52. Args:
  53. *children: The children of the component.
  54. on_error: Fired when the boundary catches an error.
  55. fallback_render: Rendered instead of the children when an error is caught.
  56. style: The style of the component.
  57. key: A unique key for the component.
  58. id: The id for the component.
  59. class_name: The class name for the component.
  60. autofocus: Whether the component should take the focus once the page is loaded
  61. custom_attrs: custom attribute
  62. **props: The props of the component.
  63. Returns:
  64. The ErrorBoundary component.
  65. """
  66. ...
  67. error_boundary = ErrorBoundary.create