@maizzle/framework
Version:
Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.
50 lines (49 loc) • 1.93 kB
TypeScript
import { MaizzleConfig, MarkdownConfig } from "../types/config.js";
import { RenderContext } from "../composables/renderContext.js";
import { NormalizedComponentSource } from "../utils/componentSources.js";
import { Component } from "vue";
import { InlineConfig } from "vite";
//#region src/render/createRenderer.d.ts
interface RenderedTemplate {
html: string;
doctype?: string;
templateConfig: MaizzleConfig;
sfcEventHandlers: RenderContext['sfcEventHandlers'];
plaintext?: RenderContext['plaintext'];
outputPath?: RenderContext['outputPath'];
tailwindBlocks?: RenderContext['tailwindBlocks'];
}
interface Renderer {
render(input: string | Component, config: MaizzleConfig, opts?: {
source?: string;
props?: Record<string, any>;
}): Promise<RenderedTemplate>;
invalidate(filePath: string): Promise<void>;
invalidateAll(): Promise<void>;
close(): Promise<void>;
}
interface CreateRendererOptions {
/** Generate .d.ts files for auto-imports and components (default: false) */
dts?: boolean;
/** Options passed to unplugin-vue-markdown */
markdown?: MarkdownConfig;
/** Root directory for resolving user component dirs and .d.ts output */
root?: string;
/**
* Additional component sources to register for auto-import. Already
* normalized — pass through `normalizeComponentSources()` first.
*/
componentDirs?: NormalizedComponentSource[];
/** User Vite config options to merge into the internal SSR server */
vite?: InlineConfig;
}
/**
* Lightweight Vite SSR loader for rendering Vue SFC email templates.
*
* Uses only Vue + unplugin for component/auto-import resolution.
* Tailwind CSS compilation is handled by the transformer pipeline.
*/
declare function createRenderer(options?: CreateRendererOptions): Promise<Renderer>;
//#endregion
export { CreateRendererOptions, RenderedTemplate, Renderer, createRenderer };
//# sourceMappingURL=createRenderer.d.ts.map