Skip to content

Commit

Permalink
fix(types): all plugin option api should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Dec 23, 2021
1 parent b37be8d commit b5c4744
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/@vuepress/types/lib/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type PluginEntryOptions = {
/**
* Sub plugins
*/
plugins: UserPlugins;
plugins?: UserPlugins;
/**
* Edit the internal webpack config with webpack-chain.
*
Expand Down Expand Up @@ -94,19 +94,19 @@ export type PluginEntryOptions = {
*
* @see https://vuepress.vuejs.org/plugin/option-api.html#extendpagedata
*/
extendPageData: <T extends PluginObject = PluginObject>(page: Page & T) => void;
extendPageData?: <T extends PluginObject = PluginObject>(page: Page & T) => void;
/**
* A path to the mixin file which allows you to control the lifecycle of root component.
*
* @see https://vuepress.vuejs.org/plugin/option-api.html#clientrootmixin
*/
clientRootMixin: string;
clientRootMixin?: string;
/**
* Add extra pages pointing to a Markdown file:
*
* @see https://vuepress.vuejs.org/plugin/option-api.html#additionalpages
*/
additionalPages:
additionalPages?:
| Array<{ path: string; filePath: string }>
| AsyncHook<
[],
Expand Down Expand Up @@ -141,19 +141,19 @@ export type PluginEntry = PluginEntryOptions & {
*
* @see https://vuepress.vuejs.org/plugin/life-cycle.html#ready
*/
ready: AsyncHook<[], unknown>;
ready?: AsyncHook<[], unknown>;
/**
* Trigger when a new compilation is triggered
*
* @see https://vuepress.vuejs.org/plugin/life-cycle.html#updated
*/
updated: Hook<[], unknown>;
updated?: Hook<[], unknown>;
/**
* Called when a (production) build finishes, with an array of generated page HTML paths.
*
* @see https://vuepress.vuejs.org/plugin/life-cycle.html#generated
*/
generated: AsyncHook<[string[]], unknown>;
generated?: AsyncHook<[string[]], unknown>;
};

/**
Expand Down

0 comments on commit b5c4744

Please sign in to comment.