@public-ui/hydrate 2.1.5 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import { Readable } from 'node:stream';
4
+
3
5
  export declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
4
6
  export interface HydrateDocumentOptions {
5
7
  /**
@@ -134,6 +136,19 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
134
136
  * Remove HTML comments. Defaults to `true`.
135
137
  */
136
138
  removeHtmlComments?: boolean;
139
+ /**
140
+ * If set to `false` Stencil will ignore the fact that a component has a `shadow: true`
141
+ * flag and serializes it as a scoped component. If set to `true` the component will
142
+ * be rendered within a Declarative Shadow DOM.
143
+ * @default false
144
+ */
145
+ serializeShadowRoot?: boolean;
146
+ /**
147
+ * The `fullDocument` flag determines the format of the rendered output. Set it to true to
148
+ * generate a complete HTML document, or false to render only the component.
149
+ * @default true
150
+ */
151
+ fullDocument?: boolean;
137
152
  }
138
153
  export interface HydrateFactoryOptions extends SerializeDocumentOptions {
139
154
  serializeToHtml: boolean;
@@ -165,23 +180,23 @@ export interface HydrateResults {
165
180
  buildId: string;
166
181
  diagnostics: Diagnostic[];
167
182
  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;
183
+ host: string | null;
184
+ hostname: string | null;
185
+ href: string | null;
186
+ port: string | null;
187
+ pathname: string | null;
188
+ search: string | null;
189
+ hash: string | null;
190
+ html: string | null;
176
191
  components: HydrateComponent[];
177
192
  anchors: HydrateAnchorElement[];
178
193
  imgs: HydrateImgElement[];
179
194
  scripts: HydrateScriptElement[];
180
195
  styles: HydrateStyleElement[];
181
196
  staticData: HydrateStaticData[];
182
- title: string;
197
+ title: string | null;
183
198
  hydratedCount: number;
184
- httpStatus: number;
199
+ httpStatus: number | null;
185
200
  }
186
201
  export interface HydrateComponent {
187
202
  tag: string;
@@ -211,8 +226,11 @@ export interface HydrateStaticData {
211
226
  type: string;
212
227
  content: string;
213
228
  }
229
+ export declare function streamToString(html: string | any, option?: SerializeDocumentOptions): Readable;
214
230
  export declare function renderToString(html: string | any, options?: SerializeDocumentOptions): Promise<HydrateResults>;
231
+ export declare function renderToString(html: string | any, options: SerializeDocumentOptions | undefined, asStream: true): Readable;
215
232
  export declare function hydrateDocument(doc: any | string, options?: HydrateDocumentOptions): Promise<HydrateResults>;
216
- export declare function serializeDocumentToString(doc: any, opts: HydrateFactoryOptions): string;
233
+ export declare function hydrateDocument(doc: any | string, options: HydrateDocumentOptions | undefined, asStream?: boolean): Readable;
234
+ export declare function serializeDocumentToString(doc: Document, opts: HydrateFactoryOptions): string;
217
235
 
218
236
  export {};