diff --git a/packages/integrations/markdoc/content-types.d.ts b/packages/integrations/markdoc/content-types.d.ts new file mode 100644 index 000000000..cd8d7be30 --- /dev/null +++ b/packages/integrations/markdoc/content-types.d.ts @@ -0,0 +1,19 @@ +declare module 'astro:content' { + type ComponentRenderer = + | JSX.Element + | { + component: JSX.Element; + props?(params: { + attributes: Record; + getTreeNode(): import('@markdoc/markdoc').Tag; + }): Record; + }; + interface Render { + '.mdoc': { + Content(props: { + components: Record; + config: import('@markdoc/markdoc').Config; + }): Promise; + }; + } +} diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index b24e2cd5f..74e31dbf8 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -21,6 +21,7 @@ "exports": { ".": "./dist/index.js", "./components": "./components/index.ts", + "./content-types": "./content-types.d.ts", "./package.json": "./package.json" }, "scripts": { diff --git a/packages/integrations/markdoc/tsconfig.json b/packages/integrations/markdoc/tsconfig.json index 80a59aa7a..e76117665 100644 --- a/packages/integrations/markdoc/tsconfig.json +++ b/packages/integrations/markdoc/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../../tsconfig.base.json", - "include": ["src", "components"], + "include": ["src", "components", "content-types.d.ts"], "compilerOptions": { "allowJs": true, "module": "ES2020",