UNPKG

@maizzle/framework

Version:

Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.

53 lines 2.47 kB
//#region src/components/utils.d.ts declare function normalizeToPixels(value: string | number): string; /** * Module-scoped sequential ID generator. Used by components to mint * unique marker ids (e.g. `c1`, `c2`) for the post-render transformer. * * Must live here (not inside `<script setup>`) because Vue compiles * `<script setup>` into the component's `setup()` function — any * `let counter = 0` there resets per instance, causing id collisions. */ declare function nextId(prefix: string): string; declare function hasWidthUtility(classStr: string): boolean; declare function hasWidthInStyle(styleStr: string): boolean; declare function hasHeightUtility(classStr: string): boolean; declare function hasHeightInStyle(styleStr: string): boolean; /** * Shared prop for components that emit MSO/VML fallback markup. The * `null` default acts as the "unset" sentinel — `useOutlookFallback` * treats `null` as inherit-from-ancestor (root default `true`), * letting users override per-component without losing inheritance. */ declare const outlookFallbackProp: { readonly type: BooleanConstructor; readonly default: null; }; /** * Default utility classes for a code-block `<pre>`. `whitespace-pre!` is * forced important so Gmail's stylesheet can't reset it to `normal`, and * `m-0` strips the browser's default `<pre>` margins so it isn't spaced * away from its wrapper. */ declare function codeBlockPreClass(bg: string): string; /** * Build the email-safe table wrapper around highlighted code. Shared by the * `<CodeBlock>` component and the Markdown fenced/indented code-block * rules so both render identical markup: a full-width table whose * cell carries the theme background, wrapping a `<pre>` styled * with utility classes (not Shiki's raw inline styles). */ declare function buildCodeBlock(codeContent: string, bg: string, options?: { preClass?: string; tdClass?: string; styleAttr?: string; }): string; /** * Re-wrap a Shiki (or plain markdown-it) `<pre><code>` block as a CodeBlock, * pulling the inner code and the theme background out of the highlighted * HTML. Falls back to a white background for unhighlighted blocks. */ declare function shikiToCodeBlock(highlighted: string): string; //#endregion export { buildCodeBlock, codeBlockPreClass, hasHeightInStyle, hasHeightUtility, hasWidthInStyle, hasWidthUtility, nextId, normalizeToPixels, outlookFallbackProp, shikiToCodeBlock }; //# sourceMappingURL=utils.d.ts.map