Skip to content

Commit

Permalink
wip: scaffold content types
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev committed Feb 16, 2023
1 parent 2487aed commit c30c1b3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions packages/integrations/markdoc/content-types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
declare module 'astro:content' {
type ComponentRenderer =
| JSX.Element
| {
component: JSX.Element;
props?(params: {
attributes: Record<string, any>;
getTreeNode(): import('@markdoc/markdoc').Tag;
}): Record<string, any>;
};
interface Render {
'.mdoc': {
Content(props: {
components: Record<string, ComponentRenderer>;
config: import('@markdoc/markdoc').Config;
}): Promise<JSX.Element>;
};
}
}
1 change: 1 addition & 0 deletions packages/integrations/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"exports": {
".": "./dist/index.js",
"./components": "./components/index.ts",
"./content-types": "./content-types.d.ts",
"./package.json": "./package.json"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/markdoc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["src", "components"],
"include": ["src", "components", "content-types.d.ts"],
"compilerOptions": {
"allowJs": true,
"module": "ES2020",
Expand Down

0 comments on commit c30c1b3

Please sign in to comment.