Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 10cefad

Browse files
committed
bump deps versions | add docs
1 parent 0ec2104 commit 10cefad

5 files changed

Lines changed: 327 additions & 81 deletions

File tree

src/flet_webview/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from .types import (
2+
LogLevelSeverity,
3+
RequestMethod,
24
WebviewConsoleMessageEvent,
35
WebviewJavaScriptEvent,
4-
WebviewLogLevelSeverity,
5-
WebviewRequestMethod,
66
WebviewScrollEvent,
77
)
88
from .webview import WebView

src/flet_webview/types.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,68 @@
44
import flet as ft
55

66
__all__ = [
7-
"WebviewRequestMethod",
8-
"WebviewLogLevelSeverity",
7+
"RequestMethod",
8+
"LogLevelSeverity",
99
"WebviewScrollEvent",
1010
"WebviewConsoleMessageEvent",
1111
"WebviewJavaScriptEvent",
1212
]
1313

1414

15-
class WebviewRequestMethod(Enum):
15+
class RequestMethod(Enum):
16+
"""Defines the supported HTTP methods for loading a page in a `WebView`."""
17+
1618
GET = "get"
19+
"""HTTP GET method."""
20+
1721
POST = "post"
22+
"""HTTP POST method."""
23+
1824

25+
class LogLevelSeverity(Enum):
26+
"""Represents the severity of a JavaScript log message."""
1927

20-
class WebviewLogLevelSeverity(Enum):
2128
ERROR = "error"
29+
"""
30+
Indicates an error message was logged via an "error" event of the
31+
`console.error` method.
32+
"""
33+
2234
WARNING = "warning"
35+
"""Indicates a warning message was logged using the `console.warning` method."""
36+
2337
DEBUG = "debug"
38+
"""Indicates a debug message was logged using the `console.debug` method."""
39+
2440
INFO = "info"
41+
"""Indicates an informational message was logged using the `console.info` method."""
42+
2543
LOG = "log"
44+
"""Indicates a log message was logged using the `console.log` method."""
2645

2746

2847
@dataclass
2948
class WebviewScrollEvent(ft.ControlEvent):
3049
x: float
50+
"""The value of the horizontal offset with the origin being at the leftmost of the `WebView`."""
51+
3152
y: float
53+
"""The value of the vertical offset with the origin being at the topmost of the `WebView`."""
3254

3355

3456
@dataclass
3557
class WebviewConsoleMessageEvent(ft.ControlEvent):
3658
message: str
37-
severity_level: WebviewLogLevelSeverity
59+
"""The message written to the console."""
60+
61+
severity_level: LogLevelSeverity
62+
"""The severity of a JavaScript log message."""
3863

3964

4065
@dataclass
4166
class WebviewJavaScriptEvent(ft.ControlEvent):
4267
message: str
68+
"""The message to be displayed in the window."""
69+
4370
url: str
71+
"""The URL of the page requesting the dialog."""

0 commit comments

Comments
 (0)