script.pyi 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. """Stub file for reflex/components/base/script.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.components.component import Component
  7. from reflex.event import EventType
  8. from reflex.style import Style
  9. from reflex.vars.base import Var
  10. class Script(Component):
  11. @overload
  12. @classmethod
  13. def create( # type: ignore
  14. cls,
  15. *children,
  16. src: Optional[Union[Var[str], str]] = None,
  17. strategy: Optional[
  18. Union[
  19. Literal["afterInteractive", "beforeInteractive", "lazyOnload"],
  20. Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]],
  21. ]
  22. ] = None,
  23. style: Optional[Style] = None,
  24. key: Optional[Any] = None,
  25. id: Optional[Any] = None,
  26. class_name: Optional[Any] = None,
  27. autofocus: Optional[bool] = None,
  28. custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
  29. on_blur: Optional[EventType[()]] = None,
  30. on_click: Optional[EventType[()]] = None,
  31. on_context_menu: Optional[EventType[()]] = None,
  32. on_double_click: Optional[EventType[()]] = None,
  33. on_error: Optional[EventType[()]] = None,
  34. on_focus: Optional[EventType[()]] = None,
  35. on_load: Optional[EventType[()]] = None,
  36. on_mount: Optional[EventType[()]] = None,
  37. on_mouse_down: Optional[EventType[()]] = None,
  38. on_mouse_enter: Optional[EventType[()]] = None,
  39. on_mouse_leave: Optional[EventType[()]] = None,
  40. on_mouse_move: Optional[EventType[()]] = None,
  41. on_mouse_out: Optional[EventType[()]] = None,
  42. on_mouse_over: Optional[EventType[()]] = None,
  43. on_mouse_up: Optional[EventType[()]] = None,
  44. on_ready: Optional[EventType[()]] = None,
  45. on_scroll: Optional[EventType[()]] = None,
  46. on_unmount: Optional[EventType[()]] = None,
  47. **props,
  48. ) -> "Script":
  49. """Create an inline or user-defined script.
  50. If a string is provided as the first child, it will be rendered as an inline script
  51. otherwise the `src` prop must be provided.
  52. The following event triggers are provided:
  53. on_load: Execute code after the script has finished loading.
  54. on_ready: Execute code after the script has finished loading and every
  55. time the component is mounted.
  56. on_error: Execute code if the script fails to load.
  57. Args:
  58. *children: The children of the component.
  59. src: Required unless inline script is used
  60. strategy: When the script will execute: afterInteractive (defer-like behavior) | beforeInteractive | lazyOnload (async-like behavior)
  61. on_load: Triggered when the script is loading
  62. on_ready: Triggered when the script has loaded
  63. on_error: Triggered when the script has errored
  64. style: The style of the component.
  65. key: A unique key for the component.
  66. id: The id for the component.
  67. class_name: The class name for the component.
  68. autofocus: Whether the component should take the focus once the page is loaded
  69. custom_attrs: custom attribute
  70. **props: The props of the component.
  71. Returns:
  72. The component.
  73. Raises:
  74. ValueError: when neither children nor `src` are specified.
  75. """
  76. ...
  77. script = Script.create