refactor(v2): use correct plugin types (#4418)

This commit is contained in:
Armano 2021-03-15 19:08:44 +01:00 committed by GitHub
parent 1078341b22
commit abae86f283
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 69 additions and 80 deletions

View file

@ -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