mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
fix(astro:content): add deprecated to getEntryBySlug
& getDataEntryById
(#11600)
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
This commit is contained in:
parent
1b3c81c684
commit
09ec2cadce
2 changed files with 7 additions and 0 deletions
5
.changeset/dull-taxis-warn.md
Normal file
5
.changeset/dull-taxis-warn.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Deprecates `getEntryBySlug` and `getDataEntryById` functions exported by `astro:content` in favor of `getEntry`.
|
2
packages/astro/templates/content/types.d.ts
vendored
2
packages/astro/templates/content/types.d.ts
vendored
|
@ -22,6 +22,7 @@ declare module 'astro:content' {
|
|||
ContentEntryMap[C]
|
||||
>['slug'];
|
||||
|
||||
/** @deprecated Use `getEntry` instead. */
|
||||
export function getEntryBySlug<
|
||||
C extends keyof ContentEntryMap,
|
||||
E extends ValidContentEntrySlug<C> | (string & {}),
|
||||
|
@ -33,6 +34,7 @@ declare module 'astro:content' {
|
|||
? Promise<CollectionEntry<C>>
|
||||
: Promise<CollectionEntry<C> | undefined>;
|
||||
|
||||
/** @deprecated Use `getEntry` instead. */
|
||||
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
|
||||
collection: C,
|
||||
entryId: E
|
||||
|
|
Loading…
Add table
Reference in a new issue