Skip to content

Commit c30c1b3

Browse files
committed
wip: scaffold content types
1 parent 2487aed commit c30c1b3

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
declare module 'astro:content' {
2+
type ComponentRenderer =
3+
| JSX.Element
4+
| {
5+
component: JSX.Element;
6+
props?(params: {
7+
attributes: Record<string, any>;
8+
getTreeNode(): import('@markdoc/markdoc').Tag;
9+
}): Record<string, any>;
10+
};
11+
interface Render {
12+
'.mdoc': {
13+
Content(props: {
14+
components: Record<string, ComponentRenderer>;
15+
config: import('@markdoc/markdoc').Config;
16+
}): Promise<JSX.Element>;
17+
};
18+
}
19+
}

packages/integrations/markdoc/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"exports": {
2222
".": "./dist/index.js",
2323
"./components": "./components/index.ts",
24+
"./content-types": "./content-types.d.ts",
2425
"./package.json": "./package.json"
2526
},
2627
"scripts": {

packages/integrations/markdoc/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "../../../tsconfig.base.json",
3-
"include": ["src", "components"],
3+
"include": ["src", "components", "content-types.d.ts"],
44
"compilerOptions": {
55
"allowJs": true,
66
"module": "ES2020",

0 commit comments

Comments
 (0)