10
10
from typing import Any , List , NewType , Optional , Set , Tuple , Union , overload
11
11
from urllib .parse import urlparse
12
12
13
- from typing_extensions import Protocol
14
-
15
13
from idom .config import IDOM_DEBUG_MODE , IDOM_WEB_MODULES_DIR
16
- from idom .core .proto import (
17
- EventHandlerMapping ,
18
- ImportSourceDict ,
19
- VdomAttributesAndChildren ,
20
- VdomDict ,
21
- )
14
+ from idom .core .types import ImportSourceDict , VdomDictConstructor
22
15
from idom .core .vdom import make_vdom_constructor
23
16
24
17
from .utils import (
@@ -292,16 +285,6 @@ def module_from_string(
292
285
)
293
286
294
287
295
- class _VdomDictConstructor (Protocol ):
296
- def __call__ (
297
- self ,
298
- * attributes_and_children : VdomAttributesAndChildren ,
299
- key : str = ...,
300
- event_handlers : Optional [EventHandlerMapping ] = ...,
301
- ) -> VdomDict :
302
- ...
303
-
304
-
305
288
@dataclass (frozen = True )
306
289
class WebModule :
307
290
source : str
@@ -318,7 +301,7 @@ def export(
318
301
export_names : str ,
319
302
fallback : Optional [Any ] = ...,
320
303
allow_children : bool = ...,
321
- ) -> _VdomDictConstructor :
304
+ ) -> VdomDictConstructor :
322
305
...
323
306
324
307
@@ -328,7 +311,7 @@ def export(
328
311
export_names : Union [List [str ], Tuple [str , ...]],
329
312
fallback : Optional [Any ] = ...,
330
313
allow_children : bool = ...,
331
- ) -> List [_VdomDictConstructor ]:
314
+ ) -> List [VdomDictConstructor ]:
332
315
...
333
316
334
317
@@ -337,7 +320,7 @@ def export(
337
320
export_names : Union [str , List [str ], Tuple [str , ...]],
338
321
fallback : Optional [Any ] = None ,
339
322
allow_children : bool = True ,
340
- ) -> Union [_VdomDictConstructor , List [_VdomDictConstructor ]]:
323
+ ) -> Union [VdomDictConstructor , List [VdomDictConstructor ]]:
341
324
"""Return one or more VDOM constructors from a :class:`WebModule`
342
325
343
326
Parameters:
@@ -375,7 +358,7 @@ def _make_export(
375
358
name : str ,
376
359
fallback : Optional [Any ],
377
360
allow_children : bool ,
378
- ) -> _VdomDictConstructor :
361
+ ) -> VdomDictConstructor :
379
362
return partial (
380
363
make_vdom_constructor (
381
364
name ,
0 commit comments