Skip to content

Commit 8c3579b

Browse files
fix: add render() type overload for live collection entries (#16688) (#17274)
1 parent 94dd2aa commit 8c3579b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.changeset/jolly-jobs-post.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fixes missing `render()` type overload for live collection entries. Previously, calling `render()` on a `LiveDataEntry` produced a TypeScript error when using only `live.config.ts` without a `content.config.ts`.

packages/astro/templates/content/types.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ declare module 'astro:content' {
8585
entry: DataEntryMap[C][string],
8686
): Promise<RenderResult>;
8787

88+
export function render<C extends keyof LiveContentConfig['collections']>(
89+
entry: import('astro').LiveDataEntry<LiveLoaderDataType<C>>,
90+
): Promise<RenderResult>;
91+
8892
export function reference<
8993
C extends
9094
| keyof DataEntryMap

0 commit comments

Comments
 (0)