massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / docutils / docutils / io.pyi
1 from _typeshed import OpenBinaryModeReading, OpenBinaryModeWriting, OpenTextModeReading, OpenTextModeWriting
2 from typing import Any, ClassVar
3
4 from docutils import TransformSpec
5
6 __docformat__: str
7
8 class InputError(IOError): ...
9 class OutputError(IOError): ...
10
11 def check_encoding(stream: Any, encoding: str) -> bool | None: ...
12
13 class Input(TransformSpec):
14     component_type: ClassVar[str]
15     default_source_path: ClassVar[str | None]
16     def read(self) -> Any: ...
17     def __getattr__(self, name: str) -> Any: ...  # incomplete
18
19 class Output(TransformSpec):
20     component_type: ClassVar[str]
21     default_destination_path: ClassVar[str | None]
22     def __init__(
23         self,
24         destination: Any | None = ...,
25         destination_path: Any | None = ...,
26         encoding: str | None = ...,
27         error_handler: str = ...,
28     ) -> None: ...
29     def write(self, data: str) -> Any: ...  # returns bytes or str
30     def encode(self, data: str) -> Any: ...  # returns bytes or str
31
32 class FileInput(Input):
33     def __init__(
34         self,
35         source: Any | None = ...,
36         source_path: Any | None = ...,
37         encoding: str | None = ...,
38         error_handler: str = ...,
39         autoclose: bool = ...,
40         mode: OpenTextModeReading | OpenBinaryModeReading = ...,
41     ) -> None: ...
42     def readlines(self) -> list[str]: ...
43     def close(self) -> None: ...
44
45 class FileOutput(Output):
46     mode: ClassVar[OpenTextModeWriting | OpenBinaryModeWriting]
47     def __getattr__(self, name: str) -> Any: ...  # incomplete
48
49 class BinaryFileOutput(FileOutput): ...
50
51 class StringInput(Input):
52     default_source_path: ClassVar[str]
53
54 class StringOutput(Output):
55     default_destination_path: ClassVar[str]
56     destination: str | bytes  # only defined after call to write()
57
58 class NullInput(Input):
59     default_source_path: ClassVar[str]
60     def read(self) -> str: ...
61
62 class NullOutput(Output):
63     default_destination_path: ClassVar[str]
64     def write(self, data: object) -> None: ...
65
66 class DocTreeInput(Input):
67     default_source_path: ClassVar[str]