0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix(@astro/mdx): add components property to RenderResult type definition (#12245)

This commit is contained in:
Benjamin MENANT 2024-10-25 12:17:23 +02:00 committed by GitHub
parent 9d6bcdb88f
commit 1d4f6a4989
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 4 deletions

View file

@ -0,0 +1,6 @@
---
'@astrojs/mdx': patch
'astro': patch
---
Add `components` property to MDXInstance type definition (RenderResult and module import)

View file

@ -289,6 +289,7 @@ declare module '*.mdx' {
export const url: MDX['url'];
export const getHeadings: MDX['getHeadings'];
export const Content: MDX['Content'];
export const components: MDX['components'];
const load: MDX['default'];
export default load;

View file

@ -2648,10 +2648,12 @@ export interface MarkdownInstance<T extends Record<string, any>> {
type MD = MarkdownInstance<Record<string, any>>;
export type MDXInstance<T extends Record<string, any>> = Omit<
export interface MDXInstance<T extends Record<string, any>> extends Omit<
MarkdownInstance<T>,
'rawContent' | 'compiledContent'
>;
> {
components: Record<string, AstroComponentFactory> | undefined;
}
export interface MarkdownLayoutProps<T extends Record<string, any>> {
frontmatter: {
@ -2665,10 +2667,12 @@ export interface MarkdownLayoutProps<T extends Record<string, any>> {
compiledContent: MarkdownInstance<T>['compiledContent'];
}
export type MDXLayoutProps<T extends Record<string, any>> = Omit<
export interface MDXLayoutProps<T extends Record<string, any>> extends Omit<
MarkdownLayoutProps<T>,
'rawContent' | 'compiledContent'
>;
> {
components: MDXInstance<T>['components'];
}
export type GetHydrateCallback = () => Promise<() => void | Promise<void>>;

View file

@ -4,6 +4,7 @@ declare module 'astro:content' {
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
components: import('astro').MDXInstance<{}>['components'];
}>;
}
}