From f73a5a780ba19b046b1fe0604275bcda0125bbf4 Mon Sep 17 00:00:00 2001 From: f0x Date: Fri, 10 Jan 2025 19:54:37 +0100 Subject: [PATCH] use generic type for vnode props in renderToReadableStream/renderToPipeableStream, similar to other render functions --- .changeset/little-rocks-doubt.md | 5 +++++ src/stream-node.d.ts | 4 ++-- src/stream.d.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/little-rocks-doubt.md diff --git a/.changeset/little-rocks-doubt.md b/.changeset/little-rocks-doubt.md new file mode 100644 index 00000000..f152a2db --- /dev/null +++ b/.changeset/little-rocks-doubt.md @@ -0,0 +1,5 @@ +--- +'preact-render-to-string': patch +--- + +Fix types for `/stream` and `/stream-node` exports diff --git a/src/stream-node.d.ts b/src/stream-node.d.ts index 5cdc0e53..41854ae2 100644 --- a/src/stream-node.d.ts +++ b/src/stream-node.d.ts @@ -12,8 +12,8 @@ interface PipeableStream { pipe: (writable: WritableStream) => void; } -export function renderToPipeableStream( - vnode: VNode, +export function renderToPipeableStream

( + vnode: VNode

, options: RenderToPipeableStreamOptions, context?: any ): PipeableStream; diff --git a/src/stream.d.ts b/src/stream.d.ts index c786d965..1ab9aa52 100644 --- a/src/stream.d.ts +++ b/src/stream.d.ts @@ -4,7 +4,7 @@ interface RenderStream extends ReadableStream { allReady: Promise; } -export function renderToReadableStream( - vnode: VNode, +export function renderToReadableStream

( + vnode: VNode

, context?: any ): RenderStream;