diff --git a/.changeset/gentle-eyes-trade.md b/.changeset/gentle-eyes-trade.md new file mode 100644 index 00000000..434454eb --- /dev/null +++ b/.changeset/gentle-eyes-trade.md @@ -0,0 +1,5 @@ +--- +"preact-render-to-string": patch +--- + +fix: use cjs types instead of esm for jsx export to fix default export from esm diff --git a/jsx.d.ts b/jsx.d.ts index 752f3e55..40fd5384 100644 --- a/jsx.d.ts +++ b/jsx.d.ts @@ -10,15 +10,24 @@ interface Options { skipFalseAttributes?: boolean; } -export default function renderToStringPretty( +declare function renderToStringPretty( vnode: VNode, context?: any, options?: Options ): string; -export function render(vnode: VNode, context?: any, options?: Options): string; -export function shallowRender( - vnode: VNode, - context?: any, - options?: Options -): string; +declare namespace renderToStringPretty { + export function render( + vnode: VNode, + context?: any, + options?: Options + ): string; + + export function shallowRender( + vnode: VNode, + context?: any, + options?: Options + ): string; +} + +export = renderToStringPretty; diff --git a/src/jsx.d.ts b/src/jsx.d.ts index 752f3e55..40fd5384 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -10,15 +10,24 @@ interface Options { skipFalseAttributes?: boolean; } -export default function renderToStringPretty( +declare function renderToStringPretty( vnode: VNode, context?: any, options?: Options ): string; -export function render(vnode: VNode, context?: any, options?: Options): string; -export function shallowRender( - vnode: VNode, - context?: any, - options?: Options -): string; +declare namespace renderToStringPretty { + export function render( + vnode: VNode, + context?: any, + options?: Options + ): string; + + export function shallowRender( + vnode: VNode, + context?: any, + options?: Options + ): string; +} + +export = renderToStringPretty;