fix: allow promises for extends

This commit is contained in:
bholmesdev 2023-06-05 16:30:59 -04:00
parent 5160886227
commit 41bfede8f2
2 changed files with 4 additions and 1 deletions

View file

@ -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'>;

View file

@ -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'