fix: type inferencing in preview

This commit is contained in:
bholmesdev 2023-02-14 12:08:04 -05:00
parent 60c86b146a
commit f30e7603f6
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,6 @@
import type { AstroIntegration } from 'astro'; import type { AstroIntegration } from 'astro';
import type { InlineConfig } from 'vite'; import type { InlineConfig } from 'vite';
import type { Config as _MarkdocConfig } from '@markdoc/markdoc';
import _Markdoc from '@markdoc/markdoc'; import _Markdoc from '@markdoc/markdoc';
import { parseFrontmatter } from './utils.js'; import { parseFrontmatter } from './utils.js';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
@ -48,3 +49,4 @@ export default function markdoc(): AstroIntegration {
} }
export const Markdoc = _Markdoc; export const Markdoc = _Markdoc;
export type MarkdocConfig = _MarkdocConfig;

View file

@ -5,14 +5,14 @@ declare module 'astro:content' {
component: import('astro').ComponentInstance['default']; component: import('astro').ComponentInstance['default'];
props?(params: { props?(params: {
attributes: Record<string, any>; attributes: Record<string, any>;
getTreeNode(): import('@astrojs/markdoc').Markdoc.Tag; getTreeNode(): typeof import('@astrojs/markdoc').Markdoc.Tag;
}): Record<string, any>; }): Record<string, any>;
}; };
interface Render { interface Render {
'.mdoc': Promise<{ '.mdoc': Promise<{
Content(props: { Content(props: {
config?: import('@astrojs/markdoc').Markdoc.Config; config?: import('@astrojs/markdoc').MarkdocConfig;
components?: Record<string, ComponentRenderer>; components?: Record<string, ComponentRenderer>;
}): import('astro').MarkdownInstance<{}>['Content']; }): import('astro').MarkdownInstance<{}>['Content'];
}>; }>;