markdown.pyi 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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.ivars.base import ImmutableVar, LiteralVar
  10. from reflex.style import Style
  11. from reflex.utils.imports import ImportDict
  12. from reflex.vars import Var
  13. _CHILDREN = ImmutableVar.create_safe("children")
  14. _PROPS = ImmutableVar.create_safe("...props")
  15. _MOCK_ARG = ImmutableVar.create_safe("")
  16. _REMARK_MATH = ImmutableVar.create_safe("remarkMath")
  17. _REMARK_GFM = ImmutableVar.create_safe("remarkGfm")
  18. _REMARK_UNWRAP_IMAGES = ImmutableVar.create_safe("remarkUnwrapImages")
  19. _REMARK_PLUGINS = LiteralVar.create([_REMARK_MATH, _REMARK_GFM, _REMARK_UNWRAP_IMAGES])
  20. _REHYPE_KATEX = ImmutableVar.create_safe("rehypeKatex")
  21. _REHYPE_RAW = ImmutableVar.create_safe("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[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  41. on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  42. on_context_menu: Optional[
  43. Union[EventHandler, EventSpec, list, Callable, Var]
  44. ] = None,
  45. on_double_click: Optional[
  46. Union[EventHandler, EventSpec, list, Callable, Var]
  47. ] = None,
  48. on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  49. on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  50. on_mouse_down: Optional[
  51. Union[EventHandler, EventSpec, list, Callable, Var]
  52. ] = None,
  53. on_mouse_enter: Optional[
  54. Union[EventHandler, EventSpec, list, Callable, Var]
  55. ] = None,
  56. on_mouse_leave: Optional[
  57. Union[EventHandler, EventSpec, list, Callable, Var]
  58. ] = None,
  59. on_mouse_move: Optional[
  60. Union[EventHandler, EventSpec, list, Callable, Var]
  61. ] = None,
  62. on_mouse_out: Optional[
  63. Union[EventHandler, EventSpec, list, Callable, Var]
  64. ] = None,
  65. on_mouse_over: Optional[
  66. Union[EventHandler, EventSpec, list, Callable, Var]
  67. ] = None,
  68. on_mouse_up: Optional[
  69. Union[EventHandler, EventSpec, list, Callable, Var]
  70. ] = None,
  71. on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
  72. on_unmount: Optional[
  73. Union[EventHandler, EventSpec, list, Callable, Var]
  74. ] = None,
  75. **props,
  76. ) -> "Markdown":
  77. """Create a markdown component.
  78. Args:
  79. *children: The children of the component.
  80. component_map: The component map from a tag to a lambda that creates a component.
  81. component_map_hash: The hash of the component map, generated at create() time.
  82. style: The style of the component.
  83. key: A unique key for the component.
  84. id: The id for the component.
  85. class_name: The class name for the component.
  86. autofocus: Whether the component should take the focus once the page is loaded
  87. custom_attrs: custom attribute
  88. **props: The properties of the component.
  89. Returns:
  90. The markdown component.
  91. """
  92. ...
  93. def add_imports(self) -> ImportDict | list[ImportDict]: ...
  94. def get_component(self, tag: str, **props) -> Component: ...
  95. def format_component(self, tag: str, **props) -> str: ...
  96. def format_component_map(self) -> dict[str, str]: ...