-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlolhtml.pyi
More file actions
154 lines (140 loc) · 4.17 KB
/
lolhtml.pyi
File metadata and controls
154 lines (140 loc) · 4.17 KB
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
from __future__ import annotations
from typing import (
Any,
Callable,
Optional,
List,
Tuple,
Protocol,
runtime_checkable,
Union,
Iterable,
SupportsIndex,
)
__all__ = [
"ContentType",
"Comment",
"Doctype",
"DocumentEnd",
"Element",
"EndTag",
"TextChunk",
"HTMLRewriter",
"HTMLRewriterOptions",
]
from enum import Enum
class ContentType(Enum):
TEXT = 0
HTML = 1
class Comment:
@property
def text(self) -> str: ...
@text.setter
def text(self, value: str) -> None: ...
def remove(self) -> None: ...
@property
def removed(self) -> bool: ...
def before(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def after(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
class Doctype:
@property
def name(self) -> Optional[str]: ...
@property
def public_id(self) -> Optional[str]: ...
@property
def system_id(self) -> Optional[str]: ...
class DocumentEnd:
def append(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
class Element:
@property
def tag_name(self) -> str: ...
@tag_name.setter
def tag_name(self, value: str) -> None: ...
@property
def removed(self) -> bool: ...
def remove(self) -> None: ...
@property
def namespace_uri(self) -> str: ...
@property
def attributes(self) -> List[Tuple[str, str]]: ...
def get_attribute(self, name: str) -> Optional[str]: ...
def has_attribute(self, name: str) -> bool: ...
def set_attribute(self, name: str, value: str) -> None: ...
def remove_attribute(self, name: str) -> None: ...
def prepend(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def append(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def before(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def after(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def set_inner_content(
self, content: str, content_type: Optional[ContentType] = ...
) -> None: ...
def remove_and_keep_content(self) -> None: ...
class EndTag:
@property
def name(self) -> str: ...
@name.setter
def name(self, value: str) -> None: ...
def before(
self, content: str, content_type: Optional[ContentType] = ...
) -> None: ...
def after(
self, content: str, content_type: Optional[ContentType] = ...
) -> None: ...
def remove(self) -> None: ...
class TextChunk:
@property
def text(self) -> str: ...
@property
def last_in_text_node(self) -> bool: ...
def before(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def after(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def replace(
self, content: str, content_type: Optional[ContentType] = None
) -> None: ...
def remove(self) -> None: ...
@property
def removed(self) -> bool: ...
class HTMLRewriterOptions:
enable_esi_tags: Optional[bool]
def __init__(self, enable_esi_tags: Optional[bool] = None) -> None: ...
class HTMLRewriter:
def __init__(
self,
output_sink: Callable[[Union[bytes, bytearray, Iterable[SupportsIndex]]], Any],
options: Optional[HTMLRewriterOptions] = None,
) -> None: ...
def on(self, selector: str, handlers: Any) -> None: ...
def on_document(self, handlers: Any) -> None: ...
def write(self, chunk: bytes) -> None: ...
def end(self) -> None: ...
@property
def constructed(self) -> bool: ...
@runtime_checkable
class ElementHandler(Protocol):
def element(self, e: Element) -> None: ...
def comments(self, c: Comment) -> None: ...
def text(self, t: TextChunk) -> None: ...
@runtime_checkable
class DocumentHandler(Protocol):
def doctype(self, d: Doctype) -> None: ...
def comments(self, c: Comment) -> None: ...
def text(self, t: TextChunk) -> None: ...
def end(self, e: DocumentEnd) -> None: ...