0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

[ci] format

This commit is contained in:
Thom van den Akker 2025-01-30 10:34:32 +00:00 committed by astrobot-houston
parent 037495d437
commit 0f10384d03

View file

@ -31,14 +31,20 @@ declare module 'astro:content' {
ContentEntryMap[C] ContentEntryMap[C]
>['slug']; >['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; collection: C;
id: E; 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; collection: C;
slug: E; slug: E;
} };
/** @deprecated Use `getEntry` instead. */ /** @deprecated Use `getEntry` instead. */
export function getEntryBySlug< export function getEntryBySlug<
@ -70,13 +76,17 @@ declare module 'astro:content' {
export function getEntry< export function getEntry<
C extends keyof ContentEntryMap, C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}), 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>>
: Promise<CollectionEntry<C> | undefined>; : Promise<CollectionEntry<C> | undefined>;
export function getEntry< export function getEntry<
C extends keyof DataEntryMap, C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}), 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<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>; : Promise<CollectionEntry<C> | undefined>;
export function getEntry< export function getEntry<