Skip to content

Commit b5c4744

Browse files
committed
fix(types): all plugin option api should be optional
1 parent b37be8d commit b5c4744

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/@vuepress/types/lib/plugin-api.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type PluginEntryOptions = {
3131
/**
3232
* Sub plugins
3333
*/
34-
plugins: UserPlugins;
34+
plugins?: UserPlugins;
3535
/**
3636
* Edit the internal webpack config with webpack-chain.
3737
*
@@ -94,19 +94,19 @@ export type PluginEntryOptions = {
9494
*
9595
* @see https://vuepress.vuejs.org/plugin/option-api.html#extendpagedata
9696
*/
97-
extendPageData: <T extends PluginObject = PluginObject>(page: Page & T) => void;
97+
extendPageData?: <T extends PluginObject = PluginObject>(page: Page & T) => void;
9898
/**
9999
* A path to the mixin file which allows you to control the lifecycle of root component.
100100
*
101101
* @see https://vuepress.vuejs.org/plugin/option-api.html#clientrootmixin
102102
*/
103-
clientRootMixin: string;
103+
clientRootMixin?: string;
104104
/**
105105
* Add extra pages pointing to a Markdown file:
106106
*
107107
* @see https://vuepress.vuejs.org/plugin/option-api.html#additionalpages
108108
*/
109-
additionalPages:
109+
additionalPages?:
110110
| Array<{ path: string; filePath: string }>
111111
| AsyncHook<
112112
[],
@@ -141,19 +141,19 @@ export type PluginEntry = PluginEntryOptions & {
141141
*
142142
* @see https://vuepress.vuejs.org/plugin/life-cycle.html#ready
143143
*/
144-
ready: AsyncHook<[], unknown>;
144+
ready?: AsyncHook<[], unknown>;
145145
/**
146146
* Trigger when a new compilation is triggered
147147
*
148148
* @see https://vuepress.vuejs.org/plugin/life-cycle.html#updated
149149
*/
150-
updated: Hook<[], unknown>;
150+
updated?: Hook<[], unknown>;
151151
/**
152152
* Called when a (production) build finishes, with an array of generated page HTML paths.
153153
*
154154
* @see https://vuepress.vuejs.org/plugin/life-cycle.html#generated
155155
*/
156-
generated: AsyncHook<[string[]], unknown>;
156+
generated?: AsyncHook<[string[]], unknown>;
157157
};
158158

159159
/**

0 commit comments

Comments
 (0)