@rjsf/validator-ajv8 5.0.0-beta.8 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _rjsf_utils from '@rjsf/utils';
2
- import { ValidatorType } from '@rjsf/utils';
3
- import { Options, ErrorObject } from 'ajv';
2
+ import { StrictRJSFSchema, RJSFSchema, FormContextType, ValidatorType } from '@rjsf/utils';
3
+ import Ajv, { Options, ErrorObject } from 'ajv';
4
4
  import { FormatsPluginOptions } from 'ajv-formats';
5
5
 
6
6
  /** The type describing how to customize the AJV6 validator
@@ -16,10 +16,12 @@ interface CustomValidatorOptionsType {
16
16
  ajvOptionsOverrides?: Options;
17
17
  /** The `ajv-format` options to use when adding formats to `ajv`; pass `false` to disable it */
18
18
  ajvFormatOptions?: FormatsPluginOptions | false;
19
+ /** The AJV class to construct */
20
+ AjvClass?: typeof Ajv;
19
21
  }
20
22
  /** The type describing a function that takes a list of Ajv `ErrorObject`s and localizes them
21
23
  */
22
- declare type Localizer = (errors?: null | ErrorObject[]) => void;
24
+ type Localizer = (errors?: null | ErrorObject[]) => void;
23
25
 
24
26
  /** Creates and returns a customized implementation of the `ValidatorType` with the given customization `options` if
25
27
  * provided.
@@ -27,8 +29,8 @@ declare type Localizer = (errors?: null | ErrorObject[]) => void;
27
29
  * @param [options={}] - The `CustomValidatorOptionsType` options that are used to create the `ValidatorType` instance
28
30
  * @param [localizer] - If provided, is used to localize a list of Ajv `ErrorObject`s
29
31
  */
30
- declare function customizeValidator<T = any>(options?: CustomValidatorOptionsType, localizer?: Localizer): ValidatorType<T>;
32
+ declare function customizeValidator<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(options?: CustomValidatorOptionsType, localizer?: Localizer): ValidatorType<T, S, F>;
31
33
 
32
- declare const _default: _rjsf_utils.ValidatorType<any>;
34
+ declare const _default: _rjsf_utils.ValidatorType<any, _rjsf_utils.RJSFSchema, any>;
33
35
 
34
36
  export { CustomValidatorOptionsType, Localizer, customizeValidator, _default as default };