diff --git a/idom/client/protocol.py b/idom/client/protocol.py index bc0f032f2..daf0d1316 100644 --- a/idom/client/protocol.py +++ b/idom/client/protocol.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Union +from typing import Union, cast from typing_extensions import Protocol @@ -11,8 +11,8 @@ class ClientImplementation(Protocol): """A minimal set of functions required to use :class:`idom.widget.module.Module`""" - def register_web_module(self, name: str, source: Union[str, Path]) -> None: - """Add a module with the given ``name`` to the client using the given ``source``""" + def register_web_module(self, name: str, source: Union[str, Path]) -> str: + """Return the URL of a module added under the given ``name`` and contents of ``source``""" def web_module_url(self, name: str) -> str: """Return the URL to import the module with the given name.""" @@ -21,5 +21,7 @@ def web_module_exists(self, name: str) -> bool: """Check if a module with the given name is installed""" -client_implementation: Ref[ClientImplementation] = Ref(manage) +client_implementation: Ref[ClientImplementation] = Ref( + cast(ClientImplementation, manage) +) """The current client implementation used by :class:`idom.widgets.module.Module`"""