import * as i0 from '@angular/core'; import { OnInit, InjectionToken, OnChanges, OnDestroy, ChangeDetectorRef, SimpleChanges } from '@angular/core'; import * as i6 from '@angular/forms'; import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms'; import * as i7 from '@sinequa/core/intl'; import { IntlService, Locale } from '@sinequa/core/intl'; import { ModalButton, ModalService } from '@sinequa/core/modal'; import { UserSettingsWebService, PrincipalWebService, Principal } from '@sinequa/core/web-services'; import * as i8 from '@sinequa/core/validation'; import { Validator } from '@sinequa/core/validation'; import { AppService } from '@sinequa/core/app-utils'; import { MapOf } from '@sinequa/core/base'; import * as i10 from '@sinequa/components/action'; import { Action } from '@sinequa/components/action'; import { AuthenticationService, LoginService } from '@sinequa/core/login'; import { NotificationsService } from '@sinequa/core/notification'; import * as i11 from '@sinequa/components/utils'; import { UIService, Placement } from '@sinequa/components/utils'; import * as i5 from '@angular/common'; import * as i9 from '@sinequa/components/modal'; declare namespace JsonInfo { interface Entry { type: string; path: string; valueType: string; label: string; list?: string; pattern?: string; min?: number | Date; max?: number | Date; validators?: Validator[]; } enum InputType { Entry = "JsonEntryInput", Range = "JsonRangeInput", MultiEntry = "JsonMultiEntryInput" } enum ValueType { String = "String", Int = "Int", Number = "Number", Date = "Date", Bool = "Bool" } interface EntryInput extends Entry { type: InputType.Entry; } interface RangeInput extends Entry { type: InputType.Range; } interface MultiEntryInput extends Entry { type: InputType.MultiEntry; distinct?: boolean; nbVisibleLines?: number; } } /** * Opens a dialog to modify the user settings. * */ declare class BsEditUserSettings implements OnInit { private userSettingsService; private intlService; private formBuilder; visibleThreshold: number; showUILanguageSelector?: boolean; model: Record; layout: Record; form: UntypedFormGroup; buttons: ModalButton[]; constructor(userSettingsService: UserSettingsWebService, intlService: IntlService, formBuilder: UntypedFormBuilder); ngOnInit(): void; private setNewValue; /** * Calculates the update patch for user settings. * * @returns the update patch. */ private calculatePatch; /** * Ensures that the form value is of the same type as the user setting before saving it. * * @param entryInfo The entry information. * @param value The form value. * @returns The conformed value for the user setting. */ private ensureType; /** * Casts the value of a given type to another type. *

* If the given value is of array type, it is casted into another array containing element of the * desired type. * * @template T The desired type after casting. * @param inputType The type of form input where the value comes. * @param value The value to cast. * @param castFn The casting function. * @returns the cast result. */ private cast; /** * Reads the form value for the given entry. * * @param key The entry key. * @returns The form value. */ private readFormValue; /** * Sets a JSON value. * * @param json The JSON to set. * @param paths The path of the value in the JSON. * @param value The value to set. */ private setValue; /** * Indicates the height of the dialog content to trigger scroll behavior when there are too many input controls. * * @return the height of the dialog content to trigger scroll behavior when there are too many input controls. */ get maxHeight(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Editor for User settings. *

* This component can add form control for modifiable settings which are not shown by JsonEditor component. * */ declare class BsUserSettingsEditor implements OnInit { private appService; private intlService; private formBuilder; form: UntypedFormGroup; model: MapOf; layout: MapOf; showUILanguageSelector: boolean; locales: Locale[]; constructor(appService: AppService, intlService: IntlService, formBuilder: UntypedFormBuilder); ngOnInit(): void; /** * Sets the current value of an entry to our JSON model. * * @param paths The paths to the entry in the JSON model. * @param value The value to set. */ /** * Indicates if the UI language selector is shown in the User settings editor dialog. * By default, returns true. * * @returns true if the UI language selector is shown in the User settings editor dialog. */ showLanguageSelector(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** A token that is used to inject the help folder options. * * Expects a {@link HelpFolderOptions} object. */ declare const APP_HELP_FOLDER_OPTIONS: InjectionToken; /** * `HelpFolderOptions` is an object with four properties: `name`, `indexFile`, `useLocale`, and * `useLocaleAsPrefix`. * * @property folder - The name of the folder. * @property indexFile - The name of the file that will be used as the index file for the folder. * @property useLocale - If true, the locale will be used to determine the folder to use. * @property useLocaleAsPrefix - If true, the locale will be used as a prefix for the help * folder. For example, if the locale is "en-US", the help folder will be inside "en-US/" folder. * If false, no locale will be used as a prefix. */ type HelpFolderOptions = { path: string; folder?: string; indexFile?: string; useLocale?: boolean; useLocaleAsPrefix?: boolean; }; declare class BsUserMenuComponent implements OnChanges, OnDestroy { private readonly ui; principalService: PrincipalWebService; authenticationService: AuthenticationService; intlService: IntlService; loginService: LoginService; modalService: ModalService; appService: AppService; userSettingsService: UserSettingsWebService; notificationsService: NotificationsService; changeDetectorRef: ChangeDetectorRef; private helpDefaultFolderOptions; icon: string; autoAdjust: boolean; autoAdjustBreakpoint: string; collapseBreakpoint: string; size: string; enableDarkMode: boolean; enableHelp: boolean; showCredits: boolean; display: keyof Principal; showText: boolean; customActions: Action[]; customHelpActions: Action[]; customCreditActions: Action[]; menu: Action; loginAction: Action; logoutAction: Action; overrideAction: Action; revertOverrideAction: Action; adminAction: Action; languageAction: Action; resetUserSettings: Action; darkModeAction: Action; creditAction: Action; helpAction: Action; /** helper function to retrieve the help html file accordingly with the current locale */ static getHelpIndexUrl: (locale: string, options: HelpFolderOptions) => string; constructor(ui: UIService, principalService: PrincipalWebService, authenticationService: AuthenticationService, intlService: IntlService, loginService: LoginService, modalService: ModalService, appService: AppService, userSettingsService: UserSettingsWebService, notificationsService: NotificationsService, changeDetectorRef: ChangeDetectorRef, helpDefaultFolderOptions: HelpFolderOptions | null | undefined); ngOnChanges(changes: SimpleChanges): void; private subscriptions$; ngOnDestroy(): void; updateMenu(): void; getLoginActions(): Action[]; getUIActions(): Action[]; getCreditActions(): Action[]; getHelpActions(): Action[]; getCustomActions(): Action[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsHelpButtonComponent { intlService: IntlService; loginService: LoginService; appService: AppService; private helpDefaultFolderOptions; helpFolderOptions: HelpFolderOptions; tooltip?: string; text?: string; icon?: string; styleClass?: string; tooltipPlacement?: Placement; fallbackPlacements?: Placement[]; constructor(intlService: IntlService, loginService: LoginService, appService: AppService, helpDefaultFolderOptions: HelpFolderOptions | null | undefined); openHelpPage(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsUserSettingsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const enUserSettings: any; declare const frUserSettings: any; declare const deUserSettings: any; /** * The role of this service is to bundle together the simple preferences of * the user and synchronise them with the user settings. * * Usage: * this.userPreferences.get("foo") * this.userPreferences.set("foo", "bar") * this.userPreferences.sync() */ declare class UserPreferences { private userSettingsService; constructor(userSettingsService: UserSettingsWebService); private get prefs(); /** * Returns the value of a property * @param property the name of this property */ get(property: string): any; /** * Sets the value of a property * @param property the name of this property * @param value the value * @param skipSync whether we should skyp syncing (to update multiple properties for example) */ set(property: string, value: any, skipSync?: boolean): void; /** * Deletes a given property from the preferences * @param property the name of this property * @param skipSync whether we should skyp syncing (to update multiple properties for example) */ delete(property: string, skipSync?: boolean): void; /** * Synchronizes the user preferences with the server */ sync(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { APP_HELP_FOLDER_OPTIONS, BsEditUserSettings, BsHelpButtonComponent, BsUserMenuComponent, BsUserSettingsEditor, BsUserSettingsModule, UserPreferences, deUserSettings, enUserSettings, frUserSettings }; export type { HelpFolderOptions };