diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index cc13a9deca..7a41f238de 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -1071,7 +1071,7 @@ export function reach(schema: ObjectSchema, path: string): T; /** * Creates a new Joi instance customized with the extension(s) you provide included. */ -export function extend(extention: Extension): any; +export function extend(extension: Extension|Extension[], ...extensions: (Extension|Extension[])[]): any; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 34fc5271e0..6d2d12efb6 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -970,6 +970,12 @@ const Joi3 = Joi.extend({ ], }); +const Joi4 = Joi.extend([{ name: '', base: schema }, { name: '', base: schema }]); + +const Joi5 = Joi.extend({ name: '', base: schema }, { name: '', base: schema }); + +const Joi6 = Joi.extend({ name: '', base: schema }, [{ name: '', base: schema }, { name: '', base: schema }]); + // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- const defaultsJoi = Joi.defaults((schema) => {