Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Aug 16, 2024
1 parent eb90978 commit bef1863
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/bundler-vite/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { Options as VuePluginOptions } from '@vitejs/plugin-vue'
import type { BundlerOptions } from '@vuepress/core'
import type { InlineConfig } from 'vite'

/**
* Options for bundler-vite
*/
export interface ViteBundlerOptions {
export interface ViteBundlerOptions extends BundlerOptions {
viteOptions?: InlineConfig
vuePluginOptions?: VuePluginOptions
}
3 changes: 2 additions & 1 deletion packages/bundler-webpack/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { BundlerOptions } from '@vuepress/core'
import type { VueLoaderOptions } from 'vue-loader'
import type {
LoaderContext,
Expand All @@ -16,7 +17,7 @@ export type {
/**
* Options for bundler-webpack
*/
export interface WebpackBundlerOptions {
export interface WebpackBundlerOptions extends BundlerOptions {
/**
* use webpack-merge to set webpack config
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/types/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ export interface Bundler {
dev: (app: App) => Promise<() => Promise<void>>
build: (app: App) => Promise<void>
}

export type BundlerOptions = Record<string, unknown>
3 changes: 2 additions & 1 deletion packages/core/src/types/pluginApi/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Markdown, MarkdownOptions } from '@vuepress/markdown'
import type { App } from '../app/index.js'
import type { BundlerOptions } from '../bundler.js'
import type { Page, PageOptions } from '../page.js'

// util type
Expand Down Expand Up @@ -59,7 +60,7 @@ export interface Hooks {
extendsMarkdown: ExtendsHook<Markdown>
extendsPageOptions: ExtendsHook<PageOptions>
extendsPage: ExtendsHook<Page>
extendsBundlerOptions: ExtendsHook<Record<string, unknown>>
extendsBundlerOptions: ExtendsHook<BundlerOptions>
clientConfigFile: ClientConfigFileHook
alias: AliasDefineHook
define: AliasDefineHook
Expand Down

0 comments on commit bef1863

Please sign in to comment.