Add missing stub on providers.Resource for AbstractContextManager and AbstractAsyncContextManager

This commit is contained in:
Leonardus Chen 2025-10-10 08:43:16 +07:00
parent 5acddac9c1
commit 29827cb411

View File

@ -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,