diff --git a/src/dependency_injector/providers.pyi b/src/dependency_injector/providers.pyi index e4d62506..8f9b525a 100644 --- a/src/dependency_injector/providers.pyi +++ b/src/dependency_injector/providers.pyi @@ -1,5 +1,6 @@ from __future__ import annotations +from contextlib import AbstractContextManager, AbstractAsyncContextManager from pathlib import Path from typing import ( Awaitable, @@ -465,6 +466,20 @@ class Resource(Provider[T]): **kwargs: Injection, ) -> None: ... @overload + def __init__( + self, + provides: Optional[_Callable[..., AbstractContextManager[T]]] = None, + *args: Injection, + **kwargs: Injection, + ) -> None: ... + @overload + def __init__( + self, + provides: Optional[_Callable[..., AbstractAsyncContextManager[T]]] = None, + *args: Injection, + **kwargs: Injection, + ) -> None: ... + @overload def __init__( self, provides: Optional[_Callable[..., _Iterator[T]]] = None,