UNPKG

@spailybot/moleculer-auto-openapi

Version:
21 lines (20 loc) 1.37 kB
import { addMappersFn, FastestValidatorType, Mappers, ObjectRules } from '../types/index.js'; import { MappersOptions } from '../mappers.js'; import type { ValidationRule, ValidationRuleObject, ValidationSchema, ValidationSchemaMetaKeys } from 'fastest-validator'; import type { OpenAPIV3_1 } from 'openapi-types'; import type { IConverter } from './IConverter.js'; export declare class FastestValidatorConverter implements IConverter { private readonly validator; private readonly additionalMappersFn?; private readonly mappers; constructor(validator: FastestValidatorType, additionalMappersFn?: addMappersFn | undefined); private getMapperFn; private _loadingPromise?; load(): Promise<void>; getValidationRules(schema: ValidationSchema): Record<string, ValidationRule>; getMetas(schema: ValidationSchema): ValidationSchemaMetaKeys; getSchemaObjectFromSchema(schema: ValidationSchema): Record<string, OpenAPIV3_1.SchemaObject>; getSchemaObjectFromRootSchema(schema: ValidationSchema): OpenAPIV3_1.SchemaObject | undefined; getSchemaObjectFromRule(pRule: ValidationRule, parentProperties?: Partial<ValidationRuleObject>, parentSchema?: ObjectRules): OpenAPIV3_1.SchemaObject | undefined; } export declare const getFastestValidatorMappers: ({ getSchemaObjectFromRule, getSchemaObjectFromSchema }: MappersOptions) => Mappers;