@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
20 lines • 915 B
text/typescript
/**
* Compress a JSON string using DEFLATE with the shared HAST dictionary.
* Returns a base64-encoded string suitable for embedding in serialized props.
*
* When `textContent` is provided, the text is prepended to the static
* dictionary for better compression of payloads that repeat their own text.
* A 4-byte checksum is embedded so `decompressHast` can verify the same
* `textContent` was supplied.
*
* When `textContent` is omitted, only the static dictionary is used and no
* checksum is embedded (opt-out / backward-compatible path).
*/
export declare function compressHast(json: string, textContent?: string): string;
/**
* Compress a string asynchronously using DEFLATE with the shared HAST
* dictionary. Returns a base64-encoded string.
*
* See `compressHast` for `textContent` semantics.
*/
export declare function compressHastAsync(input: string, textContent?: string): Promise<string>;