mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Openpyxl fixes for worksheet and image. (#12363)
This commit is contained in:
@@ -4,6 +4,8 @@ from types import ModuleType
|
||||
from typing import Any, Literal
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from openpyxl.drawing.spreadsheet_drawing import _AnchorBase
|
||||
|
||||
# Is actually PIL.Image.Image
|
||||
_PILImageImage: TypeAlias = Any
|
||||
# same as first parameter of PIL.Image.open
|
||||
@@ -12,7 +14,7 @@ _PILImageFilePath: TypeAlias = str | bytes | Path | SupportsRead[bytes]
|
||||
PILImage: ModuleType | Literal[False]
|
||||
|
||||
class Image:
|
||||
anchor: str
|
||||
anchor: str | _AnchorBase
|
||||
ref: _PILImageImage | _PILImageFilePath
|
||||
width: int
|
||||
height: int
|
||||
|
||||
@@ -86,7 +86,7 @@ class Worksheet(_WorkbookChild):
|
||||
def freeze_panes(self) -> str | None: ...
|
||||
@freeze_panes.setter
|
||||
def freeze_panes(self, topLeftCell: str | Cell | None = ...) -> None: ...
|
||||
def cell(self, row: int, column: int, value: str | None = None) -> Cell: ...
|
||||
def cell(self, row: int, column: int, value: _CellValue | None = None) -> Cell: ...
|
||||
# An int is necessarily a row selection
|
||||
@overload
|
||||
def __getitem__(self, key: int) -> tuple[Cell, ...]: ...
|
||||
@@ -96,7 +96,7 @@ class Worksheet(_WorkbookChild):
|
||||
# A str could be an individual cell, row, column or full range
|
||||
@overload
|
||||
def __getitem__(self, key: str) -> Any: ... # AnyOf[Cell, tuple[Cell, ...], tuple[tuple[Cell, ...], ...]]
|
||||
def __setitem__(self, key: str, value: str) -> None: ...
|
||||
def __setitem__(self, key: str, value: _CellValue) -> None: ...
|
||||
def __iter__(self) -> Iterator[tuple[Cell, ...]]: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user