Skip to content

Commit

Permalink
fix: correct defineConfig parameter typing for extending umi
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymins committed Dec 23, 2022
1 parent 94e7e76 commit b4922a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/types.ts
Expand Up @@ -11,7 +11,7 @@ import { defineConfig as defineUmiConfig } from 'umi';

type IUmiConfig = Parameters<typeof defineUmiConfig>[0];

export interface IDumiConfig extends IUmiConfig {
interface IDumiExtendsConfig {
resolve: {
docDirs: (string | { type?: string; dir: string })[];
/**
Expand All @@ -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<Omit<IDumiConfig, 'resolve' | 'locales'>> {
extends Partial<Omit<IDumiConfig, 'resolve' | 'locales'>>,
IUmiConfig {
resolve?: Partial<IDumiConfig['resolve']>;
locales?: (
| IDumiConfig['locales'][0]
Expand Down

0 comments on commit b4922a8

Please sign in to comment.