From b4922a8caaa27316c632bd87184a3b553ff08b6a Mon Sep 17 00:00:00 2001 From: Emil Zhai Date: Fri, 23 Dec 2022 10:00:11 +0000 Subject: [PATCH] fix: correct defineConfig parameter typing for extending umi --- src/types.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index 162e03e7ff..c4da1740cf 100644 --- a/src/types.ts +++ b/src/types.ts @@ -11,7 +11,7 @@ import { defineConfig as defineUmiConfig } from 'umi'; type IUmiConfig = Parameters[0]; -export interface IDumiConfig extends IUmiConfig { +interface IDumiExtendsConfig { resolve: { docDirs: (string | { type?: string; dir: string })[]; /** @@ -33,9 +33,11 @@ export interface IDumiConfig extends IUmiConfig { // eslint-disable-next-line @typescript-eslint/ban-types extraRehypePlugins?: (string | Function | [string | Function, object])[]; } +export type IDumiConfig = IUmiConfig & IDumiExtendsConfig; export interface IDumiUserConfig - extends Partial> { + extends Partial>, + IUmiConfig { resolve?: Partial; locales?: ( | IDumiConfig['locales'][0]