1
0

image.pyi 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. """Stub file for reflex/components/next/image.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Dict, Literal, Optional, Union, overload
  6. from reflex.event import BASE_STATE, EventType
  7. from reflex.style import Style
  8. from reflex.vars.base import Var
  9. from .base import NextComponent
  10. class Image(NextComponent):
  11. @overload
  12. @classmethod
  13. def create( # type: ignore
  14. cls,
  15. *children,
  16. width: Optional[Union[int, str]] = None,
  17. height: Optional[Union[int, str]] = None,
  18. src: Optional[Union[Any, Var[Any]]] = None,
  19. alt: Optional[Union[Var[str], str]] = None,
  20. loader: Optional[Union[Any, Var[Any]]] = None,
  21. fill: Optional[Union[Var[bool], bool]] = None,
  22. sizes: Optional[Union[Var[str], str]] = None,
  23. quality: Optional[Union[Var[int], int]] = None,
  24. priority: Optional[Union[Var[bool], bool]] = None,
  25. placeholder: Optional[Union[Var[str], str]] = None,
  26. loading: Optional[
  27. Union[Literal["eager", "lazy"], Var[Literal["eager", "lazy"]]]
  28. ] = None,
  29. blurDataURL: Optional[Union[Var[str], str]] = None,
  30. style: Optional[Style] = None,
  31. key: Optional[Any] = None,
  32. id: Optional[Any] = None,
  33. class_name: Optional[Any] = None,
  34. autofocus: Optional[bool] = None,
  35. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  36. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  37. on_click: Optional[EventType[[], BASE_STATE]] = None,
  38. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  39. on_double_click: Optional[EventType[[], BASE_STATE]] = None,
  40. on_error: Optional[EventType[[], BASE_STATE]] = None,
  41. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  42. on_load: Optional[EventType[[], BASE_STATE]] = None,
  43. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  44. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  45. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  46. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  47. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  48. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  49. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  50. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  51. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  52. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  53. **props,
  54. ) -> "Image":
  55. """Create an Image component from next/image.
  56. Args:
  57. *children: The children of the component.
  58. width: The width of the image.
  59. height: The height of the image.
  60. src: This can be either an absolute external URL, or an internal path
  61. alt: Used to describe the image for screen readers and search engines.
  62. loader: A custom function used to resolve image URLs.
  63. 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
  64. sizes: A string, similar to a media query, that provides information about how wide the image will be at different breakpoints.
  65. 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.
  66. priority: When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority.
  67. placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
  68. loading: The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
  69. 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".
  70. on_load: Fires when the image has loaded.
  71. on_error: Fires when the image has an error.
  72. style: The style of the component.
  73. key: A unique key for the component.
  74. id: The id for the component.
  75. class_name: The class name for the component.
  76. autofocus: Whether the component should take the focus once the page is loaded
  77. custom_attrs: custom attribute
  78. **props:The props of the component.
  79. Returns:
  80. _type_: _description_
  81. """
  82. ...