import * as i0 from "@angular/core"; import { OnDestroy } from "@angular/core"; import { SafeHtml } from "@angular/platform-browser"; import { Observable } from "rxjs"; import { Attribute, PasswordPolicies, Validators } from "keycloakify/login/KcContext"; import { I18n } from "@keycloakify/angular/login/i18n"; import * as reactlessApi from "keycloakify/login/lib/getUserProfileApi"; import { getButtonToDisplayForMultivaluedAttributeField } from "keycloakify/login/lib/getUserProfileApi"; export type FormFieldError = { errorMessage: SafeHtml; errorMessageStr: string; source: FormFieldError.Source; fieldIndex: number | undefined; }; export declare namespace FormFieldError { type Source = Source.Validator | Source.PasswordPolicy | Source.Server | Source.Other; namespace Source { type Validator = { type: 'validator'; name: keyof Validators; }; type PasswordPolicy = { type: 'passwordPolicy'; /** * passwordHistory and forceExpiredPasswordChange can't be validated client side * (they require the stored credentials), they are only informative. */ name: Exclude; }; type Server = { type: 'server'; }; type Other = { type: 'other'; rule: 'passwordConfirmMatchesPassword' | 'requiredField'; }; } } export type FormFieldState = { attribute: Attribute; displayableErrors: FormFieldError[]; valueOrValues: string | string[]; }; export type FormState = { isFormSubmittable: boolean; formFieldStates: FormFieldState[]; }; export type FormAction = { action: 'update'; name: string; valueOrValues: string | string[]; /** Default false */ displayErrorsImmediately?: boolean; } | { action: 'focus lost'; name: string; fieldIndex: number | undefined; }; export type KcContextLike = reactlessApi.KcContextLike; export type I18nLike = Pick; export declare class UserProfileFormService implements OnDestroy { #private; formState$: Observable; dispatchFormAction: (action: FormAction) => void; constructor(); ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { getButtonToDisplayForMultivaluedAttributeField };