/** * Preact-specific MarkdownRuntime implementation. */ import type { HTMLTag, MarkdownRuntime } from '@intlayer/core/markdown'; import { type Component, cloneElement, createElement, Fragment, type VNode, } from 'preact'; /** * Preact-specific runtime for the markdown processor. */ export const preactRuntime: MarkdownRuntime = { createElement: ( type: string | Component, props: Record | null, ...children: any[] ): any => createElement(type as any, props, ...children), cloneElement: ( element: unknown, props: Record, ...children: any[] ): any => cloneElement(element as VNode, props, ...children), Fragment, normalizeProps: ( _tag: HTMLTag, props: Record ): Record => props, }; export default preactRuntime;