diff --git a/stubs/fpdf2/fpdf/fpdf.pyi b/stubs/fpdf2/fpdf/fpdf.pyi index b8eaa3fcd..f17a00b03 100644 --- a/stubs/fpdf2/fpdf/fpdf.pyi +++ b/stubs/fpdf2/fpdf/fpdf.pyi @@ -1,7 +1,8 @@ import datetime from _typeshed import StrPath from collections import defaultdict -from collections.abc import Callable, Generator +from collections.abc import Callable +from contextlib import _GeneratorContextManager from enum import IntEnum from io import BytesIO from pathlib import Path @@ -11,6 +12,7 @@ from typing_extensions import Literal from PIL import Image from .actions import Action +from .recorder import FPDFRecorder from .syntax import DestinationXYZ from .util import _Unit @@ -211,7 +213,7 @@ class FPDF: def add_action(self, action, x, y, w, h) -> None: ... def text(self, x, y, txt: str = ...) -> None: ... def rotate(self, angle, x: Any | None = ..., y: Any | None = ...) -> None: ... - def rotation(self, angle, x: Any | None = ..., y: Any | None = ...) -> Generator[None, None, None]: ... + def rotation(self, angle, x: Any | None = ..., y: Any | None = ...) -> _GeneratorContextManager[None]: ... @property def accept_page_break(self): ... def cell( @@ -268,8 +270,8 @@ class FPDF: def normalize_text(self, txt): ... def interleaved2of5(self, txt, x, y, w: int = ..., h: int = ...) -> None: ... def code39(self, txt, x, y, w: float = ..., h: int = ...) -> None: ... - def rect_clip(self, x, y, w, h) -> Generator[None, None, None]: ... - def unbreakable(self) -> Generator[Any, None, None]: ... + def rect_clip(self, x, y, w, h) -> _GeneratorContextManager[None]: ... + def unbreakable(self) -> _GeneratorContextManager[FPDFRecorder]: ... def insert_toc_placeholder(self, render_toc_function, pages: int = ...) -> None: ... def set_section_title_styles( self,