diff --git a/types/hapi__joi/hapi__joi-tests.ts b/types/hapi__joi/hapi__joi-tests.ts index 381c04c156..18bc21b9e3 100644 --- a/types/hapi__joi/hapi__joi-tests.ts +++ b/types/hapi__joi/hapi__joi-tests.ts @@ -1159,6 +1159,13 @@ schema = Joi.symbol().map({ // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +const rule = Joi.string().case('upper').$_getRule('case'); +if (rule && rule.args) { + const direction = rule.args.direction; +} + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + schema = Joi.any(); const terms = schema.$_terms; diff --git a/types/hapi__joi/index.d.ts b/types/hapi__joi/index.d.ts index 542ebaae07..2ccd02c3c6 100644 --- a/types/hapi__joi/index.d.ts +++ b/types/hapi__joi/index.d.ts @@ -726,6 +726,13 @@ declare namespace Joi { }; } + interface GetRuleOptions { + args?: Record; + method?: string; + name: string; + operator?: string; + } + interface SchemaInternals { /** * Parent schema object. @@ -767,7 +774,7 @@ declare namespace Joi { /** * Retrieve some rule configuration. */ - $_getRule(name: string): ExtensionRule; + $_getRule(name: string): GetRuleOptions | undefined; $_mapLabels(path: string | string[]): string;