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