Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed Sep 20, 2020
1 parent 547c9a5 commit be6b470
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions idom/client/protocol.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import Union
from typing import Union, cast

from typing_extensions import Protocol

Expand All @@ -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."""
Expand All @@ -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`"""

0 comments on commit be6b470

Please sign in to comment.