Skeleton ready
This commit is contained in:
55
typings/punq/__init__.pyi
Normal file
55
typings/punq/__init__.pyi
Normal file
@@ -0,0 +1,55 @@
|
||||
from enum import Enum
|
||||
from typing import Any, Callable, List, Type, TypeVar, overload
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
class MissingDependencyException(Exception): ...
|
||||
class MissingDependencyError(MissingDependencyException): ...
|
||||
class InvalidRegistrationException(Exception): ...
|
||||
class InvalidRegistrationError(InvalidRegistrationException): ...
|
||||
class InvalidForwardReferenceException(Exception): ...
|
||||
class InvalidForwardReferenceError(InvalidForwardReferenceException): ...
|
||||
|
||||
class Scope(Enum):
|
||||
transient = 0
|
||||
singleton = 1
|
||||
|
||||
class _Empty: ...
|
||||
|
||||
empty: _Empty
|
||||
|
||||
class Container:
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
@overload
|
||||
def register(
|
||||
self,
|
||||
service: Type[T],
|
||||
factory: Type[T] | Callable[..., T] | _Empty = ...,
|
||||
instance: T | _Empty = ...,
|
||||
scope: Scope = ...,
|
||||
**kwargs: Any,
|
||||
) -> Container: ...
|
||||
|
||||
@overload
|
||||
def register(
|
||||
self,
|
||||
service: str,
|
||||
factory: Callable[..., Any] | _Empty = ...,
|
||||
instance: Any | _Empty = ...,
|
||||
scope: Scope = ...,
|
||||
**kwargs: Any,
|
||||
) -> Container: ...
|
||||
|
||||
def register(
|
||||
self,
|
||||
service: Type[T] | str,
|
||||
factory: Type[T] | Callable[..., T] | _Empty = ...,
|
||||
instance: T | _Empty = ...,
|
||||
scope: Scope = ...,
|
||||
**kwargs: Any,
|
||||
) -> Container: ...
|
||||
|
||||
def resolve(self, service_key: Type[T], **kwargs: Any) -> T: ...
|
||||
def resolve_all(self, service: Type[T], **kwargs: Any) -> List[T]: ...
|
||||
def instantiate(self, service_key: Type[T], **kwargs: Any) -> T: ...
|
||||
Reference in New Issue
Block a user