Skip to content

Commit e4180b8

Browse files
authored
add return type annotation to toaster (#5693)
1 parent 1b3ba8f commit e4180b8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,5 @@
118118
"reflex/components/recharts/general.pyi": "d87ff9b85b2a204be01753690df4fb11",
119119
"reflex/components/recharts/polar.pyi": "ad24bd37c6acc0bc9bd4ac01af3ffe49",
120120
"reflex/components/recharts/recharts.pyi": "c41d19ab67972246c574098929bea7ea",
121-
"reflex/components/sonner/toast.pyi": "2f4787687eb2ac92650c9ec5529109bd"
121+
"reflex/components/sonner/toast.pyi": "1be74a25e344129b80f14165ae1a01f2"
122122
}

reflex/components/sonner/toast.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def add_hooks(self) -> list[Var | str]:
238238

239239
@staticmethod
240240
def send_toast(
241-
message: str | Var = "",
241+
message: str | Var[str] = "",
242242
level: str | None = None,
243243
fallback_to_alert: bool = False,
244244
**props,
@@ -292,7 +292,7 @@ def send_toast(
292292
return run_script(toast)
293293

294294
@staticmethod
295-
def toast_info(message: str | Var = "", **kwargs: Any):
295+
def toast_info(message: str | Var[str] = "", **kwargs: Any) -> EventSpec:
296296
"""Display an info toast message.
297297
298298
Args:
@@ -305,7 +305,7 @@ def toast_info(message: str | Var = "", **kwargs: Any):
305305
return Toaster.send_toast(message, level="info", **kwargs)
306306

307307
@staticmethod
308-
def toast_warning(message: str | Var = "", **kwargs: Any):
308+
def toast_warning(message: str | Var[str] = "", **kwargs: Any) -> EventSpec:
309309
"""Display a warning toast message.
310310
311311
Args:
@@ -318,7 +318,7 @@ def toast_warning(message: str | Var = "", **kwargs: Any):
318318
return Toaster.send_toast(message, level="warning", **kwargs)
319319

320320
@staticmethod
321-
def toast_error(message: str | Var = "", **kwargs: Any):
321+
def toast_error(message: str | Var[str] = "", **kwargs: Any) -> EventSpec:
322322
"""Display an error toast message.
323323
324324
Args:
@@ -331,7 +331,7 @@ def toast_error(message: str | Var = "", **kwargs: Any):
331331
return Toaster.send_toast(message, level="error", **kwargs)
332332

333333
@staticmethod
334-
def toast_success(message: str | Var = "", **kwargs: Any):
334+
def toast_success(message: str | Var[str] = "", **kwargs: Any) -> EventSpec:
335335
"""Display a success toast message.
336336
337337
Args:
@@ -344,7 +344,7 @@ def toast_success(message: str | Var = "", **kwargs: Any):
344344
return Toaster.send_toast(message, level="success", **kwargs)
345345

346346
@staticmethod
347-
def toast_loading(message: str | Var = "", **kwargs: Any):
347+
def toast_loading(message: str | Var[str] = "", **kwargs: Any) -> EventSpec:
348348
"""Display a loading toast message.
349349
350350
Args:
@@ -357,7 +357,7 @@ def toast_loading(message: str | Var = "", **kwargs: Any):
357357
return Toaster.send_toast(message, level="loading", **kwargs)
358358

359359
@staticmethod
360-
def toast_dismiss(id: Var | str | None = None):
360+
def toast_dismiss(id: Var[str] | str | None = None) -> EventSpec:
361361
"""Dismiss a toast.
362362
363363
Args:

0 commit comments

Comments
 (0)