markdown.pyi 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. """Stub file for reflex/components/markdown/markdown.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from functools import lru_cache
  6. from typing import Any, Callable, Dict, Optional, Union, overload
  7. from reflex.components.component import Component
  8. from reflex.event import EventHandler, EventSpec
  9. from reflex.style import Style
  10. from reflex.utils.imports import ImportDict
  11. from reflex.vars import BaseVar, Var
  12. _CHILDREN = Var.create_safe("children", _var_is_local=False, _var_is_string=False)
  13. _PROPS = Var.create_safe("...props", _var_is_local=False, _var_is_string=False)
  14. _MOCK_ARG = Var.create_safe("", _var_is_string=False)
  15. _REMARK_MATH = Var.create_safe("remarkMath", _var_is_local=False, _var_is_string=False)
  16. _REMARK_GFM = Var.create_safe("remarkGfm", _var_is_local=False, _var_is_string=False)
  17. _REMARK_UNWRAP_IMAGES = Var.create_safe(
  18. "remarkUnwrapImages", _var_is_local=False, _var_is_string=False
  19. )
  20. _REMARK_PLUGINS = Var.create_safe([_REMARK_MATH, _REMARK_GFM, _REMARK_UNWRAP_IMAGES])
  21. _REHYPE_KATEX = Var.create_safe(
  22. "rehypeKatex", _var_is_local=False, _var_is_string=False
  23. )
  24. _REHYPE_RAW = Var.create_safe("rehypeRaw", _var_is_local=False, _var_is_string=False)
  25. _REHYPE_PLUGINS = Var.create_safe([_REHYPE_KATEX, _REHYPE_RAW])
  26. NO_PROPS_TAGS = ("ul", "ol", "li")
  27. @lru_cache
  28. def get_base_component_map() -> dict[str, Callable]: ...
  29. class Markdown(Component):
  30. @overload
  31. @classmethod
  32. def create( # type: ignore
  33. cls,
  34. *children,
  35. component_map: Optional[Dict[str, Any]] = None,
  36. component_map_hash: Optional[str] = None,
  37. style: Optional[Style] = None,
  38. key: Optional[Any] = None,
  39. id: Optional[Any] = None,
  40. class_name: Optional[Any] = None,
  41. autofocus: Optional[bool] = None,
  42. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  43. on_blur: Optional[
  44. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  45. ] = None,
  46. on_click: Optional[
  47. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  48. ] = None,
  49. on_context_menu: Optional[
  50. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  51. ] = None,
  52. on_double_click: Optional[
  53. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  54. ] = None,
  55. on_focus: Optional[
  56. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  57. ] = None,
  58. on_mount: Optional[
  59. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  60. ] = None,
  61. on_mouse_down: Optional[
  62. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  63. ] = None,
  64. on_mouse_enter: Optional[
  65. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  66. ] = None,
  67. on_mouse_leave: Optional[
  68. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  69. ] = None,
  70. on_mouse_move: Optional[
  71. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  72. ] = None,
  73. on_mouse_out: Optional[
  74. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  75. ] = None,
  76. on_mouse_over: Optional[
  77. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  78. ] = None,
  79. on_mouse_up: Optional[
  80. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  81. ] = None,
  82. on_scroll: Optional[
  83. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  84. ] = None,
  85. on_unmount: Optional[
  86. Union[EventHandler, EventSpec, list, Callable, BaseVar]
  87. ] = None,
  88. **props,
  89. ) -> "Markdown":
  90. """Create a markdown component.
  91. Args:
  92. *children: The children of the component.
  93. component_map: The component map from a tag to a lambda that creates a component.
  94. component_map_hash: The hash of the component map, generated at create() time.
  95. style: The style of the component.
  96. key: A unique key for the component.
  97. id: The id for the component.
  98. class_name: The class name for the component.
  99. autofocus: Whether the component should take the focus once the page is loaded
  100. custom_attrs: custom attribute
  101. **props: The properties of the component.
  102. Returns:
  103. The markdown component.
  104. """
  105. ...
  106. def add_imports(self) -> ImportDict | list[ImportDict]: ...
  107. def get_component(self, tag: str, **props) -> Component: ...
  108. def format_component(self, tag: str, **props) -> str: ...
  109. def format_component_map(self) -> dict[str, str]: ...