mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Add types to some tkinter.Text methods. (#10946)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -3064,11 +3064,40 @@ class Text(Widget, XView, YView):
|
||||
def edit_separator(self) -> None: ... # actually returns empty string
|
||||
def edit_undo(self) -> None: ... # actually returns empty string
|
||||
def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ...
|
||||
# TODO: image_* methods
|
||||
def image_cget(self, index, option): ...
|
||||
def image_configure(self, index, cnf: Incomplete | None = None, **kw): ...
|
||||
def image_create(self, index, cnf={}, **kw): ...
|
||||
def image_names(self): ...
|
||||
@overload
|
||||
def image_cget(self, index: _TextIndex, option: Literal["image", "name"]) -> str: ...
|
||||
@overload
|
||||
def image_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ...
|
||||
@overload
|
||||
def image_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ...
|
||||
@overload
|
||||
def image_cget(self, index: _TextIndex, option: str) -> Any: ...
|
||||
@overload
|
||||
def image_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ...
|
||||
@overload
|
||||
def image_configure(
|
||||
self,
|
||||
index: _TextIndex,
|
||||
cnf: dict[str, Any] | None = {},
|
||||
*,
|
||||
align: Literal["baseline", "bottom", "center", "top"] = ...,
|
||||
image: _ImageSpec = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
) -> dict[str, tuple[str, str, str, str, str | int]] | None: ...
|
||||
def image_create(
|
||||
self,
|
||||
index: _TextIndex,
|
||||
cnf: dict[str, Any] | None = {},
|
||||
*,
|
||||
align: Literal["baseline", "bottom", "center", "top"] = ...,
|
||||
image: _ImageSpec = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
) -> str: ...
|
||||
def image_names(self) -> tuple[str, ...]: ...
|
||||
def index(self, index: _TextIndex) -> str: ...
|
||||
def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
@overload
|
||||
@@ -3166,12 +3195,45 @@ class Text(Widget, XView, YView):
|
||||
def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ...
|
||||
# tag_remove and tag_delete are different
|
||||
def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ...
|
||||
# TODO: window_* methods
|
||||
def window_cget(self, index, option): ...
|
||||
def window_configure(self, index, cnf: Incomplete | None = None, **kw): ...
|
||||
@overload
|
||||
def window_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ...
|
||||
@overload
|
||||
def window_cget(self, index: _TextIndex, option: Literal["stretch"]) -> bool: ... # actually returns Literal[0, 1]
|
||||
@overload
|
||||
def window_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ...
|
||||
@overload # window is set to a widget, but read as the string name.
|
||||
def window_cget(self, index: _TextIndex, option: Literal["create", "window"]) -> str: ...
|
||||
@overload
|
||||
def window_cget(self, index: _TextIndex, option: str) -> Any: ...
|
||||
@overload
|
||||
def window_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ...
|
||||
@overload
|
||||
def window_configure(
|
||||
self,
|
||||
index: _TextIndex,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
align: Literal["baseline", "bottom", "center", "top"] = ...,
|
||||
create: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
stretch: bool | Literal[0, 1] = ...,
|
||||
window: Misc | str = ...,
|
||||
) -> dict[str, tuple[str, str, str, str, str | int]] | None: ...
|
||||
window_config = window_configure
|
||||
def window_create(self, index, cnf={}, **kw) -> None: ...
|
||||
def window_names(self): ...
|
||||
def window_create(
|
||||
self,
|
||||
index: _TextIndex,
|
||||
cnf: dict[str, Any] | None = {},
|
||||
*,
|
||||
align: Literal["baseline", "bottom", "center", "top"] = ...,
|
||||
create: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
stretch: bool | Literal[0, 1] = ...,
|
||||
window: Misc | str = ...,
|
||||
) -> None: ...
|
||||
def window_names(self) -> tuple[str, ...]: ...
|
||||
def yview_pickplace(self, *what): ... # deprecated
|
||||
|
||||
class _setit:
|
||||
|
||||
Reference in New Issue
Block a user