1 |
|
2 |
|
3 | export declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
|
4 | export interface HydrateDocumentOptions {
|
5 | |
6 |
|
7 |
|
8 |
|
9 | buildId?: string;
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | canonicalUrl?: string;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 | clientHydrateAnnotations?: boolean;
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 | constrainTimeouts?: boolean;
|
28 | |
29 |
|
30 |
|
31 | cookie?: string;
|
32 | |
33 |
|
34 |
|
35 | direction?: string;
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 | excludeComponents?: string[];
|
42 | |
43 |
|
44 |
|
45 | language?: string;
|
46 | |
47 |
|
48 |
|
49 | maxHydrateCount?: number;
|
50 | |
51 |
|
52 |
|
53 | referrer?: string;
|
54 | |
55 |
|
56 |
|
57 | removeScripts?: boolean;
|
58 | |
59 |
|
60 |
|
61 | removeUnusedStyles?: boolean;
|
62 | |
63 |
|
64 |
|
65 | resourcesUrl?: string;
|
66 | |
67 |
|
68 |
|
69 | runtimeLogging?: boolean;
|
70 | |
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | staticComponents?: string[];
|
78 | |
79 |
|
80 |
|
81 |
|
82 | timeout?: number;
|
83 | |
84 |
|
85 |
|
86 | title?: string;
|
87 | |
88 |
|
89 |
|
90 | url?: string;
|
91 | |
92 |
|
93 |
|
94 | userAgent?: string;
|
95 | }
|
96 | export interface SerializeDocumentOptions extends HydrateDocumentOptions {
|
97 | |
98 |
|
99 |
|
100 | afterHydrate?(document: any): any | Promise<any>;
|
101 | |
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 | approximateLineWidth?: number;
|
109 | |
110 |
|
111 |
|
112 | beforeHydrate?(document: any): any | Promise<any>;
|
113 | |
114 |
|
115 |
|
116 |
|
117 | prettyHtml?: boolean;
|
118 | |
119 |
|
120 |
|
121 |
|
122 | removeAttributeQuotes?: boolean;
|
123 | |
124 |
|
125 |
|
126 |
|
127 | removeBooleanAttributeQuotes?: boolean;
|
128 | |
129 |
|
130 |
|
131 |
|
132 | removeEmptyAttributes?: boolean;
|
133 | |
134 |
|
135 |
|
136 | removeHtmlComments?: boolean;
|
137 | }
|
138 | export interface HydrateFactoryOptions extends SerializeDocumentOptions {
|
139 | serializeToHtml: boolean;
|
140 | destroyWindow: boolean;
|
141 | destroyDocument: boolean;
|
142 | }
|
143 | export interface Diagnostic {
|
144 | absFilePath?: string | undefined;
|
145 | code?: string;
|
146 | columnNumber?: number | undefined;
|
147 | debugText?: string;
|
148 | header?: string;
|
149 | language?: string;
|
150 | level: "error" | "warn" | "info" | "log" | "debug";
|
151 | lineNumber?: number | undefined;
|
152 | lines: PrintLine[];
|
153 | messageText: string;
|
154 | relFilePath?: string | undefined;
|
155 | type: string;
|
156 | }
|
157 | export interface PrintLine {
|
158 | lineIndex: number;
|
159 | lineNumber: number;
|
160 | text?: string;
|
161 | errorCharStart: number;
|
162 | errorLength?: number;
|
163 | }
|
164 | export interface HydrateResults {
|
165 | buildId: string;
|
166 | diagnostics: Diagnostic[];
|
167 | url: string;
|
168 | host: string;
|
169 | hostname: string;
|
170 | href: string;
|
171 | port: string;
|
172 | pathname: string;
|
173 | search: string;
|
174 | hash: string;
|
175 | html: string;
|
176 | components: HydrateComponent[];
|
177 | anchors: HydrateAnchorElement[];
|
178 | imgs: HydrateImgElement[];
|
179 | scripts: HydrateScriptElement[];
|
180 | styles: HydrateStyleElement[];
|
181 | staticData: HydrateStaticData[];
|
182 | title: string;
|
183 | hydratedCount: number;
|
184 | httpStatus: number;
|
185 | }
|
186 | export interface HydrateComponent {
|
187 | tag: string;
|
188 | mode: string;
|
189 | count: number;
|
190 | depth: number;
|
191 | }
|
192 | export interface HydrateElement {
|
193 | [attrName: string]: string | undefined;
|
194 | }
|
195 | export interface HydrateAnchorElement extends HydrateElement {
|
196 | href?: string;
|
197 | target?: string;
|
198 | }
|
199 | export interface HydrateImgElement extends HydrateElement {
|
200 | src?: string;
|
201 | }
|
202 | export interface HydrateScriptElement extends HydrateElement {
|
203 | src?: string;
|
204 | type?: string;
|
205 | }
|
206 | export interface HydrateStyleElement extends HydrateElement {
|
207 | href?: string;
|
208 | }
|
209 | export interface HydrateStaticData {
|
210 | id: string;
|
211 | type: string;
|
212 | content: string;
|
213 | }
|
214 | export declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<HydrateResults>;
|
215 | export declare function hydrateDocument(doc: any | string, options?: HydrateDocumentOptions): Promise<HydrateResults>;
|
216 | export declare function serializeDocumentToString(doc: any, opts: HydrateFactoryOptions): string;
|
217 |
|
218 | export {};
|