markdown.pyi 5.1 KB

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