@anvil-works/anvil-pyright 0.0.1 → 0.0.2-canary

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/anvil-typeshed/TODOS.md +70 -0
  2. package/dist/anvil-typeshed/client/anvil/__init__.pyi +1291 -0
  3. package/dist/anvil-typeshed/client/anvil/__pycache__/server.cpython-39.pyc +0 -0
  4. package/dist/anvil-typeshed/client/anvil/email.pyi +152 -0
  5. package/dist/anvil-typeshed/client/anvil/facebook/__init__.pyi +8 -0
  6. package/dist/anvil-typeshed/client/anvil/facebook/auth.pyi +30 -0
  7. package/dist/anvil-typeshed/client/anvil/google/__init__.pyi +11 -0
  8. package/dist/anvil-typeshed/client/anvil/google/auth.pyi +37 -0
  9. package/dist/anvil-typeshed/client/anvil/google/drive.pyi +98 -0
  10. package/dist/anvil-typeshed/client/anvil/google/sheets.pyi +98 -0
  11. package/dist/anvil-typeshed/client/anvil/http.pyi +66 -0
  12. package/dist/anvil-typeshed/client/anvil/image.pyi +30 -0
  13. package/dist/anvil-typeshed/client/anvil/js/__init__.pyi +143 -0
  14. package/dist/anvil-typeshed/client/anvil/js/window/__init__.pyi +2935 -0
  15. package/dist/anvil-typeshed/client/anvil/media.pyi +46 -0
  16. package/dist/anvil-typeshed/client/anvil/microsoft/__init__.pyi +8 -0
  17. package/dist/anvil-typeshed/client/anvil/microsoft/auth.pyi +34 -0
  18. package/dist/anvil-typeshed/client/anvil/mpl_util.pyi +29 -0
  19. package/dist/anvil-typeshed/client/anvil/plotly_templates.pyi +15 -0
  20. package/dist/anvil-typeshed/client/anvil/saml/__init__.pyi +8 -0
  21. package/dist/anvil-typeshed/client/anvil/saml/auth.pyi +24 -0
  22. package/dist/anvil-typeshed/client/anvil/secrets.pyi +22 -0
  23. package/dist/anvil-typeshed/client/anvil/server.pyi +376 -0
  24. package/dist/anvil-typeshed/client/anvil/stripe.pyi +23 -0
  25. package/dist/anvil-typeshed/client/anvil/tables/__init__.pyi +297 -0
  26. package/dist/anvil-typeshed/client/anvil/tables/query.pyi +88 -0
  27. package/dist/anvil-typeshed/client/anvil/tz.pyi +92 -0
  28. package/dist/anvil-typeshed/client/anvil/users/__init__.pyi +191 -0
  29. package/dist/anvil-typeshed/client/anvil/users/mfa.pyi +76 -0
  30. package/dist/anvil-typeshed/client/stripe/__init__.pyi +8 -0
  31. package/dist/anvil-typeshed/client/stripe/checkout.pyi +67 -0
  32. package/dist/anvil-typeshed/server/anvil/__init__.pyi +148 -0
  33. package/dist/anvil-typeshed/server/anvil/email.pyi +188 -0
  34. package/dist/anvil-typeshed/server/anvil/facebook/__init__.pyi +8 -0
  35. package/dist/anvil-typeshed/server/anvil/facebook/auth.pyi +27 -0
  36. package/dist/anvil-typeshed/server/anvil/files.pyi +53 -0
  37. package/dist/anvil-typeshed/server/anvil/google/__init__.pyi +11 -0
  38. package/dist/anvil-typeshed/server/anvil/google/auth.pyi +31 -0
  39. package/dist/anvil-typeshed/server/anvil/google/drive.pyi +98 -0
  40. package/dist/anvil-typeshed/server/anvil/google/mail.pyi +24 -0
  41. package/dist/anvil-typeshed/server/anvil/google/sheets.pyi +98 -0
  42. package/dist/anvil-typeshed/server/anvil/http.pyi +66 -0
  43. package/dist/anvil-typeshed/server/anvil/image.pyi +30 -0
  44. package/dist/anvil-typeshed/server/anvil/media.pyi +32 -0
  45. package/dist/anvil-typeshed/server/anvil/microsoft/__init__.pyi +8 -0
  46. package/dist/anvil-typeshed/server/anvil/microsoft/auth.pyi +31 -0
  47. package/dist/anvil-typeshed/server/anvil/mpl_util.pyi +29 -0
  48. package/dist/anvil-typeshed/server/anvil/pdf.pyi +61 -0
  49. package/dist/anvil-typeshed/server/anvil/plotly_templates.pyi +15 -0
  50. package/dist/anvil-typeshed/server/anvil/saml/__init__.pyi +8 -0
  51. package/dist/anvil-typeshed/server/anvil/saml/auth.pyi +21 -0
  52. package/dist/anvil-typeshed/server/anvil/secrets.pyi +22 -0
  53. package/dist/anvil-typeshed/server/anvil/server.pyi +470 -0
  54. package/dist/anvil-typeshed/server/anvil/stripe.pyi +23 -0
  55. package/dist/anvil-typeshed/server/anvil/tables/__init__.pyi +319 -0
  56. package/dist/anvil-typeshed/server/anvil/tables/query.pyi +88 -0
  57. package/dist/anvil-typeshed/server/anvil/tz.pyi +92 -0
  58. package/dist/anvil-typeshed/server/anvil/users/__init__.pyi +83 -0
  59. package/dist/anvil-typeshed/server/anvil/users/mfa.pyi +65 -0
  60. package/dist/anvil-typeshed/server/stripe/__init__.pyi +8 -0
  61. package/dist/anvil-typeshed/server/stripe/checkout.pyi +9 -0
  62. package/dist/anvil-typeshed/source/anvil/__init__.pyi +1306 -0
  63. package/dist/anvil-typeshed/source/anvil/email.pyi +188 -0
  64. package/dist/anvil-typeshed/source/anvil/facebook/__init__.pyi +4 -0
  65. package/dist/anvil-typeshed/source/anvil/facebook/auth.pyi +28 -0
  66. package/dist/anvil-typeshed/source/anvil/files.pyi +50 -0
  67. package/dist/anvil-typeshed/source/anvil/google/__init__.pyi +7 -0
  68. package/dist/anvil-typeshed/source/anvil/google/auth.pyi +35 -0
  69. package/dist/anvil-typeshed/source/anvil/google/drive.pyi +94 -0
  70. package/dist/anvil-typeshed/source/anvil/google/mail.pyi +21 -0
  71. package/dist/anvil-typeshed/source/anvil/google/sheets.pyi +94 -0
  72. package/dist/anvil-typeshed/source/anvil/http.pyi +62 -0
  73. package/dist/anvil-typeshed/source/anvil/image.pyi +26 -0
  74. package/dist/anvil-typeshed/source/anvil/js/__init__.pyi +140 -0
  75. package/dist/anvil-typeshed/source/anvil/js/window/__init__.pyi +2932 -0
  76. package/dist/anvil-typeshed/source/anvil/media.pyi +62 -0
  77. package/dist/anvil-typeshed/source/anvil/microsoft/__init__.pyi +4 -0
  78. package/dist/anvil-typeshed/source/anvil/microsoft/auth.pyi +32 -0
  79. package/dist/anvil-typeshed/source/anvil/mpl_util.pyi +25 -0
  80. package/dist/anvil-typeshed/source/anvil/pdf.pyi +58 -0
  81. package/dist/anvil-typeshed/source/anvil/plotly_templates.pyi +11 -0
  82. package/dist/anvil-typeshed/source/anvil/saml/__init__.pyi +4 -0
  83. package/dist/anvil-typeshed/source/anvil/saml/auth.pyi +22 -0
  84. package/dist/anvil-typeshed/source/anvil/secrets.pyi +18 -0
  85. package/dist/anvil-typeshed/source/anvil/server.pyi +511 -0
  86. package/dist/anvil-typeshed/source/anvil/stripe.pyi +19 -0
  87. package/dist/anvil-typeshed/source/anvil/tables/__init__.pyi +319 -0
  88. package/dist/anvil-typeshed/source/anvil/tables/query.pyi +84 -0
  89. package/dist/anvil-typeshed/source/anvil/tz.pyi +88 -0
  90. package/dist/anvil-typeshed/source/anvil/users/__init__.pyi +196 -0
  91. package/dist/anvil-typeshed/source/anvil/users/mfa.pyi +74 -0
  92. package/dist/anvil-typeshed/source/stripe/__init__.pyi +4 -0
  93. package/dist/anvil-typeshed/source/stripe/checkout.pyi +65 -0
  94. package/dist/pyright-langserver.js +1 -1
  95. package/dist/pyright-langserver.js.map +1 -1
  96. package/dist/pyright.js +1 -1
  97. package/dist/pyright.js.map +1 -1
  98. package/package.json +1 -1
@@ -0,0 +1,1291 @@
1
+ # AUTO-GENERATED FILE - DO NOT EDIT
2
+ # Edit the source file in anvil-typeshed/source/ instead, then run:
3
+ # npm run generate-anvil-stubs
4
+ #
5
+ # Type stubs for Anvil
6
+ # Generated files: client/anvil/__init__.pyi, server/anvil/__init__.pyi
7
+
8
+ from typing import Any, Callable, TypeVar, overload, Iterator, Mapping, Literal
9
+
10
+ _T = TypeVar("_T")
11
+ _F = TypeVar("_F", bound=Callable[..., Any])
12
+
13
+ # ============================================================================
14
+ # Media Classes
15
+ # ============================================================================
16
+
17
+ class Media:
18
+ """A Media object represents binary data, such as a file.
19
+
20
+ [Anvil Docs](https://anvil.works/docs/media)"""
21
+
22
+ content_type: str
23
+ """The MIME type of this Media."""
24
+
25
+ name: str | None
26
+ """The file name associated with this Media, or None if it has no name."""
27
+
28
+ url: str | None
29
+ """The URL where you can download this Media, or None if it is not downloadable."""
30
+
31
+ length: int
32
+ """The length of this Media, in bytes."""
33
+
34
+ def get_bytes(self) -> bytes:
35
+ """Get a binary string of the data represented by this Media object.
36
+
37
+ [Anvil Docs](https://anvil.works/docs/media)"""
38
+ ...
39
+
40
+ def get_url(self) -> str | None:
41
+ """Get a Media object's URL, or None if there isn't one associated with it.
42
+
43
+ [Anvil Docs](https://anvil.works/docs/media)"""
44
+ ...
45
+
46
+
47
+ class BlobMedia(Media):
48
+ """Create a Media object with the specified content_type and content.
49
+
50
+ Optionally specify a filename as well.
51
+
52
+ [Anvil Docs](https://anvil.works/docs/media)"""
53
+
54
+ def __init__(self, content_type: str, content: bytes, *, name: str | None = None) -> None: ...
55
+
56
+
57
+ class URLMedia(Media):
58
+ """Create a Media object representing the data at a specific URL.
59
+
60
+ Caution: Getting data from URLs directly in your code will often fail
61
+ for security reasons, or fail to handle binary data.
62
+
63
+ [Anvil Docs](https://anvil.works/docs/media)"""
64
+
65
+ def __init__(self, url: str, /) -> None: ...
66
+
67
+
68
+ # ============================================================================
69
+ # App Information
70
+ # ============================================================================
71
+
72
+ class AppEnvironment:
73
+ """Information about the current app environment."""
74
+
75
+ name: str
76
+ """The name of the current environment."""
77
+
78
+ tags: list[str]
79
+ """Tags associated with the current environment."""
80
+
81
+
82
+ class AppInfo:
83
+ """Information about the current app.
84
+
85
+ [Anvil Docs](https://anvil.works/docs/deployment/environment-variables)"""
86
+
87
+ id: str
88
+ """A unique identifier for the current app."""
89
+
90
+ branch: str
91
+ """The Git branch from which the current app is being run.
92
+
93
+ This is 'master' for development apps or apps without a published version,
94
+ and 'published' if this app is being run from its published version."""
95
+
96
+ package_name: str
97
+ """The package name of this app."""
98
+
99
+ environment: AppEnvironment
100
+ """The environment in which the current app is being run."""
101
+
102
+ theme_colors: Mapping[str, str]
103
+ """Theme colors for this app as a readonly dict."""
104
+
105
+ def get_asset(self, path: str | None = None) -> Media:
106
+ """Get an asset file from the app's theme assets."""
107
+ ...
108
+
109
+ def get_client_config(self, package_name: str | None = None) -> dict[str, Any]:
110
+ """Get the client config for the specified package.
111
+
112
+ If no package name is specified, the client config for the current app is returned."""
113
+ ...
114
+
115
+ def get_server_config(self, package_name: str | None = None) -> dict[str, Any]:
116
+ """Get the server config for the specified package.
117
+
118
+ If no package name is specified, the server config for the current app is returned."""
119
+ ...
120
+
121
+
122
+ app: AppInfo
123
+ """Information about the current app, as an instance of AppInfo."""
124
+
125
+
126
+ # ============================================================================
127
+ # Utility Functions
128
+ # ============================================================================
129
+
130
+ def is_server_side() -> bool:
131
+ """Check whether Anvil is running server side or not."""
132
+ ...
133
+
134
+
135
+ # ============================================================================
136
+ # Alert and Notification Functions (client-only)
137
+ # ============================================================================
138
+
139
+ def alert(
140
+ content: str | Any,
141
+ *,
142
+ title: str = "",
143
+ buttons: list[Any] | None = None,
144
+ large: bool = False,
145
+ dismissible: bool = True,
146
+ role: str | None = None,
147
+ ) -> Any:
148
+ """Pop up an alert box.
149
+
150
+ By default, it will have a single "OK" button which will return True when clicked.
151
+
152
+ [Anvil Docs](https://anvil.works/docs/client/python/alerts-and-notifications)"""
153
+ ...
154
+
155
+
156
+ def confirm(
157
+ content: str | Any,
158
+ *,
159
+ title: str = "",
160
+ buttons: list[Any] | None = None,
161
+ large: bool = False,
162
+ dismissible: bool = False,
163
+ role: str | None = None,
164
+ ) -> bool:
165
+ """Pop up a confirmation box.
166
+
167
+ By default, it will have "Yes" and "No" buttons which will return True and False
168
+ respectively when clicked.
169
+
170
+ [Anvil Docs](https://anvil.works/docs/client/python/alerts-and-notifications)"""
171
+ ...
172
+
173
+
174
+ class Notification:
175
+ """Create a popup notification. Call the show() method to display it.
176
+
177
+ Can also be used as a context manager.
178
+
179
+ [Anvil Docs](https://anvil.works/docs/client/python/alerts-and-notifications)"""
180
+
181
+ def __init__(
182
+ self,
183
+ message: str,
184
+ *,
185
+ title: str = "",
186
+ style: str = "info",
187
+ timeout: int | float = 2,
188
+ ) -> None: ...
189
+
190
+ def show(self) -> "Notification":
191
+ """Shows the notification."""
192
+ ...
193
+
194
+ def hide(self) -> None:
195
+ """Hides the notification immediately."""
196
+ ...
197
+
198
+ def __enter__(self) -> "Notification":
199
+ """Show the notification when entering a 'with' block."""
200
+ ...
201
+
202
+ def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None:
203
+ """Hide the notification when exiting a 'with' block."""
204
+ ...
205
+
206
+
207
+ # ============================================================================
208
+ # Navigation Functions (client-only)
209
+ # ============================================================================
210
+
211
+ def get_open_form() -> Any:
212
+ """Returns the form most recently opened with open_form().
213
+
214
+ [Anvil Docs](https://anvil.works/docs/client/python/forms-and-components)"""
215
+ ...
216
+
217
+
218
+ def open_form(form: str | Any, *args: Any, **kwargs: Any) -> None:
219
+ """Open the specified form as a new page.
220
+
221
+ If 'form' is a string, a new form will be created (extra arguments will be passed
222
+ to its constructor). If 'form' is a Form object, it will be opened directly.
223
+
224
+ [Anvil Docs](https://anvil.works/docs/client/python/forms-and-components)"""
225
+ ...
226
+
227
+
228
+ def get_url_hash() -> str | dict[str, str]:
229
+ """Get the decoded hash (the part after the '#' character) of the URL used to open this app.
230
+
231
+ If the first character of the hash is a question mark (eg '#?a=foo&b=bar'),
232
+ it will be interpreted as query-string-type parameters and returned as a dictionary
233
+ (eg {'a': 'foo', 'b': 'bar'}).
234
+
235
+ [Anvil Docs](https://anvil.works/docs/client/python/navigation-and-urls)"""
236
+ ...
237
+
238
+
239
+ def set_url_hash(val: str | dict[str, str], /) -> None:
240
+ """Sets the hash of the currently open URL.
241
+
242
+ If val is a string, it is added to the URL after a #.
243
+ If val is a dictionary, it will be interpreted as query-string-type parameters
244
+ and added to the URL after a hash and question mark (eg '#?a=foo&b=bar').
245
+
246
+ [Anvil Docs](https://anvil.works/docs/client/python/navigation-and-urls)"""
247
+ ...
248
+
249
+
250
+ # ============================================================================
251
+ # Other Client-Only Functions
252
+ # ============================================================================
253
+
254
+ def download(media: Media, /) -> None:
255
+ """Download the given Media Object immediately in the user's browser.
256
+
257
+ [Anvil Docs](https://anvil.works/docs/media)"""
258
+ ...
259
+
260
+
261
+ def get_focused_component() -> "Component | None":
262
+ """Get the currently focused Anvil component, or None if focus is not in a component."""
263
+ ...
264
+
265
+
266
+ def set_default_error_handling(handler_fn: Callable[[Exception], None] | None, /) -> None:
267
+ """Set a function to be called when an uncaught exception occurs.
268
+
269
+ If set to None, a pop-up will appear letting the user know that an error has occurred."""
270
+ ...
271
+
272
+
273
+ # ============================================================================
274
+ # Decorators
275
+ # ============================================================================
276
+
277
+ def handle(component_name: str, event_name: str, /) -> Callable[[_F], _F]:
278
+ """When applied to a form method as a decorator, sets the decorated method
279
+ as an event handler for the specified component event."""
280
+ ...
281
+
282
+
283
+ # ============================================================================
284
+ # Slot and Layout Classes (client-only)
285
+ # ============================================================================
286
+
287
+ class Slot:
288
+ """A Slot class represents a way to add components to an underlying container.
289
+
290
+ You will rarely instantiate a Slot on its own; instead your form's layout
291
+ will contain Slots to which you can add components."""
292
+
293
+ def __init__(
294
+ self,
295
+ target_container: "Container",
296
+ insertion_index: int,
297
+ layout_properties: dict[str, Any] | None = None,
298
+ ) -> None:
299
+ """Create a new Slot.
300
+
301
+ Args:
302
+ target_container: The target container into which components added to this slot will be added.
303
+ insertion_index: The starting index (within the target container) at which components
304
+ added to this slot will be inserted.
305
+ layout_properties: A dictionary of layout properties that will be passed as keyword
306
+ arguments to the target container's add_component() call.
307
+ """
308
+ ...
309
+
310
+ def add_component(
311
+ self,
312
+ component: "Component",
313
+ *,
314
+ index: int | None = None,
315
+ **layout_properties: Any,
316
+ ) -> None:
317
+ """Add a component to this slot.
318
+
319
+ Calling add_component() on a Slot will add the specified component to its target container.
320
+
321
+ Args:
322
+ component: The component to add to this slot.
323
+ index: The index, within the slot, at which the component is to be inserted.
324
+ **layout_properties: Layout properties will be passed on as keyword arguments
325
+ to the target container's add_component() method.
326
+ """
327
+ ...
328
+
329
+ def offset_by_slot(self, offset_by_slot: "Slot") -> None:
330
+ """Inform this Slot of an earlier Slot with the same target container.
331
+
332
+ Future calls to add_component() will take account of any components inserted
333
+ into the earlier slot when calculating the insertion index for the target container."""
334
+ ...
335
+
336
+
337
+ class WithLayout(Component):
338
+ """Parent class of any form with a layout."""
339
+
340
+ layout: "Component"
341
+ """This form's layout."""
342
+
343
+
344
+ # ============================================================================
345
+ # JavaScript Interop (client-only)
346
+ # ============================================================================
347
+
348
+ class _JS:
349
+ """JavaScript interop.
350
+
351
+ [Anvil Docs](https://anvil.works/docs/client/javascript)"""
352
+
353
+ @staticmethod
354
+ def call(fn_name: str, *args: Any) -> Any: ...
355
+
356
+
357
+ js: _JS
358
+
359
+
360
+ # ============================================================================
361
+ # Event Type Aliases for Autocomplete
362
+ # ============================================================================
363
+
364
+ # Base Component events - inherited by all components
365
+ _ComponentEvents = Literal["show", "hide"]
366
+
367
+ # Button and Link events
368
+ _ButtonEvents = Literal["show", "hide", "click"]
369
+ _LinkEvents = Literal["show", "hide", "click"]
370
+
371
+ # Text input events
372
+ _TextBoxEvents = Literal["show", "hide", "change", "pressed_enter", "lost_focus", "focus"]
373
+ _TextAreaEvents = Literal["show", "hide", "change", "pressed_enter", "lost_focus", "focus"]
374
+
375
+ # Selection component events
376
+ _CheckBoxEvents = Literal["show", "hide", "change"]
377
+ _RadioButtonEvents = Literal["show", "hide", "change", "clicked"]
378
+ _DropDownEvents = Literal["show", "hide", "change"]
379
+ _DatePickerEvents = Literal["show", "hide", "change"]
380
+ _FileLoaderEvents = Literal["show", "hide", "change"]
381
+
382
+ # Timer events
383
+ _TimerEvents = Literal["show", "hide", "tick"]
384
+
385
+ # Mouse-enabled component events
386
+ _CanvasEvents = Literal["show", "hide", "mouse_down", "mouse_up", "mouse_move", "mouse_enter", "mouse_leave"]
387
+ _ImageEvents = Literal["show", "hide", "mouse_down", "mouse_up", "mouse_move", "mouse_enter", "mouse_leave"]
388
+
389
+ # Plot events
390
+ _PlotEvents = Literal["show", "hide", "click", "double_click", "hover", "unhover", "select", "deselect"]
391
+
392
+ # GoogleMap events
393
+ _GoogleMapEvents = Literal["show", "hide", "bounds_changed", "click", "zoom_changed"]
394
+
395
+ # YouTubeVideo events
396
+ _YouTubeVideoEvents = Literal["show", "hide", "state_change"]
397
+
398
+ # DataGrid events
399
+ _DataGridEvents = Literal["show", "hide", "pagination_click"]
400
+
401
+ # Tabs events
402
+ _TabsEvents = Literal["show", "hide", "tab_click"]
403
+
404
+
405
+ # ============================================================================
406
+ # Component Base Classes
407
+ # ============================================================================
408
+
409
+ class Component:
410
+ """Base class for all Anvil components.
411
+
412
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
413
+
414
+ visible: bool
415
+ enabled: bool
416
+ tooltip: str
417
+ tag: Any
418
+ parent: "Container | None"
419
+ role: str | None
420
+
421
+ def add_event_handler(self, event_name: _ComponentEvents | str, handler_func: Callable[..., Any], /) -> None:
422
+ """Add an event handler function to be called when the event happens on this component.
423
+
424
+ Event handlers will be called in the order they are added. Adding the same event
425
+ handler multiple times will mean it gets called multiple times.
426
+
427
+ [Anvil Docs](https://anvil.works/docs/client/python/events)"""
428
+ ...
429
+
430
+ def remove_event_handler(self, event_name: _ComponentEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None:
431
+ """Remove a specific event handler function for a given event.
432
+
433
+ Calling remove_event_handler with just the event name will remove all the handlers for this event.
434
+
435
+ [Anvil Docs](https://anvil.works/docs/client/python/events)"""
436
+ ...
437
+
438
+ def set_event_handler(self, event_name: _ComponentEvents | str, handler_func: Callable[..., Any] | None, /) -> None:
439
+ """Set a function to call when the 'event_name' event happens on this component.
440
+
441
+ Using set_event_handler removes all other handlers.
442
+ Setting the handler function to None removes all handlers.
443
+
444
+ [Anvil Docs](https://anvil.works/docs/client/python/events)"""
445
+ ...
446
+
447
+ def get_event_handlers(self, event_name: _ComponentEvents | str, /) -> tuple[Callable[..., Any], ...]:
448
+ """Get the list of event handler functions for a given event.
449
+
450
+ [Anvil Docs](https://anvil.works/docs/client/python/events)"""
451
+ ...
452
+
453
+ def raise_event(self, event_name: _ComponentEvents | str, /, **event_args: Any) -> None:
454
+ """Raise an event on this component.
455
+
456
+ [Anvil Docs](https://anvil.works/docs/client/python/events)"""
457
+ ...
458
+
459
+ def scroll_into_view(self, *, smooth: bool = False, align: str = "center") -> None:
460
+ """Scroll this component into view.
461
+
462
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
463
+ ...
464
+
465
+
466
+ class Container(Component):
467
+ """Base class for container components.
468
+
469
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
470
+
471
+ def add_component(self, component: Component, /, **layout_props: Any) -> None:
472
+ """Add a component to this container.
473
+
474
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
475
+ ...
476
+
477
+ def remove_from_parent(self) -> None:
478
+ """Remove this container from its parent.
479
+
480
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
481
+ ...
482
+
483
+ def clear(self) -> None:
484
+ """Remove all components from this container.
485
+
486
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
487
+ ...
488
+
489
+ def get_components(self) -> list[Component]:
490
+ """Get a list of components in this container.
491
+
492
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
493
+ ...
494
+
495
+ def raise_event_on_children(self, event_name: str, /, **event_args: Any) -> None:
496
+ """Trigger the 'event_name' event on all children of this component.
497
+
498
+ Any keyword arguments are passed to the handler function.
499
+
500
+ [Anvil Docs](https://anvil.works/docs/client/components)"""
501
+ ...
502
+
503
+
504
+ # ============================================================================
505
+ # Basic Display Components
506
+ # ============================================================================
507
+
508
+ class Label(Component):
509
+ """A label for displaying text.
510
+
511
+ [Anvil Docs](https://anvil.works/docs/client/components/label)"""
512
+
513
+ text: str
514
+ icon: str
515
+ icon_align: str
516
+ font_size: int | None
517
+ font: str
518
+ bold: bool
519
+ italic: bool
520
+ underline: bool
521
+ foreground: str
522
+ background: str
523
+ border: str
524
+ align: str
525
+ spacing_above: str
526
+ spacing_below: str
527
+
528
+
529
+ class Link(Component):
530
+ """A clickable link component.
531
+
532
+ [Anvil Docs](https://anvil.works/docs/client/components/link)"""
533
+
534
+ text: str
535
+ url: str
536
+ icon: str
537
+ icon_align: str
538
+ font_size: int | None
539
+ font: str
540
+ bold: bool
541
+ italic: bool
542
+ underline: bool
543
+ foreground: str
544
+ background: str
545
+ border: str
546
+ align: str
547
+
548
+ def add_event_handler(self, event_name: _LinkEvents | str, handler_func: Callable[..., Any], /) -> None: ...
549
+ def remove_event_handler(self, event_name: _LinkEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
550
+ def set_event_handler(self, event_name: _LinkEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
551
+ def raise_event(self, event_name: _LinkEvents | str, /, **event_args: Any) -> None: ...
552
+
553
+
554
+ class Image(Component):
555
+ """An image display component.
556
+
557
+ [Anvil Docs](https://anvil.works/docs/client/components/image)"""
558
+
559
+ source: str | Media
560
+ display_mode: str
561
+ horizontal_align: str
562
+ vertical_align: str
563
+ height: str
564
+
565
+ def add_event_handler(self, event_name: _ImageEvents | str, handler_func: Callable[..., Any], /) -> None: ...
566
+ def remove_event_handler(self, event_name: _ImageEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
567
+ def set_event_handler(self, event_name: _ImageEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
568
+ def raise_event(self, event_name: _ImageEvents | str, /, **event_args: Any) -> None: ...
569
+
570
+
571
+ class Spacer(Component):
572
+ """A spacer component for layout.
573
+
574
+ [Anvil Docs](https://anvil.works/docs/client/components/spacer)"""
575
+
576
+ height: int
577
+
578
+
579
+ class RichText(Component):
580
+ """A rich text display component.
581
+
582
+ [Anvil Docs](https://anvil.works/docs/client/components/richtext)"""
583
+
584
+ content: str
585
+ format: str
586
+ data: dict[str, Any]
587
+
588
+
589
+ # ============================================================================
590
+ # Input Components
591
+ # ============================================================================
592
+
593
+ class Button(Component):
594
+ """A clickable button component.
595
+
596
+ [Anvil Docs](https://anvil.works/docs/client/components/button)"""
597
+
598
+ text: str
599
+ icon: str
600
+ icon_align: str
601
+ font_size: int | None
602
+ font: str
603
+ bold: bool
604
+ italic: bool
605
+ underline: bool
606
+ foreground: str
607
+ background: str
608
+ border: str
609
+ align: str
610
+
611
+ def add_event_handler(self, event_name: _ButtonEvents | str, handler_func: Callable[..., Any], /) -> None: ...
612
+ def remove_event_handler(self, event_name: _ButtonEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
613
+ def set_event_handler(self, event_name: _ButtonEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
614
+ def raise_event(self, event_name: _ButtonEvents | str, /, **event_args: Any) -> None: ...
615
+
616
+
617
+ class TextBox(Component):
618
+ """A single-line text input component.
619
+
620
+ [Anvil Docs](https://anvil.works/docs/client/components/textbox)"""
621
+
622
+ text: str
623
+ placeholder: str
624
+ type: str
625
+ hide_text: bool
626
+ font_size: int | None
627
+ font: str
628
+ bold: bool
629
+ italic: bool
630
+ underline: bool
631
+ foreground: str
632
+ background: str
633
+ border: str
634
+ align: str
635
+
636
+ def add_event_handler(self, event_name: _TextBoxEvents | str, handler_func: Callable[..., Any], /) -> None: ...
637
+ def remove_event_handler(self, event_name: _TextBoxEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
638
+ def set_event_handler(self, event_name: _TextBoxEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
639
+ def raise_event(self, event_name: _TextBoxEvents | str, /, **event_args: Any) -> None: ...
640
+
641
+ def focus(self) -> None:
642
+ """Set focus to this text box.
643
+
644
+ [Anvil Docs](https://anvil.works/docs/client/components/textbox)"""
645
+ ...
646
+
647
+ def select(self) -> None:
648
+ """Select all text in this text box.
649
+
650
+ [Anvil Docs](https://anvil.works/docs/client/components/textbox)"""
651
+ ...
652
+
653
+
654
+ class TextArea(Component):
655
+ """A multi-line text input component.
656
+
657
+ [Anvil Docs](https://anvil.works/docs/client/components/textarea)"""
658
+
659
+ text: str
660
+ placeholder: str
661
+ rows: int | None
662
+ auto_expand: bool
663
+ height: str
664
+ font_size: int | None
665
+ font: str
666
+ bold: bool
667
+ italic: bool
668
+ underline: bool
669
+ foreground: str
670
+ background: str
671
+ border: str
672
+
673
+ def add_event_handler(self, event_name: _TextAreaEvents | str, handler_func: Callable[..., Any], /) -> None: ...
674
+ def remove_event_handler(self, event_name: _TextAreaEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
675
+ def set_event_handler(self, event_name: _TextAreaEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
676
+ def raise_event(self, event_name: _TextAreaEvents | str, /, **event_args: Any) -> None: ...
677
+
678
+ def focus(self) -> None:
679
+ """Set focus to this text area.
680
+
681
+ [Anvil Docs](https://anvil.works/docs/client/components/textarea)"""
682
+ ...
683
+
684
+ def select(self) -> None:
685
+ """Select all text in this text area.
686
+
687
+ [Anvil Docs](https://anvil.works/docs/client/components/textarea)"""
688
+ ...
689
+
690
+
691
+ class CheckBox(Component):
692
+ """A checkbox input component.
693
+
694
+ [Anvil Docs](https://anvil.works/docs/client/components/checkbox)"""
695
+
696
+ checked: bool
697
+ text: str
698
+ font_size: int | None
699
+ font: str
700
+ bold: bool
701
+ italic: bool
702
+ underline: bool
703
+ foreground: str
704
+ background: str
705
+ border: str
706
+ align: str
707
+
708
+ def add_event_handler(self, event_name: _CheckBoxEvents | str, handler_func: Callable[..., Any], /) -> None: ...
709
+ def remove_event_handler(self, event_name: _CheckBoxEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
710
+ def set_event_handler(self, event_name: _CheckBoxEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
711
+ def raise_event(self, event_name: _CheckBoxEvents | str, /, **event_args: Any) -> None: ...
712
+
713
+
714
+ class RadioButton(Component):
715
+ """A radio button input component.
716
+
717
+ [Anvil Docs](https://anvil.works/docs/client/components/radiobutton)"""
718
+
719
+ selected: bool
720
+ value: Any
721
+ group_name: str
722
+ text: str
723
+ font_size: int | None
724
+ font: str
725
+ bold: bool
726
+ italic: bool
727
+ underline: bool
728
+ foreground: str
729
+ background: str
730
+ border: str
731
+ align: str
732
+
733
+ def add_event_handler(self, event_name: _RadioButtonEvents | str, handler_func: Callable[..., Any], /) -> None: ...
734
+ def remove_event_handler(self, event_name: _RadioButtonEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
735
+ def set_event_handler(self, event_name: _RadioButtonEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
736
+ def raise_event(self, event_name: _RadioButtonEvents | str, /, **event_args: Any) -> None: ...
737
+
738
+ @staticmethod
739
+ def get_group_value(group_name: str) -> Any:
740
+ """Get the selected value from a radio button group.
741
+
742
+ [Anvil Docs](https://anvil.works/docs/client/components/radiobutton)"""
743
+ ...
744
+
745
+
746
+ class DropDown(Component):
747
+ """A dropdown selection component.
748
+
749
+ [Anvil Docs](https://anvil.works/docs/client/components/dropdown)"""
750
+
751
+ items: list[Any]
752
+ selected_value: Any
753
+ include_placeholder: bool
754
+ placeholder: str
755
+ font_size: int | None
756
+ font: str
757
+ bold: bool
758
+ italic: bool
759
+ underline: bool
760
+ foreground: str
761
+ background: str
762
+ border: str
763
+ align: str
764
+
765
+ def add_event_handler(self, event_name: _DropDownEvents | str, handler_func: Callable[..., Any], /) -> None: ...
766
+ def remove_event_handler(self, event_name: _DropDownEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
767
+ def set_event_handler(self, event_name: _DropDownEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
768
+ def raise_event(self, event_name: _DropDownEvents | str, /, **event_args: Any) -> None: ...
769
+
770
+
771
+ class DatePicker(Component):
772
+ """A date picker input component.
773
+
774
+ [Anvil Docs](https://anvil.works/docs/client/components/datepicker)"""
775
+
776
+ date: Any # datetime.date or None
777
+ min_date: Any
778
+ max_date: Any
779
+ format: str
780
+ pick_time: bool
781
+ placeholder: str
782
+ font_size: int | None
783
+ font: str
784
+ bold: bool
785
+ italic: bool
786
+ underline: bool
787
+ foreground: str
788
+ background: str
789
+ border: str
790
+ align: str
791
+
792
+ def add_event_handler(self, event_name: _DatePickerEvents | str, handler_func: Callable[..., Any], /) -> None: ...
793
+ def remove_event_handler(self, event_name: _DatePickerEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
794
+ def set_event_handler(self, event_name: _DatePickerEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
795
+ def raise_event(self, event_name: _DatePickerEvents | str, /, **event_args: Any) -> None: ...
796
+
797
+
798
+ class FileLoader(Component):
799
+ """A file upload component.
800
+
801
+ [Anvil Docs](https://anvil.works/docs/client/components/fileloader)"""
802
+
803
+ file: Media | None
804
+ files: list[Media]
805
+ multiple: bool
806
+ show_state: bool
807
+ text: str
808
+ font_size: int | None
809
+ font: str
810
+ bold: bool
811
+ italic: bool
812
+ underline: bool
813
+ foreground: str
814
+ background: str
815
+ border: str
816
+ align: str
817
+
818
+ def add_event_handler(self, event_name: _FileLoaderEvents | str, handler_func: Callable[..., Any], /) -> None: ...
819
+ def remove_event_handler(self, event_name: _FileLoaderEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
820
+ def set_event_handler(self, event_name: _FileLoaderEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
821
+ def raise_event(self, event_name: _FileLoaderEvents | str, /, **event_args: Any) -> None: ...
822
+
823
+ def clear(self) -> None:
824
+ """Clear the selected file(s).
825
+
826
+ [Anvil Docs](https://anvil.works/docs/client/components/fileloader)"""
827
+ ...
828
+
829
+
830
+ # ============================================================================
831
+ # Container Components
832
+ # ============================================================================
833
+
834
+ class ColumnPanel(Container):
835
+ """A container that arranges components vertically.
836
+
837
+ [Anvil Docs](https://anvil.works/docs/client/components/columnpanel)"""
838
+
839
+ col_widths: str
840
+ col_spacing: str
841
+ wrap_on: str
842
+ background: str
843
+ foreground: str
844
+ border: str
845
+ spacing_above: str
846
+ spacing_below: str
847
+
848
+
849
+ class FlowPanel(Container):
850
+ """A container that arranges components in a flowing layout.
851
+
852
+ [Anvil Docs](https://anvil.works/docs/client/components/flowpanel)"""
853
+
854
+ align: str
855
+ spacing: str
856
+ vertical_align: str
857
+ background: str
858
+ foreground: str
859
+ border: str
860
+ spacing_above: str
861
+ spacing_below: str
862
+
863
+
864
+ class LinearPanel(Container):
865
+ """A container that arranges components in a linear layout.
866
+
867
+ [Anvil Docs](https://anvil.works/docs/client/components/linearpanel)"""
868
+
869
+ background: str
870
+ foreground: str
871
+ border: str
872
+ spacing_above: str
873
+ spacing_below: str
874
+
875
+
876
+ class GridPanel(Container):
877
+ """A container that arranges components in a grid.
878
+
879
+ [Anvil Docs](https://anvil.works/docs/client/components/gridpanel)"""
880
+
881
+ background: str
882
+ foreground: str
883
+ border: str
884
+
885
+
886
+ class XYPanel(Container):
887
+ """A container that positions components at absolute coordinates.
888
+
889
+ [Anvil Docs](https://anvil.works/docs/client/components/xypanel)"""
890
+
891
+ background: str
892
+ foreground: str
893
+ border: str
894
+ height: str
895
+
896
+
897
+ class DataGrid(Container):
898
+ """A data grid component for displaying tabular data.
899
+
900
+ [Anvil Docs](https://anvil.works/docs/client/components/datagrid)"""
901
+
902
+ columns: list[dict[str, Any]]
903
+ rows_per_page: int | None
904
+ show_page_controls: bool
905
+ auto_header: bool
906
+ wrap_on: str
907
+ background: str
908
+ foreground: str
909
+ border: str
910
+
911
+ def add_event_handler(self, event_name: _DataGridEvents | str, handler_func: Callable[..., Any], /) -> None: ...
912
+ def remove_event_handler(self, event_name: _DataGridEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
913
+ def set_event_handler(self, event_name: _DataGridEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
914
+ def raise_event(self, event_name: _DataGridEvents | str, /, **event_args: Any) -> None: ...
915
+
916
+
917
+ class DataRowPanel(Container):
918
+ """A row within a DataGrid.
919
+
920
+ [Anvil Docs](https://anvil.works/docs/client/components/datagrid)"""
921
+
922
+ item: dict[str, Any]
923
+ background: str
924
+ foreground: str
925
+ border: str
926
+
927
+
928
+ class RepeatingPanel(Container):
929
+ """A panel that repeats a template for each item in a list.
930
+
931
+ [Anvil Docs](https://anvil.works/docs/client/components/repeatingpanel)"""
932
+
933
+ items: list[Any] | Iterator[Any]
934
+ item_template: str
935
+ background: str
936
+ foreground: str
937
+ border: str
938
+
939
+ def get_components(self) -> list[Container]:
940
+ """Get all repeated template instances.
941
+
942
+ [Anvil Docs](https://anvil.works/docs/client/components/repeatingpanel)"""
943
+ ...
944
+
945
+
946
+ class Tabs(Container):
947
+ """A tabbed container component.
948
+
949
+ [Anvil Docs](https://anvil.works/docs/client/components/tabs)"""
950
+
951
+ tab_titles: list[str]
952
+
953
+ def add_event_handler(self, event_name: _TabsEvents | str, handler_func: Callable[..., Any], /) -> None: ...
954
+ def remove_event_handler(self, event_name: _TabsEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
955
+ def set_event_handler(self, event_name: _TabsEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
956
+ def raise_event(self, event_name: _TabsEvents | str, /, **event_args: Any) -> None: ...
957
+
958
+
959
+ class TabSection(Container):
960
+ """A section within a Tabs component.
961
+
962
+ [Anvil Docs](https://anvil.works/docs/client/components/tabs)"""
963
+
964
+ pass
965
+
966
+
967
+ # ============================================================================
968
+ # Media/Visualization Components
969
+ # ============================================================================
970
+
971
+ class HtmlTemplate(Container):
972
+ """A container that renders HTML.
973
+
974
+ [Anvil Docs](https://anvil.works/docs/client/components/htmlpanel)"""
975
+
976
+ html: str
977
+
978
+ def call_js(self, fn_name: str, *args: Any) -> Any:
979
+ """Call a JavaScript function defined in the HTML.
980
+
981
+ [Anvil Docs](https://anvil.works/docs/client/javascript)"""
982
+ ...
983
+
984
+
985
+ class HtmlPanel(Container):
986
+ """A panel that renders HTML content.
987
+
988
+ [Anvil Docs](https://anvil.works/docs/client/components/htmlpanel)"""
989
+
990
+ html: str
991
+
992
+ def call_js(self, fn_name: str, *args: Any) -> Any:
993
+ """Call a JavaScript function defined in the HTML.
994
+
995
+ [Anvil Docs](https://anvil.works/docs/client/javascript)"""
996
+ ...
997
+
998
+
999
+ class Canvas(Component):
1000
+ """A drawing canvas component.
1001
+
1002
+ [Anvil Docs](https://anvil.works/docs/client/components/canvas)"""
1003
+
1004
+ width: int
1005
+ height: int
1006
+ background: str
1007
+
1008
+ def add_event_handler(self, event_name: _CanvasEvents | str, handler_func: Callable[..., Any], /) -> None: ...
1009
+ def remove_event_handler(self, event_name: _CanvasEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
1010
+ def set_event_handler(self, event_name: _CanvasEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
1011
+ def raise_event(self, event_name: _CanvasEvents | str, /, **event_args: Any) -> None: ...
1012
+
1013
+ def get_image(self) -> Media:
1014
+ """Get the canvas content as a media object.
1015
+
1016
+ [Anvil Docs](https://anvil.works/docs/client/components/canvas)"""
1017
+ ...
1018
+
1019
+ def reset_context(self) -> None:
1020
+ """Reset the drawing context.
1021
+
1022
+ [Anvil Docs](https://anvil.works/docs/client/components/canvas)"""
1023
+ ...
1024
+
1025
+
1026
+ class Plot(Component):
1027
+ """A Plotly chart component.
1028
+
1029
+ [Anvil Docs](https://anvil.works/docs/client/components/plot)"""
1030
+
1031
+ data: list[dict[str, Any]]
1032
+ layout: dict[str, Any]
1033
+ config: dict[str, Any]
1034
+ figure: dict[str, Any]
1035
+
1036
+ def add_event_handler(self, event_name: _PlotEvents | str, handler_func: Callable[..., Any], /) -> None: ...
1037
+ def remove_event_handler(self, event_name: _PlotEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
1038
+ def set_event_handler(self, event_name: _PlotEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
1039
+ def raise_event(self, event_name: _PlotEvents | str, /, **event_args: Any) -> None: ...
1040
+
1041
+ def redraw(self) -> None:
1042
+ """Redraw the plot.
1043
+
1044
+ [Anvil Docs](https://anvil.works/docs/client/components/plot)"""
1045
+ ...
1046
+
1047
+ def to_image(self, **kwargs: Any) -> Media:
1048
+ """Export the plot as an image.
1049
+
1050
+ [Anvil Docs](https://anvil.works/docs/client/components/plot)"""
1051
+ ...
1052
+
1053
+ def relayout(self, **kwargs: Any) -> None:
1054
+ """Update the plot layout.
1055
+
1056
+ [Anvil Docs](https://anvil.works/docs/client/components/plot)"""
1057
+ ...
1058
+
1059
+ def extend_traces(self, data: dict[str, Any], traces: list[int]) -> None:
1060
+ """Extend trace data.
1061
+
1062
+ [Anvil Docs](https://anvil.works/docs/client/components/plot)"""
1063
+ ...
1064
+
1065
+
1066
+ class _LatLng:
1067
+ """A latitude/longitude pair for GoogleMap.
1068
+
1069
+ [Anvil Docs](https://anvil.works/docs/client/components/googlemap)"""
1070
+
1071
+ lat: float
1072
+ lng: float
1073
+
1074
+ def __init__(self, lat: float, lng: float) -> None: ...
1075
+
1076
+
1077
+ class _MapMarker(Component):
1078
+ """A marker on a GoogleMap.
1079
+
1080
+ [Anvil Docs](https://anvil.works/docs/client/components/googlemap#markers)"""
1081
+
1082
+ animation: Any
1083
+ """The animation of this Marker."""
1084
+
1085
+ position: _LatLng
1086
+ """The LatLng position of this Marker."""
1087
+
1088
+ icon: Any
1089
+ """The icon to display at the position of this Marker."""
1090
+
1091
+ label: Any
1092
+ """The label to display on this Marker."""
1093
+
1094
+ clickable: bool
1095
+ """True if this Marker can be clicked."""
1096
+
1097
+ draggable: bool
1098
+ """True if this Marker can be dragged."""
1099
+
1100
+ visible: bool
1101
+ """True if this Marker is visible."""
1102
+
1103
+ z_index: int
1104
+ """The z-index of this Marker."""
1105
+
1106
+ def remove(self) -> None:
1107
+ """Remove this marker from the map."""
1108
+ ...
1109
+
1110
+
1111
+ class _MapPolygon(Component):
1112
+ """A polygon overlay on a GoogleMap.
1113
+
1114
+ [Anvil Docs](https://anvil.works/docs/client/components/googlemap#polygons)"""
1115
+
1116
+ path: list[_LatLng]
1117
+ """The ordered sequence of LatLng coordinates of the Polygon."""
1118
+
1119
+ geodesic: bool
1120
+ """When true, edges of the polygon are interpreted as geodesic."""
1121
+
1122
+ editable: bool
1123
+ """True if this overlay can be edited by the user."""
1124
+
1125
+ draggable: bool
1126
+ """True if this overlay can be dragged."""
1127
+
1128
+ visible: bool
1129
+ """True if this overlay is visible."""
1130
+
1131
+ stroke_color: str
1132
+ """The stroke color."""
1133
+
1134
+ stroke_opacity: float
1135
+ """The stroke opacity between 0.0 and 1.0."""
1136
+
1137
+ stroke_weight: int
1138
+ """The stroke width in pixels."""
1139
+
1140
+ fill_color: str
1141
+ """The fill color."""
1142
+
1143
+ fill_opacity: float
1144
+ """The fill opacity between 0.0 and 1.0."""
1145
+
1146
+ z_index: int
1147
+ """The z-index of this Polygon."""
1148
+
1149
+ def remove(self) -> None:
1150
+ """Remove this polygon from the map."""
1151
+ ...
1152
+
1153
+
1154
+ class _MapPolyline(Component):
1155
+ """A polyline overlay on a GoogleMap.
1156
+
1157
+ [Anvil Docs](https://anvil.works/docs/client/components/googlemap#polylines)"""
1158
+
1159
+ icons: list[Any]
1160
+ """The icons to be rendered along the polyline."""
1161
+
1162
+ path: list[_LatLng]
1163
+ """The ordered sequence of LatLng coordinates of the Polyline."""
1164
+
1165
+ geodesic: bool
1166
+ """When true, edges of the polyline are interpreted as geodesic."""
1167
+
1168
+ editable: bool
1169
+ """True if this overlay can be edited by the user."""
1170
+
1171
+ draggable: bool
1172
+ """True if this overlay can be dragged."""
1173
+
1174
+ visible: bool
1175
+ """True if this overlay is visible."""
1176
+
1177
+ stroke_color: str
1178
+ """The stroke color."""
1179
+
1180
+ stroke_opacity: float
1181
+ """The stroke opacity between 0.0 and 1.0."""
1182
+
1183
+ stroke_weight: int
1184
+ """The stroke width in pixels."""
1185
+
1186
+ z_index: int
1187
+ """The z-index of this Polyline."""
1188
+
1189
+ def remove(self) -> None:
1190
+ """Remove this polyline from the map."""
1191
+ ...
1192
+
1193
+
1194
+ class GoogleMap(Component):
1195
+ """A Google Maps component.
1196
+
1197
+ [Anvil Docs](https://anvil.works/docs/client/components/googlemap)"""
1198
+
1199
+ center: _LatLng | Any
1200
+ zoom: int
1201
+ map_type: str
1202
+ markers: list[_MapMarker]
1203
+
1204
+ # Nested classes
1205
+ LatLng: type[_LatLng]
1206
+ Marker: type[_MapMarker]
1207
+ Polygon: type[_MapPolygon]
1208
+ Polyline: type[_MapPolyline]
1209
+
1210
+ def add_event_handler(self, event_name: _GoogleMapEvents | str, handler_func: Callable[..., Any], /) -> None: ...
1211
+ def remove_event_handler(self, event_name: _GoogleMapEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
1212
+ def set_event_handler(self, event_name: _GoogleMapEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
1213
+ def raise_event(self, event_name: _GoogleMapEvents | str, /, **event_args: Any) -> None: ...
1214
+
1215
+ def add_component(
1216
+ self,
1217
+ component: _MapMarker | _MapPolygon | _MapPolyline,
1218
+ /,
1219
+ **layout_props: Any,
1220
+ ) -> None:
1221
+ """Add a marker, polygon, or polyline to this map."""
1222
+ ...
1223
+
1224
+
1225
+ class YouTubeVideo(Component):
1226
+ """A YouTube video player component.
1227
+
1228
+ [Anvil Docs](https://anvil.works/docs/client/components/youtubevideo)"""
1229
+
1230
+ youtube_id: str
1231
+ autoplay: bool
1232
+ loop: bool
1233
+ mute: bool
1234
+ volume: float
1235
+ current_time: float
1236
+ duration: float
1237
+ state: str
1238
+
1239
+ def add_event_handler(self, event_name: _YouTubeVideoEvents | str, handler_func: Callable[..., Any], /) -> None: ...
1240
+ def remove_event_handler(self, event_name: _YouTubeVideoEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
1241
+ def set_event_handler(self, event_name: _YouTubeVideoEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
1242
+ def raise_event(self, event_name: _YouTubeVideoEvents | str, /, **event_args: Any) -> None: ...
1243
+
1244
+ def play(self) -> None:
1245
+ """Start playing this YouTube video.
1246
+
1247
+ [Anvil Docs](https://anvil.works/docs/client/components/youtubevideo)"""
1248
+ ...
1249
+
1250
+ def pause(self) -> None:
1251
+ """Pause this YouTube video.
1252
+
1253
+ [Anvil Docs](https://anvil.works/docs/client/components/youtubevideo)"""
1254
+ ...
1255
+
1256
+ def stop(self) -> None:
1257
+ """Stop playing this YouTube video.
1258
+
1259
+ [Anvil Docs](https://anvil.works/docs/client/components/youtubevideo)"""
1260
+ ...
1261
+
1262
+
1263
+ # ============================================================================
1264
+ # Utility Components
1265
+ # ============================================================================
1266
+
1267
+ class Timer(Component):
1268
+ """A timer component for periodic events.
1269
+
1270
+ [Anvil Docs](https://anvil.works/docs/client/components/timer)"""
1271
+
1272
+ interval: float
1273
+
1274
+ def add_event_handler(self, event_name: _TimerEvents | str, handler_func: Callable[..., Any], /) -> None: ...
1275
+ def remove_event_handler(self, event_name: _TimerEvents | str, handler_func: Callable[..., Any] | None = None, /) -> None: ...
1276
+ def set_event_handler(self, event_name: _TimerEvents | str, handler_func: Callable[..., Any] | None, /) -> None: ...
1277
+ def raise_event(self, event_name: _TimerEvents | str, /, **event_args: Any) -> None: ...
1278
+
1279
+ def start(self) -> None:
1280
+ """Start the timer.
1281
+
1282
+ [Anvil Docs](https://anvil.works/docs/client/components/timer)"""
1283
+ ...
1284
+
1285
+ def stop(self) -> None:
1286
+ """Stop the timer.
1287
+
1288
+ [Anvil Docs](https://anvil.works/docs/client/components/timer)"""
1289
+ ...
1290
+
1291
+