mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
refactor(v2): use correct plugin types (#4418)
This commit is contained in:
parent
1078341b22
commit
abae86f283
11 changed files with 69 additions and 80 deletions
|
@ -37,7 +37,7 @@ export const logValidationBugReportHint = (): void => {
|
|||
|
||||
export function normalizePluginOptions<T extends {id?: string}>(
|
||||
schema: Joi.ObjectSchema<T>,
|
||||
options: unknown,
|
||||
options: Partial<T>,
|
||||
): T {
|
||||
// All plugins can be provided an "id" option (multi-instance support)
|
||||
// we add schema validation automatically
|
||||
|
@ -61,7 +61,7 @@ export function normalizePluginOptions<T extends {id?: string}>(
|
|||
|
||||
export function normalizeThemeConfig<T>(
|
||||
schema: Joi.ObjectSchema<T>,
|
||||
themeConfig: unknown,
|
||||
themeConfig: Partial<T>,
|
||||
): T {
|
||||
// A theme should only validate his "slice" of the full themeConfig,
|
||||
// not the whole object, so we allow unknown attributes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue