mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 20:45:49 +08:00
[docker-py] Fix Container.top() return type (#15067)
This commit is contained in:
committed by
GitHub
parent
6f7cecb63c
commit
c10e3685c4
@@ -16,6 +16,11 @@ class _HasId(TypedDict):
|
||||
class _HasID(TypedDict):
|
||||
ID: str
|
||||
|
||||
@type_check_only
|
||||
class _TopResult(TypedDict):
|
||||
Titles: list[str]
|
||||
Processes: list[list[str]]
|
||||
|
||||
_Container: TypeAlias = _HasId | _HasID | str
|
||||
|
||||
class ContainerApiMixin:
|
||||
@@ -145,7 +150,7 @@ class ContainerApiMixin:
|
||||
def start(self, container: _Container) -> None: ...
|
||||
def stats(self, container: _Container, decode: bool | None = None, stream: bool = True, one_shot: bool | None = None): ...
|
||||
def stop(self, container: _Container, timeout: int | None = None) -> None: ...
|
||||
def top(self, container: _Container, ps_args: str | None = None) -> str: ...
|
||||
def top(self, container: _Container, ps_args: str | None = None) -> _TopResult: ...
|
||||
def unpause(self, container: _Container) -> None: ...
|
||||
def update_container(
|
||||
self,
|
||||
|
||||
@@ -18,6 +18,11 @@ class _RestartPolicy(TypedDict):
|
||||
MaximumRetryCount: NotRequired[int]
|
||||
Name: NotRequired[Literal["always", "on-failure"]]
|
||||
|
||||
@type_check_only
|
||||
class _TopResult(TypedDict):
|
||||
Titles: list[str]
|
||||
Processes: list[list[str]]
|
||||
|
||||
class Container(Model):
|
||||
@property
|
||||
def name(self) -> str | None: ...
|
||||
@@ -91,7 +96,7 @@ class Container(Model):
|
||||
def start(self) -> None: ...
|
||||
def stats(self, **kwargs): ...
|
||||
def stop(self, *, timeout: float | None = None) -> None: ...
|
||||
def top(self, *, ps_args: str | None = None) -> str: ...
|
||||
def top(self, *, ps_args: str | None = None) -> _TopResult: ...
|
||||
def unpause(self): ...
|
||||
def update(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user