Skip to content

Commit be6b470

Browse files
committed
fix types
1 parent 547c9a5 commit be6b470

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

idom/client/protocol.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
2-
from typing import Union
2+
from typing import Union, cast
33

44
from typing_extensions import Protocol
55

@@ -11,8 +11,8 @@
1111
class ClientImplementation(Protocol):
1212
"""A minimal set of functions required to use :class:`idom.widget.module.Module`"""
1313

14-
def register_web_module(self, name: str, source: Union[str, Path]) -> None:
15-
"""Add a module with the given ``name`` to the client using the given ``source``"""
14+
def register_web_module(self, name: str, source: Union[str, Path]) -> str:
15+
"""Return the URL of a module added under the given ``name`` and contents of ``source``"""
1616

1717
def web_module_url(self, name: str) -> str:
1818
"""Return the URL to import the module with the given name."""
@@ -21,5 +21,7 @@ def web_module_exists(self, name: str) -> bool:
2121
"""Check if a module with the given name is installed"""
2222

2323

24-
client_implementation: Ref[ClientImplementation] = Ref(manage)
24+
client_implementation: Ref[ClientImplementation] = Ref(
25+
cast(ClientImplementation, manage)
26+
)
2527
"""The current client implementation used by :class:`idom.widgets.module.Module`"""

0 commit comments

Comments
 (0)