Skip to content

Commit f750a13

Browse files
committed
Start adding a few type hints for HTML
1 parent fb0176b commit f750a13

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

stubs/weasyprint/weasyprint/__init__.pyi

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from _typeshed import Incomplete
2+
from pathlib import Path
23

34
from .document import Document as Document, Page as Page
45
from .urls import default_url_fetcher as default_url_fetcher
@@ -18,19 +19,19 @@ class HTML:
1819
def __init__(
1920
self,
2021
guess=None,
21-
filename=None,
22-
url=None,
22+
filename: str | Path | None = None,
23+
url: str | None = None,
2324
file_obj=None,
24-
string=None,
25-
encoding=None,
26-
base_url=None,
25+
string: str | None = None,
26+
encoding: str | None = None,
27+
base_url: str | Path | None = None,
2728
url_fetcher=None,
2829
media_type: str = "print",
2930
) -> None: ...
30-
def render(self, font_config=None, counter_style=None, color_profiles=None, **options): ...
31+
def render(self, font_config=None, counter_style=None, color_profiles=None, **options) -> Document: ...
3132
def write_pdf(
3233
self, target=None, zoom: int = 1, finisher=None, font_config=None, counter_style=None, color_profiles=None, **options
33-
): ...
34+
) -> bytes | None: ...
3435

3536
class CSS:
3637
base_url: Incomplete

0 commit comments

Comments
 (0)