__init__.pyi 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. from . import immapp_cpp as immapp_cpp
  2. from .immapp_cpp import (
  3. clock_seconds as clock_seconds,
  4. default_node_editor_context as default_node_editor_context,
  5. em_size as em_size,
  6. em_to_vec2 as em_to_vec2,
  7. pixels_to_em as pixels_to_em,
  8. pixel_size_to_em as pixel_size_to_em,
  9. run as run,
  10. run_with_markdown as run_with_markdown,
  11. AddOnsParams as AddOnsParams,
  12. snippets as snippets,
  13. manual_render as manual_render,
  14. begin_plot_in_node_editor as begin_plot_in_node_editor,
  15. end_plot_in_node_editor as end_plot_in_node_editor,
  16. show_resizable_plot_in_node_editor as show_resizable_plot_in_node_editor,
  17. show_resizable_plot_in_node_editor_em as show_resizable_plot_in_node_editor_em,
  18. )
  19. from .immapp_utils import (
  20. static as static,
  21. run_anon_block as run_anon_block,
  22. add_static as add_static,
  23. add_static_values as add_static_values,
  24. )
  25. from .immapp_notebook import run_nb as run_nb
  26. from imgui_bundle.hello_imgui import (
  27. RunnerParams as RunnerParams,
  28. SimpleRunnerParams as SimpleRunnerParams,
  29. )
  30. # Re-export run_async with all its overloads from the implementation module
  31. # (Full type hints and docs are in run_async_overloads.py)
  32. from .run_async_overloads import run_async as run_async
  33. # Re-export nb module for notebook convenience API
  34. from . import nb as nb
  35. def render_markdown_doc_panel(doc: str, height_em: float = 20.0) -> None:
  36. """Render a markdown documentation panel with a light theme, inside a resizable child window.
  37. Useful for showing docstrings or documentation at the top of a demo.
  38. Args:
  39. doc: markdown string to render (will be unindented automatically)
  40. height_em: height of the panel in em units
  41. """
  42. ...
  43. def download_url_bytes(url: str) -> bytes:
  44. """Download data from a URL synchronously. Works on both desktop (urllib) and Pyodide (sync XMLHttpRequest).
  45. Returns the downloaded bytes, or empty bytes on failure.
  46. Args:
  47. url: the URL to download from
  48. """
  49. ...
  50. async def download_url_bytes_async(url: str) -> bytes:
  51. """Download data from a URL asynchronously.
  52. On Pyodide: uses pyfetch (non-blocking). On desktop: uses urllib in a thread.
  53. Returns the downloaded bytes, or empty bytes on failure.
  54. Usage:
  55. # In Pyodide (top-level await supported by runPythonAsync):
  56. data = await immapp.download_url_bytes_async(url)
  57. # On desktop:
  58. data = asyncio.run(immapp.download_url_bytes_async(url))
  59. Args:
  60. url: the URL to download from
  61. """
  62. ...