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:
parent
9d6bcdb88f
commit
1d4f6a4989
4 changed files with 16 additions and 4 deletions
6
.changeset/twenty-gifts-kick.md
Normal file
6
.changeset/twenty-gifts-kick.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
'@astrojs/mdx': patch
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Add `components` property to MDXInstance type definition (RenderResult and module import)
|
1
packages/astro/client.d.ts
vendored
1
packages/astro/client.d.ts
vendored
|
@ -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;
|
||||
|
|
|
@ -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>>;
|
||||
|
||||
|
|
|
@ -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'];
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue