Skip to content

Commit

Permalink
chore: update type def
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Oct 10, 2022
1 parent 65d2b90 commit f2f31e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/vite/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export type {
// dep types
export type {
AliasOptions,
MapToFunction,
ResolverFunction,
ResolverObject,
Alias
Expand Down
4 changes: 3 additions & 1 deletion packages/vite/src/types/alias.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export interface Alias {
customResolver?: ResolverFunction | ResolverObject | null
}

export type ResolverFunction = PluginHooks['resolveId']
export type MapToFunction<T> = T extends Function ? T : never

export type ResolverFunction = MapToFunction<PluginHooks['resolveId']>

export interface ResolverObject {
buildStart?: PluginHooks['buildStart']
Expand Down

0 comments on commit f2f31e7

Please sign in to comment.