wip: scaffold content types
This commit is contained in:
parent
b64e64b1a8
commit
a89fb2f2bd
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