From f2f31e7cc4aff6151adae9d1fb2321b3fa1c252b Mon Sep 17 00:00:00 2001 From: sapphi-red Date: Mon, 10 Oct 2022 16:27:08 +0900 Subject: [PATCH] chore: update type def --- packages/vite/src/node/index.ts | 1 + packages/vite/src/types/alias.d.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vite/src/node/index.ts b/packages/vite/src/node/index.ts index 0e246615bfa5f3..d8e97d5a6a382f 100644 --- a/packages/vite/src/node/index.ts +++ b/packages/vite/src/node/index.ts @@ -119,6 +119,7 @@ export type { // dep types export type { AliasOptions, + MapToFunction, ResolverFunction, ResolverObject, Alias diff --git a/packages/vite/src/types/alias.d.ts b/packages/vite/src/types/alias.d.ts index 3f4393586f1299..5752c25c04fc96 100644 --- a/packages/vite/src/types/alias.d.ts +++ b/packages/vite/src/types/alias.d.ts @@ -40,7 +40,9 @@ export interface Alias { customResolver?: ResolverFunction | ResolverObject | null } -export type ResolverFunction = PluginHooks['resolveId'] +export type MapToFunction = T extends Function ? T : never + +export type ResolverFunction = MapToFunction export interface ResolverObject { buildStart?: PluginHooks['buildStart']