import { Repository, FrameContext, ValidationError, ViewModel } from '@farris/devkit'; import { Observable, Subject } from 'rxjs'; import { FormNotifyService } from './form-notify.service'; import { LanguageService } from './languag.service'; /** * 表单验证服务 * @scope FrameComponent */ declare class ValidationService { private repository; private frameContext; private notifyService; private languageService; private validationResults; private validationAllResult; /** * 构造函数 */ constructor(repository: Repository, frameContext: FrameContext, notifyService: FormNotifyService, languageService: LanguageService); /** * 验证表单内的所有表单 */ validate(): Subject; /** * 校验当前行 */ validateCurrentRow(): Observable; /** * 调用表单和实体上的验证规则, 通过后调用回调cb */ validateAll(): Observable; private updateValidationErrors; private updateValidationError; private sortValidationErrors; /** * 校验实体是否满足不能为空的规则 * @param entity 主实体 */ private validateEntityAllowEmptyRule; /** * * @param bindingPaths path不能为空或/,不支持主表 */ private getViewModelNameByBindingPaths; /** * 遍历获取所有不能为空的实体的绑定路径 * @param entityTypeInfo * @param results * @returns */ private getNotAllowEmptyBindingPaths; private deepFirstTraversalEntityTypeInfo; private isAllowEmpty; collectValidationErrors(rootViewModel: ViewModel, errors: ValidationError[], namespace: string, filter?: boolean): void; /** * 重置校验信息(仅当前表单) */ resetValidation(): Observable; /** * 是否在弹窗内部 */ private isInDialog; /** * 拥有独自的校验提示服务 */ private hasOwnVerifyDetailService; /** * 通过bindingPath获取所有匹配的frameContext * @param bindingPath * @returns */ private getFrameContextByBindingPath; private readonly verifyDetailService; private handleErrorClickEvent; private onErrorItemClick; } export { ValidationService };