mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-11-04 18:07:44 +03:00 
			
		
		
		
	Refactor provider typing stubs
This commit is contained in:
		
							parent
							
								
									cb2a36b216
								
							
						
					
					
						commit
						f1256a44fd
					
				| 
						 | 
					@ -66,44 +66,24 @@ class Provider(Generic[T]):
 | 
				
			||||||
    def _copy_overridings(self, copied: Provider, memo: Optional[_Dict[Any, Any]]) -> None: ...
 | 
					    def _copy_overridings(self, copied: Provider, memo: Optional[_Dict[Any, Any]]) -> None: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Object(Provider, Generic[T]):
 | 
					class Object(Provider[T]):
 | 
				
			||||||
    def __init__(self, provides: T) -> None: ...
 | 
					    def __init__(self, provides: T) -> None: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Delegate(Provider[Provider]):
 | 
				
			||||||
class Delegate(Provider):
 | 
					 | 
				
			||||||
    def __init__(self, provides: Provider) -> None: ...
 | 
					    def __init__(self, provides: Provider) -> None: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Provider: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[Provider]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[Provider]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def provides(self) -> Provider: ...
 | 
					    def provides(self) -> Provider: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Dependency(Provider, Generic[T]):
 | 
					class Dependency(Provider[T]):
 | 
				
			||||||
    def __init__(self, instance_of: Type[T] = object) -> None: ...
 | 
					    def __init__(self, instance_of: Type[T] = object) -> None: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def instance_of(self) -> Type[T]: ...
 | 
					    def instance_of(self) -> Type[T]: ...
 | 
				
			||||||
    def provided_by(self, provider: Provider) -> OverridingContext: ...
 | 
					    def provided_by(self, provider: Provider) -> OverridingContext: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ExternalDependency(Dependency): ...
 | 
					class ExternalDependency(Dependency[T]): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class DependenciesContainer(Object):
 | 
					class DependenciesContainer(Object):
 | 
				
			||||||
| 
						 | 
					@ -113,15 +93,8 @@ class DependenciesContainer(Object):
 | 
				
			||||||
    def providers(self) -> _Dict[str, Provider]: ...
 | 
					    def providers(self) -> _Dict[str, Provider]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Callable(Provider, Generic[T]):
 | 
					class Callable(Provider[T]):
 | 
				
			||||||
    def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
					    def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def provides(self) -> T: ...
 | 
					    def provides(self) -> T: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
| 
						 | 
					@ -130,16 +103,16 @@ class Callable(Provider, Generic[T]):
 | 
				
			||||||
    def set_args(self, *args: Injection) -> Callable[T]: ...
 | 
					    def set_args(self, *args: Injection) -> Callable[T]: ...
 | 
				
			||||||
    def clear_args(self) -> Callable[T]: ...
 | 
					    def clear_args(self) -> Callable[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def kwargs(self) -> _Dict[str, Injection]: ...
 | 
					    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_kwargs(self, **kwargs: Injection) -> Callable[T]: ...
 | 
					    def add_kwargs(self, **kwargs: Injection) -> Callable[T]: ...
 | 
				
			||||||
    def set_kwargs(self, **kwargs: Injection) -> Callable[T]: ...
 | 
					    def set_kwargs(self, **kwargs: Injection) -> Callable[T]: ...
 | 
				
			||||||
    def clear_kwargs(self) -> Callable[T]: ...
 | 
					    def clear_kwargs(self) -> Callable[T]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class DelegatedCallable(Callable): ...
 | 
					class DelegatedCallable(Callable[T]): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AbstractCallable(Callable):
 | 
					class AbstractCallable(Callable[T]):
 | 
				
			||||||
    def override(self, provider: Callable) -> OverridingContext: ...
 | 
					    def override(self, provider: Callable) -> OverridingContext: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -147,13 +120,13 @@ class CallableDelegate(Delegate):
 | 
				
			||||||
    def __init__(self, callable: Callable) -> None: ...
 | 
					    def __init__(self, callable: Callable) -> None: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Coroutine(Callable): ...
 | 
					class Coroutine(Callable[T]): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class DelegatedCoroutine(Coroutine): ...
 | 
					class DelegatedCoroutine(Coroutine[T]): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AbstractCoroutine(Coroutine):
 | 
					class AbstractCoroutine(Coroutine[T]):
 | 
				
			||||||
    def override(self, provider: Coroutine) -> OverridingContext: ...
 | 
					    def override(self, provider: Coroutine) -> OverridingContext: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -161,18 +134,11 @@ class CoroutineDelegate(Delegate):
 | 
				
			||||||
    def __init__(self, coroutine: Coroutine) -> None: ...
 | 
					    def __init__(self, coroutine: Coroutine) -> None: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ConfigurationOption(Provider):
 | 
					class ConfigurationOption(Provider[Any]):
 | 
				
			||||||
    UNDEFINED: object
 | 
					    UNDEFINED: object
 | 
				
			||||||
    def __init__(self, name: Tuple[str], root: Configuration) -> None: ...
 | 
					    def __init__(self, name: Tuple[str], root: Configuration) -> None: ...
 | 
				
			||||||
    def __getattr__(self, item: str) -> ConfigurationOption: ...
 | 
					    def __getattr__(self, item: str) -> ConfigurationOption: ...
 | 
				
			||||||
    def __getitem__(self, item: Union[str, Provider]) -> ConfigurationOption: ...
 | 
					    def __getitem__(self, item: Union[str, Provider]) -> ConfigurationOption: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Any: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[Any]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[Any]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def root(self) -> Configuration: ...
 | 
					    def root(self) -> Configuration: ...
 | 
				
			||||||
    def get_name(self) -> str: ...
 | 
					    def get_name(self) -> str: ...
 | 
				
			||||||
| 
						 | 
					@ -192,18 +158,11 @@ class TypedConfigurationOption(Callable[T]):
 | 
				
			||||||
    def option(self) -> ConfigurationOption: ...
 | 
					    def option(self) -> ConfigurationOption: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Configuration(Object):
 | 
					class Configuration(Object[Any]):
 | 
				
			||||||
    DEFAULT_NAME: str = 'config'
 | 
					    DEFAULT_NAME: str = 'config'
 | 
				
			||||||
    def __init__(self, name: str = DEFAULT_NAME, default: Optional[Any] = None) -> None: ...
 | 
					    def __init__(self, name: str = DEFAULT_NAME, default: Optional[Any] = None) -> None: ...
 | 
				
			||||||
    def __getattr__(self, item: str) -> ConfigurationOption: ...
 | 
					    def __getattr__(self, item: str) -> ConfigurationOption: ...
 | 
				
			||||||
    def __getitem__(self, item: Union[str, Provider]) -> ConfigurationOption: ...
 | 
					    def __getitem__(self, item: Union[str, Provider]) -> ConfigurationOption: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Any: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[Any]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[Any]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def get_name(self) -> str: ...
 | 
					    def get_name(self) -> str: ...
 | 
				
			||||||
    def get(self, selector: str) -> Any: ...
 | 
					    def get(self, selector: str) -> Any: ...
 | 
				
			||||||
    def set(self, selector: str, value: Any) -> OverridingContext: ...
 | 
					    def set(self, selector: str, value: Any) -> OverridingContext: ...
 | 
				
			||||||
| 
						 | 
					@ -215,16 +174,9 @@ class Configuration(Object):
 | 
				
			||||||
    def from_env(self, name: str, default: Optional[Any] = None) -> None: ...
 | 
					    def from_env(self, name: str, default: Optional[Any] = None) -> None: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Factory(Provider, Generic[T]):
 | 
					class Factory(Provider[T]):
 | 
				
			||||||
    provided_type: Optional[Type]
 | 
					    provided_type: Optional[Type]
 | 
				
			||||||
    def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
					    def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def cls(self) -> T: ...
 | 
					    def cls(self) -> T: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
| 
						 | 
					@ -235,21 +187,21 @@ class Factory(Provider, Generic[T]):
 | 
				
			||||||
    def set_args(self, *args: Injection) -> Factory[T]: ...
 | 
					    def set_args(self, *args: Injection) -> Factory[T]: ...
 | 
				
			||||||
    def clear_args(self) -> Factory[T]: ...
 | 
					    def clear_args(self) -> Factory[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def kwargs(self) -> _Dict[str, Injection]: ...
 | 
					    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_kwargs(self, **kwargs: Injection) -> Factory[T]: ...
 | 
					    def add_kwargs(self, **kwargs: Injection) -> Factory[T]: ...
 | 
				
			||||||
    def set_kwargs(self, **kwargs: Injection) -> Factory[T]: ...
 | 
					    def set_kwargs(self, **kwargs: Injection) -> Factory[T]: ...
 | 
				
			||||||
    def clear_kwargs(self) -> Factory[T]: ...
 | 
					    def clear_kwargs(self) -> Factory[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def attributes(self) -> _Dict[str, Injection]: ...
 | 
					    def attributes(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_attributes(self, **kwargs: Injection) -> Factory[T]: ...
 | 
					    def add_attributes(self, **kwargs: Injection) -> Factory[T]: ...
 | 
				
			||||||
    def set_attributes(self, **kwargs: Injection) -> Factory[T]: ...
 | 
					    def set_attributes(self, **kwargs: Injection) -> Factory[T]: ...
 | 
				
			||||||
    def clear_attributes(self) -> Factory[T]: ...
 | 
					    def clear_attributes(self) -> Factory[T]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class DelegatedFactory(Factory): ...
 | 
					class DelegatedFactory(Factory[T]): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AbstractFactory(Factory):
 | 
					class AbstractFactory(Factory[T]):
 | 
				
			||||||
    def override(self, provider: Factory) -> OverridingContext: ...
 | 
					    def override(self, provider: Factory) -> OverridingContext: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -271,16 +223,9 @@ class FactoryAggregate(Provider):
 | 
				
			||||||
    def factories(self) -> _Dict[str, Factory]: ...
 | 
					    def factories(self) -> _Dict[str, Factory]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class BaseSingleton(Provider, Generic[T]):
 | 
					class BaseSingleton(Provider[T]):
 | 
				
			||||||
    provided_type = Optional[Type]
 | 
					    provided_type = Optional[Type]
 | 
				
			||||||
    def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
					    def __init__(self, provides: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def cls(self) -> T: ...
 | 
					    def cls(self) -> T: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
| 
						 | 
					@ -289,12 +234,12 @@ class BaseSingleton(Provider, Generic[T]):
 | 
				
			||||||
    def set_args(self, *args: Injection) -> BaseSingleton[T]: ...
 | 
					    def set_args(self, *args: Injection) -> BaseSingleton[T]: ...
 | 
				
			||||||
    def clear_args(self) -> BaseSingleton[T]: ...
 | 
					    def clear_args(self) -> BaseSingleton[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def kwargs(self) -> _Dict[str, Injection]: ...
 | 
					    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_kwargs(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
					    def add_kwargs(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
				
			||||||
    def set_kwargs(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
					    def set_kwargs(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
				
			||||||
    def clear_kwargs(self) -> BaseSingleton[T]: ...
 | 
					    def clear_kwargs(self) -> BaseSingleton[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def attributes(self) -> _Dict[str, Injection]: ...
 | 
					    def attributes(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_attributes(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
					    def add_attributes(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
				
			||||||
    def set_attributes(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
					    def set_attributes(self, **kwargs: Injection) -> BaseSingleton[T]: ...
 | 
				
			||||||
    def clear_attributes(self) -> BaseSingleton[T]: ...
 | 
					    def clear_attributes(self) -> BaseSingleton[T]: ...
 | 
				
			||||||
| 
						 | 
					@ -327,31 +272,17 @@ class SingletonDelegate(Delegate):
 | 
				
			||||||
    def __init__(self, factory: BaseSingleton): ...
 | 
					    def __init__(self, factory: BaseSingleton): ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class List(Provider):
 | 
					class List(Provider[_List]):
 | 
				
			||||||
    def __init__(self, *args: Injection): ...
 | 
					    def __init__(self, *args: Injection): ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> _List[Any]: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[_List[Any]]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[_List[Any]]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def args(self) -> Tuple[Injection]: ...
 | 
					    def args(self) -> Tuple[Injection]: ...
 | 
				
			||||||
    def add_args(self, *args: Injection) -> List: ...
 | 
					    def add_args(self, *args: Injection) -> List[T]: ...
 | 
				
			||||||
    def set_args(self, *args: Injection) -> List: ...
 | 
					    def set_args(self, *args: Injection) -> List[T]: ...
 | 
				
			||||||
    def clear_args(self) -> List: ...
 | 
					    def clear_args(self) -> List[T]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Dict(Provider):
 | 
					class Dict(Provider[_Dict]):
 | 
				
			||||||
    def __init__(self, dict_: Optional[_Dict[Any, Injection]] = None, **kwargs: Injection): ...
 | 
					    def __init__(self, dict_: Optional[_Dict[Any, Injection]] = None, **kwargs: Injection): ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> _Dict[Any, Any]: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[_Dict[Any, Any]]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[_Dict[Any, Any]]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
					    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_kwargs(self, dict_: Optional[_Dict[Any, Injection]] = None, **kwargs: Injection) -> Dict: ...
 | 
					    def add_kwargs(self, dict_: Optional[_Dict[Any, Injection]] = None, **kwargs: Injection) -> Dict: ...
 | 
				
			||||||
| 
						 | 
					@ -359,7 +290,7 @@ class Dict(Provider):
 | 
				
			||||||
    def clear_kwargs(self) -> Dict: ...
 | 
					    def clear_kwargs(self) -> Dict: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Resource(Provider, Generic[T]):
 | 
					class Resource(Provider[T]):
 | 
				
			||||||
    @overload
 | 
					    @overload
 | 
				
			||||||
    def __init__(self, initializer: _Callable[..., resources.Resource[T]], *args: Injection, **kwargs: Injection) -> None: ...
 | 
					    def __init__(self, initializer: _Callable[..., resources.Resource[T]], *args: Injection, **kwargs: Injection) -> None: ...
 | 
				
			||||||
    @overload
 | 
					    @overload
 | 
				
			||||||
| 
						 | 
					@ -372,54 +303,32 @@ class Resource(Provider, Generic[T]):
 | 
				
			||||||
    def __init__(self, initializer: _Callable[..., _Coroutine[Injection, Injection, T]], *args: Injection, **kwargs: Injection) -> None: ...
 | 
					    def __init__(self, initializer: _Callable[..., _Coroutine[Injection, Injection, T]], *args: Injection, **kwargs: Injection) -> None: ...
 | 
				
			||||||
    @overload
 | 
					    @overload
 | 
				
			||||||
    def __init__(self, initializer: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
					    def __init__(self, initializer: _Callable[..., T], *args: Injection, **kwargs: Injection) -> None: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def args(self) -> Tuple[Injection]: ...
 | 
					    def args(self) -> Tuple[Injection]: ...
 | 
				
			||||||
    def add_args(self, *args: Injection) -> Resource: ...
 | 
					    def add_args(self, *args: Injection) -> Resource[T]: ...
 | 
				
			||||||
    def set_args(self, *args: Injection) -> Resource: ...
 | 
					    def set_args(self, *args: Injection) -> Resource[T]: ...
 | 
				
			||||||
    def clear_args(self) -> Resource: ...
 | 
					    def clear_args(self) -> Resource[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
					    def kwargs(self) -> _Dict[Any, Injection]: ...
 | 
				
			||||||
    def add_kwargs(self, **kwargs: Injection) -> Resource: ...
 | 
					    def add_kwargs(self, **kwargs: Injection) -> Resource[T]: ...
 | 
				
			||||||
    def set_kwargs(self, **kwargs: Injection) -> Resource: ...
 | 
					    def set_kwargs(self, **kwargs: Injection) -> Resource[T]: ...
 | 
				
			||||||
    def clear_kwargs(self) -> Resource: ...
 | 
					    def clear_kwargs(self) -> Resource[T]: ...
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def initialized(self) -> bool: ...
 | 
					    def initialized(self) -> bool: ...
 | 
				
			||||||
    def init(self) -> Optional[Awaitable[T]]: ...
 | 
					    def init(self) -> Optional[Awaitable[T]]: ...
 | 
				
			||||||
    def shutdown(self) -> Optional[Awaitable]: ...
 | 
					    def shutdown(self) -> Optional[Awaitable]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Container(Provider):
 | 
					class Container(Provider[T]):
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def __init__(self, container_cls: Type[T], container: Optional[T] = None, **overriding_providers: Provider) -> None: ...
 | 
					    def __init__(self, container_cls: Type[T], container: Optional[T] = None, **overriding_providers: Provider) -> None: ...
 | 
				
			||||||
    def __getattr__(self, name: str) -> Provider: ...
 | 
					    def __getattr__(self, name: str) -> Provider: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> T: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[T]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def container(self) -> T: ...
 | 
					    def container(self) -> T: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Selector(Provider):
 | 
					class Selector(Provider[Any]):
 | 
				
			||||||
    def __init__(self, selector: _Callable[..., Any], **providers: Provider): ...
 | 
					    def __init__(self, selector: _Callable[..., Any], **providers: Provider): ...
 | 
				
			||||||
    def __getattr__(self, name: str) -> Provider: ...
 | 
					    def __getattr__(self, name: str) -> Provider: ...
 | 
				
			||||||
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Any: ...
 | 
					 | 
				
			||||||
    @overload
 | 
					 | 
				
			||||||
    def __call__(self, *args: Injection, **kwargs: Injection) -> Awaitable[Any]: ...
 | 
					 | 
				
			||||||
    def async_(self, *args: Injection, **kwargs: Injection) -> Awaitable[Any]: ...
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def providers(self) -> _Dict[str, Provider]: ...
 | 
					    def providers(self) -> _Dict[str, Provider]: ...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user