UNPKG

5.92 kBTypeScriptView Raw
1/**
2*/
3export class Comment {
4 static __wrap(ptr: any): any;
5 __destroy_into_raw(): number | undefined;
6 ptr: number | undefined;
7 free(): void;
8 /**
9 * @param {string} content
10 * @param {any | undefined} content_type
11 */
12 before(content: string, content_type: any | undefined): Comment;
13 /**
14 * @param {string} content
15 * @param {any | undefined} content_type
16 */
17 after(content: string, content_type: any | undefined): Comment;
18 /**
19 * @param {string} content
20 * @param {any | undefined} content_type
21 */
22 replace(content: string, content_type: any | undefined): Comment;
23 /**
24 */
25 remove(): Comment;
26 /**
27 * @returns {boolean}
28 */
29 get removed(): boolean;
30 /**
31 * @param {string} text
32 */
33 set text(arg: string);
34 /**
35 * @returns {string}
36 */
37 get text(): string;
38}
39/**
40*/
41export class Doctype {
42 static __wrap(ptr: any): any;
43 __destroy_into_raw(): number | undefined;
44 ptr: number | undefined;
45 free(): void;
46 /**
47 * @returns {any}
48 */
49 get name(): any;
50 /**
51 * @returns {any}
52 */
53 get publicId(): any;
54 /**
55 * @returns {any}
56 */
57 get systemId(): any;
58}
59/**
60*/
61export class DocumentEnd {
62 static __wrap(ptr: any): any;
63 __destroy_into_raw(): number | undefined;
64 ptr: number | undefined;
65 free(): void;
66 /**
67 * @param {string} content
68 * @param {any | undefined} content_type
69 */
70 append(content: string, content_type: any | undefined): DocumentEnd;
71}
72/**
73*/
74export class Element {
75 static __wrap(ptr: any): any;
76 __destroy_into_raw(): number | undefined;
77 ptr: number | undefined;
78 free(): void;
79 /**
80 * @param {string} content
81 * @param {any | undefined} content_type
82 */
83 before(content: string, content_type: any | undefined): Element;
84 /**
85 * @param {string} content
86 * @param {any | undefined} content_type
87 */
88 after(content: string, content_type: any | undefined): Element;
89 /**
90 * @param {string} content
91 * @param {any | undefined} content_type
92 */
93 replace(content: string, content_type: any | undefined): Element;
94 /**
95 */
96 remove(): Element;
97 /**
98 * @returns {boolean}
99 */
100 get removed(): boolean;
101 /**
102 * @param {string} name
103 */
104 set tagName(arg: string);
105 /**
106 * @returns {string}
107 */
108 get tagName(): string;
109 /**
110 * @returns {any}
111 */
112 get namespaceURI(): any;
113 /**
114 * @returns {any}
115 */
116 get attributes(): any;
117 /**
118 * @param {string} name
119 * @returns {any}
120 */
121 getAttribute(name: string): any;
122 /**
123 * @param {string} name
124 * @returns {boolean}
125 */
126 hasAttribute(name: string): boolean;
127 /**
128 * @param {string} name
129 * @param {string} value
130 */
131 setAttribute(name: string, value: string): Element;
132 /**
133 * @param {string} name
134 */
135 removeAttribute(name: string): Element;
136 /**
137 * @param {string} content
138 * @param {any | undefined} content_type
139 */
140 prepend(content: string, content_type: any | undefined): Element;
141 /**
142 * @param {string} content
143 * @param {any | undefined} content_type
144 */
145 append(content: string, content_type: any | undefined): Element;
146 /**
147 * @param {string} content
148 * @param {any | undefined} content_type
149 */
150 setInnerContent(content: string, content_type: any | undefined): Element;
151 /**
152 */
153 removeAndKeepContent(): Element;
154 /**
155 * @param {any} handler
156 */
157 onEndTag(handler: any): void;
158}
159/**
160*/
161export class EndTag {
162 static __wrap(ptr: any): any;
163 __destroy_into_raw(): number | undefined;
164 ptr: number | undefined;
165 free(): void;
166 /**
167 * @param {string} name
168 */
169 set name(arg: string);
170 /**
171 * @returns {string}
172 */
173 get name(): string;
174 /**
175 * @param {string} content
176 * @param {any | undefined} content_type
177 */
178 before(content: string, content_type: any | undefined): EndTag;
179 /**
180 * @param {string} content
181 * @param {any | undefined} content_type
182 */
183 after(content: string, content_type: any | undefined): EndTag;
184 /**
185 */
186 remove(): EndTag;
187}
188/**
189*/
190export class HTMLRewriter {
191 static __wrap(ptr: any): any;
192 /**
193 * @param {any} output_sink
194 * @param {any | undefined} options
195 */
196 constructor(output_sink: any, options: any | undefined);
197 __destroy_into_raw(): number | undefined;
198 ptr: number | undefined;
199 free(): void;
200 /**
201 * @param {string} selector
202 * @param {any} handlers
203 */
204 on(selector: string, handlers: any): HTMLRewriter;
205 /**
206 * @param {any} handlers
207 */
208 onDocument(handlers: any): HTMLRewriter;
209 /**
210 * @param {Uint8Array} chunk
211 */
212 write(chunk: Uint8Array): Promise<void>;
213 /**
214 */
215 end(): Promise<void>;
216 /**
217 * @returns {number}
218 */
219 get asyncifyStackPtr(): number;
220}
221/**
222*/
223export class TextChunk {
224 static __wrap(ptr: any): any;
225 __destroy_into_raw(): number | undefined;
226 ptr: number | undefined;
227 free(): void;
228 /**
229 * @param {string} content
230 * @param {any | undefined} content_type
231 */
232 before(content: string, content_type: any | undefined): TextChunk;
233 /**
234 * @param {string} content
235 * @param {any | undefined} content_type
236 */
237 after(content: string, content_type: any | undefined): TextChunk;
238 /**
239 * @param {string} content
240 * @param {any | undefined} content_type
241 */
242 replace(content: string, content_type: any | undefined): TextChunk;
243 /**
244 */
245 remove(): TextChunk;
246 /**
247 * @returns {boolean}
248 */
249 get removed(): boolean;
250 /**
251 * @returns {string}
252 */
253 get text(): string;
254 /**
255 * @returns {boolean}
256 */
257 get lastInTextNode(): boolean;
258}
259export default init;
260declare function init(input: any): Promise<WebAssembly.Exports>;