image.pyi 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. """Stub file for reflex/components/next/image.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. from typing import Any, Dict, Literal, Optional, Union
  10. from reflex.utils import types
  11. from reflex.vars import Var
  12. from .base import NextComponent
  13. class Image(NextComponent):
  14. def get_event_triggers(self) -> Dict[str, Any]: ...
  15. @overload
  16. @classmethod
  17. def create( # type: ignore
  18. cls,
  19. *children,
  20. width: Optional[Union[str, int]] = None,
  21. height: Optional[Union[str, int]] = None,
  22. src: Optional[Union[Var[Any], Any]] = None,
  23. alt: Optional[Union[Var[str], str]] = None,
  24. loader: Optional[Union[Var[Any], Any]] = None,
  25. fill: Optional[Union[Var[bool], bool]] = None,
  26. sizes: Optional[Union[Var[str], str]] = None,
  27. quality: Optional[Union[Var[int], int]] = None,
  28. priority: Optional[Union[Var[bool], bool]] = None,
  29. placeholder: Optional[Union[Var[str], str]] = None,
  30. loading: Optional[
  31. Union[Var[Literal["lazy", "eager"]], Literal["lazy", "eager"]]
  32. ] = None,
  33. blurDataURL: Optional[Union[Var[str], 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[
  41. Union[EventHandler, EventSpec, list, function, BaseVar]
  42. ] = None,
  43. on_click: Optional[
  44. Union[EventHandler, EventSpec, list, function, BaseVar]
  45. ] = None,
  46. on_context_menu: Optional[
  47. Union[EventHandler, EventSpec, list, function, BaseVar]
  48. ] = None,
  49. on_double_click: Optional[
  50. Union[EventHandler, EventSpec, list, function, BaseVar]
  51. ] = None,
  52. on_error: Optional[
  53. Union[EventHandler, EventSpec, list, function, BaseVar]
  54. ] = None,
  55. on_focus: Optional[
  56. Union[EventHandler, EventSpec, list, function, BaseVar]
  57. ] = None,
  58. on_load: Optional[
  59. Union[EventHandler, EventSpec, list, function, BaseVar]
  60. ] = None,
  61. on_mount: Optional[
  62. Union[EventHandler, EventSpec, list, function, BaseVar]
  63. ] = None,
  64. on_mouse_down: Optional[
  65. Union[EventHandler, EventSpec, list, function, BaseVar]
  66. ] = None,
  67. on_mouse_enter: Optional[
  68. Union[EventHandler, EventSpec, list, function, BaseVar]
  69. ] = None,
  70. on_mouse_leave: Optional[
  71. Union[EventHandler, EventSpec, list, function, BaseVar]
  72. ] = None,
  73. on_mouse_move: Optional[
  74. Union[EventHandler, EventSpec, list, function, BaseVar]
  75. ] = None,
  76. on_mouse_out: Optional[
  77. Union[EventHandler, EventSpec, list, function, BaseVar]
  78. ] = None,
  79. on_mouse_over: Optional[
  80. Union[EventHandler, EventSpec, list, function, BaseVar]
  81. ] = None,
  82. on_mouse_up: Optional[
  83. Union[EventHandler, EventSpec, list, function, BaseVar]
  84. ] = None,
  85. on_scroll: Optional[
  86. Union[EventHandler, EventSpec, list, function, BaseVar]
  87. ] = None,
  88. on_unmount: Optional[
  89. Union[EventHandler, EventSpec, list, function, BaseVar]
  90. ] = None,
  91. **props
  92. ) -> "Image":
  93. """Create an Image component from next/image.
  94. Args:
  95. *children: The children of the component.
  96. width: The width of the image.
  97. height: The height of the image.
  98. src: This can be either an absolute external URL, or an internal path
  99. alt: Used to describe the image for screen readers and search engines.
  100. loader: A custom function used to resolve image URLs.
  101. fill: A boolean that causes the image to fill the parent element, which is useful when the width and height are unknown. Default to True
  102. sizes: A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
  103. quality: The quality of the optimized image, an integer between 1 and 100, where 100 is the best quality and therefore largest file size. Defaults to 75.
  104. priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
  105. placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
  106. loading: Allows passing CSS styles to the underlying image element. style: Var[Any] The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
  107. blurDataURL: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
  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 props of the component.
  115. Returns:
  116. _type_: _description_
  117. """
  118. ...