fix: allow promises for extends
This commit is contained in:
parent
5160886227
commit
41bfede8f2
2 changed files with 4 additions and 1 deletions
|
@ -1,11 +1,12 @@
|
|||
import type { ConfigType as MarkdocConfig } from '@markdoc/markdoc';
|
||||
import _Markdoc from '@markdoc/markdoc';
|
||||
import { heading } from './heading-ids.js';
|
||||
import type { MaybePromise } from './utils.js';
|
||||
|
||||
export type AstroMarkdocConfig<C extends Record<string, any> = Record<string, any>> =
|
||||
MarkdocConfig & {
|
||||
ctx?: C;
|
||||
extends?: ResolvedAstroMarkdocConfig[];
|
||||
extends?: MaybePromise<ResolvedAstroMarkdocConfig>[];
|
||||
};
|
||||
|
||||
export type ResolvedAstroMarkdocConfig = Omit<AstroMarkdocConfig, 'extends'>;
|
||||
|
|
|
@ -3,6 +3,8 @@ import crypto from 'node:crypto';
|
|||
import path from 'node:path';
|
||||
import type { ErrorPayload as ViteErrorPayload } from 'vite';
|
||||
|
||||
export type MaybePromise<T> = T | Promise<T>;
|
||||
|
||||
/**
|
||||
* Match YAML exception handling from Astro core errors
|
||||
* @see 'astro/src/core/errors.ts'
|
||||
|
|
Loading…
Reference in a new issue