/**
 * @create-markdown/preview - Plugin Types
 * Plugin interface for extending preview rendering
 */
import type { Block } from '@create-markdown/core';
/**
 * Plugin for extending preview rendering
 */
export interface PreviewPlugin {
    /** Unique plugin name */
    name: string;
    /** Async initialization (e.g., load highlighter) */
    init?: () => Promise<void>;
    /** Transform blocks before rendering */
    transformBlock?: (block: Block) => Block;
    /** Custom HTML for specific block types */
    renderBlock?: (block: Block, defaultRender: () => string) => string | null;
    /** Inject additional CSS */
    getCSS?: () => string;
    /** Post-process the final HTML */
    postProcess?: (html: string) => string | Promise<string>;
}
/**
 * Options for preview rendering
 */
export interface PreviewOptions {
    /** CSS class prefix (default: 'cm-') */
    classPrefix?: string;
    /** Theme name */
    theme?: 'github' | 'github-dark' | 'minimal' | string;
    /** Link target attribute */
    linkTarget?: '_blank' | '_self';
    /** Sanitize HTML output. Pass a function (e.g. DOMPurify.sanitize) for custom sanitization. */
    sanitize?: boolean | ((html: string) => string);
    /** Plugins for enhanced rendering */
    plugins?: PreviewPlugin[];
    /** Custom block renderers */
    customRenderers?: Partial<BlockHTMLRenderers>;
}
/**
 * Custom block renderer functions
 */
export interface BlockHTMLRenderers {
    paragraph: (block: Block) => string;
    heading: (block: Block) => string;
    bulletList: (block: Block) => string;
    numberedList: (block: Block) => string;
    checkList: (block: Block) => string;
    codeBlock: (block: Block) => string;
    blockquote: (block: Block) => string;
    table: (block: Block) => string;
    image: (block: Block) => string;
    divider: (block: Block) => string;
    callout: (block: Block) => string;
}
/**
 * Resolved options with defaults applied
 */
export interface ResolvedPreviewOptions {
    classPrefix: string;
    theme: string;
    linkTarget: '_blank' | '_self';
    sanitize: boolean | ((html: string) => string);
    plugins: PreviewPlugin[];
    customRenderers: Partial<BlockHTMLRenderers>;
}
//# sourceMappingURL=types.d.ts.map