8000 Add stubs for fpdf2 by srittau · Pull Request #6252 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
stubtest fixes
  • Loading branch information
srittau committed Nov 7, 2021
commit b029b874efdb62af1af6f67c52a623d76ac58ed8
30 changes: 15 additions & 15 deletions stubs/fpdf2/fpdf/fpdf.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ from typing_extensions import Literal
from .actions import Action
from .util import _Unit

_Orientation = Literal["portrait", "P", "landscape", "L"]
_Format = Literal["a3", "a4", "a5", "letter", "legal"]
_Orientation = Literal["", "portrait", "P", "landscape", "L"]
_Format = Literal["", "a3", "A3", "a4", "A4", "a5", "A5", "letter", "Letter", "legal", "Legal"]
_ 10000 FontStyle = Literal["", "B", "I"]
_FontStyles = Literal["", "B", "I", "U", "BU", "UB", "BI", "IB", "IU", "UI", "BIU", "BUI", "IBU", "IUB", "UBI", "UIB"]
PAGE_FORMATS: dict[_Format, tuple[float, float]]
Expand All @@ -26,26 +26,26 @@ class Annotation(NamedTuple):
y: int
width: int
height: int
contents: str
link: str | int
alt_text: str | None
action: Action | None
contents: str | None = ...
link: str | int | None = ...
alt_text: str | None = ...
action: Action | None = ...

class TitleStyle(NamedTuple):
font_family: str | None
font_style: str | None
font_size_pt: int | None
color: int | tuple[int, int, int]
underline: bool
t_margin: int | None
l_margin: int | None
b_margin: int | None
font_family: str | None = ...
font_style: str | None = ...
font_size_pt: int | None = ...
color: int | tuple[int, int, int] | None = ...
underline: bool = ...
t_margin: int | None = ...
l_margin: int | None = ...
b_margin: int | None = ...

class ToCPlaceholder(NamedTuple):
render_function: Callable[[FPDF, Any], object]
start_page: int
y: int
pages: int
pages: int = ...

class SubsetMap:
def __init__(self, identities: list[int]) -> None: ...
Expand Down
24 changes: 12 additions & 12 deletions stubs/fpdf2/fpdf/outline.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ class OutlineSection(NamedTuple):
level: str
page_number: int
dest: Destination
struct_elem: StructElem | None
struct_elem: StructElem | None = ...

class OutlineItemDictionary(PDFObject):
title: Any
parent: Any
prev: Any
next: Any
first: Any
last: Any
title: str
parent: Any | None
prev: Any | None
next: Any | None
first: Any | None
last: Any | None
count: int
dest: Any
struct_elem: Any
def __init__(self, title: str, dest: str = ..., struct_elem: StructElem = ..., **kwargs) -> None: ...
dest: str | None
struct_elem: StructElem | None
def __init__(self, title: str, dest: str | None = ..., struct_elem: StructElem | None = ..., **kwargs) -> None: ...

class OutlineDictionary(PDFObject):
type: str
first: Any
last: Any
first: Any | None
last: Any | None
count: int
def __init__(self, **kwargs) -> None: ...

Expand Down
12 changes: 6 additions & 6 deletions stubs/fpdf2/fpdf/structure_tree.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class MarkedContent(NamedTuple):
page_object_id: int
struct_parents_id: int
struct_type: str
mcid: int | None
title: str | None
alt_text: str | None
mcid: int | None = ...
title: str | None = ...
alt_text: str | None = ...

class NumberTree(PDFObject):
nums: Any
Expand All @@ -34,9 +34,9 @@ class StructElem(PDFObject):
struct_type: str,
parent: PDFObject,
kids: list[int] | list[StructElem],
page: PDFObject = ...,
title: str = ...,
alt: str = ...,
page: PDFObject | None = ...,
title: str | None = ...,
alt: str | None = ...,
**kwargs,
) -> None: ...

Expand Down
0