diff options
author | 2025-01-30 10:34:32 +0000 | |
---|---|---|
committer | 2025-01-30 10:34:32 +0000 | |
commit | 0f10384d0338dcd9993963e7538f008bcda38bdb (patch) | |
tree | df7ce90e291ba0adb6fa43b0166374c1790554b4 | |
parent | 037495d437d2328bf10ffadc22cc114ccf474c65 (diff) | |
download | astro-0f10384d0338dcd9993963e7538f008bcda38bdb.tar.gz astro-0f10384d0338dcd9993963e7538f008bcda38bdb.tar.zst astro-0f10384d0338dcd9993963e7538f008bcda38bdb.zip |
[ci] format
-rw-r--r-- | packages/astro/templates/content/types.d.ts | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/packages/astro/templates/content/types.d.ts b/packages/astro/templates/content/types.d.ts index 30f4286b8..2d1058d27 100644 --- a/packages/astro/templates/content/types.d.ts +++ b/packages/astro/templates/content/types.d.ts @@ -31,14 +31,20 @@ declare module 'astro:content' { ContentEntryMap[C] >['slug']; - export type ReferenceDataEntry<C extends CollectionKey, E extends keyof DataEntryMap[C] = string> = { + export type ReferenceDataEntry< + C extends CollectionKey, + E extends keyof DataEntryMap[C] = string, + > = { collection: C; id: E; - } - export type ReferenceContentEntry<C extends keyof ContentEntryMap, E extends ValidContentEntrySlug<C> | (string & {}) = string> = { + }; + export type ReferenceContentEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug<C> | (string & {}) = string, + > = { collection: C; slug: E; - } + }; /** @deprecated Use `getEntry` instead. */ export function getEntryBySlug< @@ -70,13 +76,17 @@ declare module 'astro:content' { export function getEntry< C extends keyof ContentEntryMap, E extends ValidContentEntrySlug<C> | (string & {}), - >(entry: ReferenceContentEntry<C, E>): E extends ValidContentEntrySlug<C> + >( + entry: ReferenceContentEntry<C, E>, + ): E extends ValidContentEntrySlug<C> ? Promise<CollectionEntry<C>> : Promise<CollectionEntry<C> | undefined>; export function getEntry< C extends keyof DataEntryMap, E extends keyof DataEntryMap[C] | (string & {}), - >(entry: ReferenceDataEntry<C, E>): E extends keyof DataEntryMap[C] + >( + entry: ReferenceDataEntry<C, E>, + ): E extends keyof DataEntryMap[C] ? Promise<DataEntryMap[C][E]> : Promise<CollectionEntry<C> | undefined>; export function getEntry< |