Skeleton ready

This commit is contained in:
2026-07-08 23:01:55 +04:00
commit d9e5effdce
75 changed files with 1989 additions and 0 deletions

55
typings/punq/__init__.pyi Normal file
View 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: ...