From a89fb2f2bd49f79a11783d53f44598b27d591c08 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Wed, 8 Feb 2023 10:10:39 -0500 Subject: [PATCH] wip: scaffold content types --- .../integrations/markdoc/content-types.d.ts | 19 +++++++++++++++++++ packages/integrations/markdoc/package.json | 1 + packages/integrations/markdoc/tsconfig.json | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 packages/integrations/markdoc/content-types.d.ts 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",