import type { Config, ConfigType as MarkdocConfig, MaybePromise, NodeType, Schema, } from '@markdoc/markdoc'; import _Markdoc from '@markdoc/markdoc'; import type { AstroInstance } from 'astro'; import { heading } from './heading-ids.js'; type Render = AstroInstance['default'] | string; export type AstroMarkdocConfig = Record> = Omit< MarkdocConfig, 'tags' | 'nodes' > & Partial<{ tags: Record>; nodes: Partial>>; ctx: C; extends: MaybePromise[]; }>; export type ResolvedAstroMarkdocConfig = Omit; export const Markdoc = _Markdoc; export const nodes = { ...Markdoc.nodes, heading }; export function defineMarkdocConfig(config: AstroMarkdocConfig): AstroMarkdocConfig { return config; }