-
Notifications
You must be signed in to change notification settings - Fork 7
/
__init__.pyi
36 lines (33 loc) · 1.05 KB
/
__init__.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import pathlib
from typing import List, Optional, TypeVar, overload
PathLike = TypeVar("PathLike", str, pathlib.Path)
@overload
def compile(
input: PathLike,
output: PathLike,
root: Optional[PathLike] = None,
font_paths: List[PathLike] = [],
) -> None: ...
@overload
def compile(
input: PathLike,
output: None = None,
root: Optional[PathLike] = None,
font_paths: List[PathLike] = [],
) -> bytes: ...
def compile(
input: PathLike,
output: Optional[PathLike] = None,
root: Optional[PathLike] = None,
font_paths: List[PathLike] = [],
) -> Optional[bytes]:
"""Compile a Typst project.
Args:
input (PathLike): Project's main .typ file.
output (Optional[PathLike], optional): Path to save the compiled file.
Allowed extensions are `.pdf`, `.svg` and `.png`
root (Optional[PathLike], optional): Root path for the Typst project.
font_paths (List[PathLike]): Folders with fonts.
Returns:
Optional[bytes]: Return the compiled file as `bytes` if output is `None`.
"""