aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/yaml-stubs/emitter.pyi
blob: ee8f9403b616cbcf40d87f8f23569cfc48e39def (about) (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
from collections.abc import Callable
from typing import Any, NoReturn, Protocol, TypeVar

from yaml.error import YAMLError

from .events import Event

_T_contra = TypeVar("_T_contra", str, bytes, contravariant=True)

class _WriteStream(Protocol[_T_contra]):
    def write(self, data: _T_contra, /) -> object: ...
    # Optional fields:
    # encoding: str
    # def flush(self) -> object: ...

class EmitterError(YAMLError): ...

class ScalarAnalysis:
    scalar: Any
    empty: Any
    multiline: Any
    allow_flow_plain: Any
    allow_block_plain: Any
    allow_single_quoted: Any
    allow_double_quoted: Any
    allow_block: Any
    def __init__(
        self, scalar, empty, multiline, allow_flow_plain, allow_block_plain, allow_single_quoted, allow_double_quoted, allow_block
    ) -> None: ...

class Emitter:
    DEFAULT_TAG_PREFIXES: dict[str, str]
    stream: _WriteStream[Any]
    encoding: str | None
    states: list[Callable[[], None]]
    state: Callable[[], None] | None
    events: list[Event]
    event: Event | None
    indents: list[int | None]
    indent: int | None
    flow_level: int
    root_context: bool
    sequence_context: bool
    mapping_context: bool
    simple_key_context: bool
    line: int
    column: int
    whitespace: bool
    indention: bool
    open_ended: bool
    canonical: bool | None
    allow_unicode: bool | None
    best_indent: int
    best_width: int
    best_line_break: str
    tag_prefixes: dict[str, str] | None
    prepared_anchor: str | None
    prepared_tag: str | None
    analysis: ScalarAnalysis | None
    style: str | None
    def __init__(
        self,
        stream: _WriteStream[Any],
        canonical: bool | None = ...,
        indent: int | None = ...,
        width: int | None = ...,
        allow_unicode: bool | None = ...,
        line_break: str | None = ...,
    ) -> None: ...
    def dispose(self) -> None: ...
    def emit(self, event: Event) -> None: ...
    def need_more_events(self) -> bool: ...
    def need_events(self, count: int) -> bool: ...
    def increase_indent(self, flow: bool = ..., indentless: bool = ...) -> None: ...
    def expect_stream_start(self) -> None: ...
    def expect_nothing(self) -> NoReturn: ...
    def expect_first_document_start(self) -> None: ...
    def expect_document_start(self, first: bool = False) -> None: ...
    def expect_document_end(self) -> None: ...
    def expect_document_root(self) -> None: ...
    def expect_node(self, root: bool = ..., sequence: bool = ..., mapping: bool = ..., simple_key: bool = ...) -> None: ...
    def expect_alias(self) -> None: ...
    def expect_scalar(self) -> None: ...
    def expect_flow_sequence(self) -> None: ...
    def expect_first_flow_sequence_item(self) -> None: ...
    def expect_flow_sequence_item(self) -> None: ...
    def expect_flow_mapping(self) -> None: ...
    def expect_first_flow_mapping_key(self) -> None: ...
    def expect_flow_mapping_key(self) -> None: ...
    def expect_flow_mapping_simple_value(self) -> None: ...
    def expect_flow_mapping_value(self) -> None: ...
    def expect_block_sequence(self) -> None: ...
    def expect_first_block_sequence_item(self) -> None: ...
    def expect_block_sequence_item(self, first: bool = ...) -> None: ...
    def expect_block_mapping(self) -> None: ...
    def expect_first_block_mapping_key(self) -> None: ...
    def expect_block_mapping_key(self, first: bool = ...) -> None: ...
    def expect_block_mapping_simple_value(self) -> None: ...
    def expect_block_mapping_value(self) -> None: ...
    def check_empty_sequence(self) -> bool: ...
    def check_empty_mapping(self) -> bool: ...
    def check_empty_document(self) -> bool: ...
    def check_simple_key(self) -> bool: ...
    def process_anchor(self, indicator: str) -> None: ...
    def process_tag(self) -> None: ...
    def choose_scalar_style(self) -> str: ...
    def process_scalar(self) -> None: ...
    def prepare_version(self, version) -> str: ...
    def prepare_tag_handle(self, handle: str) -> str: ...
    def prepare_tag_prefix(self, prefix: str) -> str: ...
    def prepare_tag(self, tag: str) -> str: ...
    def prepare_anchor(self, anchor: str) -> str: ...
    def analyze_scalar(self, scalar: str) -> ScalarAnalysis: ...
    def flush_stream(self) -> None: ...
    def write_stream_start(self) -> None: ...
    def write_stream_end(self) -> None: ...
    def write_indicator(self, indicator: str, need_whitespace: bool, whitespace: bool = ..., indention: bool = ...) -> None: ...
    def write_indent(self) -> None: ...
    def write_line_break(self, data: str | None = ...) -> None: ...
    def write_version_directive(self, version_text: str) -> None: ...
    def write_tag_directive(self, handle_text: str, prefix_text: str) -> None: ...
    def write_single_quoted(self, text: str, split: bool = ...) -> None: ...
    ESCAPE_REPLACEMENTS: dict[str, str]
    def write_double_quoted(self, text: str, split: bool = ...) -> None: ...
    def determine_block_hints(self, text: str) -> str: ...
    def write_folded(self, text: str) -> None: ...
    def write_literal(self, text: str) -> None: ...
    def write_plain(self, text: str, split: bool = ...) -> None: ...