wip: scaffold content types
This commit is contained in:
parent
7a941a0b2d
commit
336810b2cf
3 changed files with 21 additions and 1 deletions
19
packages/integrations/markdoc/content-types.d.ts
vendored
Normal file
19
packages/integrations/markdoc/content-types.d.ts
vendored
Normal file
|
@ -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>;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@
|
|||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./components": "./components/index.ts",
|
||||
"./content-types": "./content-types.d.ts",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"include": ["src", "components"],
|
||||
"include": ["src", "components", "content-types.d.ts"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"module": "ES2020",
|
||||
|
|
Loading…
Reference in a new issue