massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / textwrap.pyi
1 from typing import Callable, Pattern
2
3 class TextWrapper:
4     width: int
5     initial_indent: str
6     subsequent_indent: str
7     expand_tabs: bool
8     replace_whitespace: bool
9     fix_sentence_endings: bool
10     drop_whitespace: bool
11     break_long_words: bool
12     break_on_hyphens: bool
13     tabsize: int
14     max_lines: int | None
15     placeholder: str
16
17     # Attributes not present in documentation
18     sentence_end_re: Pattern[str]
19     wordsep_re: Pattern[str]
20     wordsep_simple_re: Pattern[str]
21     whitespace_trans: str
22     unicode_whitespace_trans: dict[int, int]
23     uspace: int
24     x: str  # leaked loop variable
25     def __init__(
26         self,
27         width: int = ...,
28         initial_indent: str = ...,
29         subsequent_indent: str = ...,
30         expand_tabs: bool = ...,
31         replace_whitespace: bool = ...,
32         fix_sentence_endings: bool = ...,
33         break_long_words: bool = ...,
34         drop_whitespace: bool = ...,
35         break_on_hyphens: bool = ...,
36         tabsize: int = ...,
37         *,
38         max_lines: int | None = ...,
39         placeholder: str = ...,
40     ) -> None: ...
41     # Private methods *are* part of the documented API for subclasses.
42     def _munge_whitespace(self, text: str) -> str: ...
43     def _split(self, text: str) -> list[str]: ...
44     def _fix_sentence_endings(self, chunks: list[str]) -> None: ...
45     def _handle_long_word(self, reversed_chunks: list[str], cur_line: list[str], cur_len: int, width: int) -> None: ...
46     def _wrap_chunks(self, chunks: list[str]) -> list[str]: ...
47     def _split_chunks(self, text: str) -> list[str]: ...
48     def wrap(self, text: str) -> list[str]: ...
49     def fill(self, text: str) -> str: ...
50
51 def wrap(
52     text: str,
53     width: int = ...,
54     *,
55     initial_indent: str = ...,
56     subsequent_indent: str = ...,
57     expand_tabs: bool = ...,
58     tabsize: int = ...,
59     replace_whitespace: bool = ...,
60     fix_sentence_endings: bool = ...,
61     break_long_words: bool = ...,
62     break_on_hyphens: bool = ...,
63     drop_whitespace: bool = ...,
64     max_lines: int = ...,
65     placeholder: str = ...,
66 ) -> list[str]: ...
67 def fill(
68     text: str,
69     width: int = ...,
70     *,
71     initial_indent: str = ...,
72     subsequent_indent: str = ...,
73     expand_tabs: bool = ...,
74     tabsize: int = ...,
75     replace_whitespace: bool = ...,
76     fix_sentence_endings: bool = ...,
77     break_long_words: bool = ...,
78     break_on_hyphens: bool = ...,
79     drop_whitespace: bool = ...,
80     max_lines: int = ...,
81     placeholder: str = ...,
82 ) -> str: ...
83 def shorten(
84     text: str,
85     width: int,
86     *,
87     initial_indent: str = ...,
88     subsequent_indent: str = ...,
89     expand_tabs: bool = ...,
90     tabsize: int = ...,
91     replace_whitespace: bool = ...,
92     fix_sentence_endings: bool = ...,
93     break_long_words: bool = ...,
94     break_on_hyphens: bool = ...,
95     drop_whitespace: bool = ...,
96     # Omit `max_lines: int = None`, it is forced to 1 here.
97     placeholder: str = ...,
98 ) -> str: ...
99 def dedent(text: str) -> str: ...
100 def indent(text: str, prefix: str, predicate: Callable[[str], bool] | None = ...) -> str: ...