@public-ui/hydrate 3.1.0-rc.0 → 3.1.0
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 +12 -0
- package/dist/index.js +5408 -966
- package/dist/index.mjs +5407 -967
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
|
|
5
5
|
export declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
|
|
6
|
+
export type TagTransformer = (tag: string) => string;
|
|
6
7
|
/**
|
|
7
8
|
* Serialize a value to a string that can be deserialized later.
|
|
8
9
|
* @param {unknown} value - The value to serialize.
|
|
@@ -271,5 +272,16 @@ export declare function renderToString(html: string | any, options: SerializeDoc
|
|
|
271
272
|
export declare function hydrateDocument(doc: any | string, options?: HydrateDocumentOptions): Promise<HydrateResults>;
|
|
272
273
|
export declare function hydrateDocument(doc: any | string, options: HydrateDocumentOptions | undefined, asStream?: boolean): Readable;
|
|
273
274
|
export declare function serializeDocumentToString(doc: Document, opts: HydrateFactoryOptions): string;
|
|
275
|
+
/**
|
|
276
|
+
* Transforms a tag name using the current tag transformer
|
|
277
|
+
* @param tag - the tag to transform e.g. `my-tag`
|
|
278
|
+
* @returns the transformed tag e.g. `new-my-tag`
|
|
279
|
+
*/
|
|
280
|
+
export declare function transformTag<T extends string>(tag: T): T;
|
|
281
|
+
/**
|
|
282
|
+
* Sets the tag transformer to be used when rendering custom elements
|
|
283
|
+
* @param transformer the transformer function to use. Must return a string
|
|
284
|
+
*/
|
|
285
|
+
export declare function setTagTransformer(transformer: TagTransformer): void;
|
|
274
286
|
|
|
275
287
|
export {};
|