2023-11-08 11:05:19 -08:00
|
|
|
from typing import IO, Iterator, List
|
2023-09-19 15:32:46 -07:00
|
|
|
|
|
|
|
from docx.oxml.document import CT_Document
|
|
|
|
from docx.section import Sections
|
|
|
|
from docx.settings import Settings
|
2023-11-08 11:05:19 -08:00
|
|
|
from docx.shared import ElementProxy
|
2023-10-12 23:26:14 -07:00
|
|
|
from docx.styles.style import ParagraphStyle
|
2023-11-08 11:05:19 -08:00
|
|
|
from docx.table import Table
|
2023-09-19 15:32:46 -07:00
|
|
|
from docx.text.paragraph import Paragraph
|
|
|
|
|
2023-11-08 11:05:19 -08:00
|
|
|
class Document(ElementProxy):
|
2023-09-19 15:32:46 -07:00
|
|
|
def add_paragraph(
|
2023-10-17 08:45:12 -04:00
|
|
|
self,
|
|
|
|
text: str = "",
|
|
|
|
style: ParagraphStyle | str | None = None,
|
2023-09-19 15:32:46 -07:00
|
|
|
) -> Paragraph: ...
|
|
|
|
@property
|
|
|
|
def element(self) -> CT_Document: ...
|
2023-11-08 11:05:19 -08:00
|
|
|
def iter_inner_content(self) -> Iterator[Paragraph | Table]: ...
|
|
|
|
@property
|
|
|
|
def paragraphs(self) -> List[Paragraph]: ...
|
|
|
|
@property
|
|
|
|
def tables(self) -> List[Table]: ...
|
2023-10-12 23:26:14 -07:00
|
|
|
def save(self, path_or_stream: str | IO[bytes]) -> None: ...
|
2023-09-19 15:32:46 -07:00
|
|
|
@property
|
|
|
|
def sections(self) -> Sections: ...
|
|
|
|
@property
|
|
|
|
def settings(self) -> Settings: ...
|