markdown.pyi 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 BASE_STATE, EventType
  9. from reflex.style import Style
  10. from reflex.utils.imports import ImportDict
  11. from reflex.vars.base import LiteralVar, Var
  12. _CHILDREN = Var(_js_expr="children", _var_type=str)
  13. _PROPS = Var(_js_expr="...props")
  14. _PROPS_IN_TAG = Var(_js_expr="{...props}")
  15. _MOCK_ARG = Var(_js_expr="", _var_type=str)
  16. _REMARK_MATH = Var(_js_expr="remarkMath")
  17. _REMARK_GFM = Var(_js_expr="remarkGfm")
  18. _REMARK_UNWRAP_IMAGES = Var(_js_expr="remarkUnwrapImages")
  19. _REMARK_PLUGINS = LiteralVar.create([_REMARK_MATH, _REMARK_GFM, _REMARK_UNWRAP_IMAGES])
  20. _REHYPE_KATEX = Var(_js_expr="rehypeKatex")
  21. _REHYPE_RAW = Var(_js_expr="rehypeRaw")
  22. _REHYPE_PLUGINS = LiteralVar.create([_REHYPE_KATEX, _REHYPE_RAW])
  23. NO_PROPS_TAGS = ("ul", "ol", "li")
  24. @lru_cache
  25. def get_base_component_map() -> dict[str, Callable]: ...
  26. class Markdown(Component):
  27. @overload
  28. @classmethod
  29. def create( # type: ignore
  30. cls,
  31. *children,
  32. component_map: Optional[Dict[str, Any]] = None,
  33. component_map_hash: Optional[str] = None,
  34. style: Optional[Style] = None,
  35. key: Optional[Any] = None,
  36. id: Optional[Any] = None,
  37. class_name: Optional[Any] = None,
  38. autofocus: Optional[bool] = None,
  39. custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
  40. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  41. on_click: Optional[EventType[[], BASE_STATE]] = None,
  42. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  43. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  44. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  45. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  46. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  47. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  48. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  49. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  50. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  51. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  52. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  53. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  54. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  55. **props,
  56. ) -> "Markdown":
  57. """Create a markdown component.
  58. Args:
  59. *children: The children of the component.
  60. component_map: The component map from a tag to a lambda that creates a component.
  61. component_map_hash: The hash of the component map, generated at create() time.
  62. style: The style of the component.
  63. key: A unique key for the component.
  64. id: The id for the component.
  65. class_name: The class name for the component.
  66. autofocus: Whether the component should take the focus once the page is loaded
  67. custom_attrs: custom attribute
  68. **props: The properties of the component.
  69. Raises:
  70. ValueError: If the children are not valid.
  71. Returns:
  72. The markdown component.
  73. """
  74. ...
  75. def add_imports(self) -> ImportDict | list[ImportDict]: ...
  76. def get_component(self, tag: str, **props) -> Component: ...
  77. def format_component(self, tag: str, **props) -> str: ...
  78. def format_component_map(self) -> dict[str, Var]: ...