From 512a5d5d8b517d589eead7c1189e8e19ebee3c5a Mon Sep 17 00:00:00 2001 From: Andrew Moore Date: Sun, 9 Jul 2023 19:45:05 -0400 Subject: [PATCH 1/2] feat: added types to astro:content to allow user space content services --- packages/astro/content-types.template.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/astro/content-types.template.d.ts b/packages/astro/content-types.template.d.ts index 277d00acf7ea..e48feabfa31c 100644 --- a/packages/astro/content-types.template.d.ts +++ b/packages/astro/content-types.template.d.ts @@ -10,7 +10,11 @@ declare module 'astro:content' { declare module 'astro:content' { export { z } from 'astro/zod'; - export type CollectionEntry = AnyEntryMap[C][keyof AnyEntryMap[C]]; + export type CollectionKey = keyof AnyEntryMap; + export type CollectionEntry = AnyEntryMap[C][keyof AnyEntryMap[C]]; + + export type ContentCollectionKey = keyof ContentEntryMap; + export type DataCollectionKey = keyof DataEntryMap; // TODO: Remove this when having this fallback is no longer relevant. 2.3? 3.0? - erika, 2023-04-04 /** From f9cc4306f5a2b1dce9467abe981023b1846ab655 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Fri, 18 Aug 2023 09:52:19 -0500 Subject: [PATCH 2/2] Create small-apes-clap.md --- .changeset/small-apes-clap.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/small-apes-clap.md diff --git a/.changeset/small-apes-clap.md b/.changeset/small-apes-clap.md new file mode 100644 index 000000000000..1a682604af59 --- /dev/null +++ b/.changeset/small-apes-clap.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Add `CollectionKey`, `ContentCollectionKey`, and `DataCollectionKey` exports to `astro:content`