import { CookieService } from 'ngx-cookie-service';
import { AccountScope, JaceIdentity, SearchResultContainer, KeyValue, ApplicationJob, ActiveModuleView, ApplicationMenu, UserAccount } from '@esfaenza/core/domain';
import * as i0 from '@angular/core';
import { ErrorHandler, Injector, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
import { Router, ActivatedRouteSnapshot } from '@angular/router';
import { AccessControlService, AccessControlRouteGuard } from '@esfaenza/access-control';
import { HttpServiceExtensions, HTTPService } from '@esfaenza/httpservice';
import { LocalizationService } from '@esfaenza/localizations';
import { InterComService, AppEmbeddingExtensions, InterComMessage, MessageService, CallResult } from '@esfaenza/extensions';
import { NotificationsService, BaseMessageService } from '@esfaenza/signalr-notifications';
import { PreferencesService, BaseSessionRetriever, CachePersistor, PreferencesPersistor } from '@esfaenza/preferences';
import { HttpClient } from '@angular/common/http';
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';

declare class TokenService {
    cs: CookieService;
    USE_FAKE_ACCESS_TOKEN: boolean;
    ANONYMOUS_MODE: boolean;
    accountScope: AccountScope;
    constructor(cs: CookieService, USE_FAKE_ACCESS_TOKEN: boolean, ANONYMOUS_MODE: boolean);
    clearTokens(): void;
    getAccessToken(): String;
    getJaceIdentity(): JaceIdentity;
    private getFakeToken;
    private getFakeAccountScope;
    static ɵfac: i0.ɵɵFactoryDeclaration<TokenService, [null, { optional: true; }, { optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<TokenService>;
}

declare class GlobalSearchService {
    Enabled: boolean;
    /**
     * Effettua una ricerca in base a un termine generico
     *
     * @param term Termine da cercare
     * @returns {SearchResultContainer} Contenitore della ricerca
     */
    search(term: string): Observable<SearchResultContainer>;
    /**
     * Data la definizione semplice di una colonna restituisce un oggetto che indica se bisogna presentere un link su di essa
     *
     * @param column Colonna per cui verificare la presentazione di un link. Esempio: {id: "IDPARTY", description: "Cod. Controparte"}
     * @returns {{ routePath: string, routeProperties: string[] }} Oggetto che indica un link con i propri binding. Ad esempio: {routePath: "['/pages/parties/parties_details', { 'idModel': '{0}' }]", routeProperties: ["IDPARTY"]}
     */
    generateColumnLink(column: KeyValue): {
        routePath: string;
        routeProperties: string[];
    };
    static ɵfac: i0.ɵɵFactoryDeclaration<GlobalSearchService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<GlobalSearchService>;
}

declare class APPErrorHandler implements ErrorHandler {
    private injector;
    private router;
    private msgsExts;
    constructor(injector: Injector);
    handleError(error: any): void;
    b64EncodeUnicode(str: any): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<APPErrorHandler, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<APPErrorHandler>;
}

declare class OutZoneEventPlugin {
    private zone;
    constructor(zone: NgZone);
    supports(eventName: string): boolean;
    addEventListener(element: HTMLElement, eventName: string, originalHandler: Function): Function;
    static ɵfac: i0.ɵɵFactoryDeclaration<OutZoneEventPlugin, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<OutZoneEventPlugin>;
}

declare class AppState {
    private router;
    private prefs;
    private inj;
    private bts;
    private notifications;
    private MessageDef;
    private intercom;
    private emb;
    private fakeToken;
    private anonymousMode;
    private PREFS_DISABLE_EFFECTS;
    sidebarWidth: number;
    headerHeight: number;
    graphicEffects: i0.WritableSignal<boolean>;
    redirectingToLogin: boolean;
    handlingError: boolean;
    christmasTime: i0.WritableSignal<boolean>;
    halloweenTime: i0.WritableSignal<boolean>;
    private SessionIdentity;
    private JaceIdentity;
    jobsInProgress: number;
    allJobs: ApplicationJob[];
    private jobWithIdsCache;
    notifyOnCompletedJobs: boolean;
    private _data;
    private _subscriptions;
    ModulesLocalizations: {
        [id: string]: LocalizationService;
    };
    private _modules;
    set Modules(modules: ActiveModuleView[]);
    get Modules(): ActiveModuleView[];
    constructor(router: Router, prefs: PreferencesService, inj: Injector, bts: TokenService, notifications: NotificationsService, MessageDef: BaseMessageService, intercom: InterComService, emb: AppEmbeddingExtensions, fakeToken: boolean, anonymousMode: boolean);
    hookPreferences(): Promise<void>;
    getActiveJaceModules(): void;
    hookEmbedding(): void;
    /** Tenant§Account§User§APPNAME */
    getSessionIdentity(): string;
    registerNavigationIfMeaningful(route?: ActivatedRouteSnapshot): void;
    handleInboundMessage(t: InterComMessage): void;
    setupSignalRJobListening(): void;
    roundToTwo(num: any): number;
    getJaceIDentity(): JaceIdentity;
    notifyDataChanged(event: any, value: any): void;
    subscribe(event: string, callback: Function): void;
    _onEvent(data: any): void;
    setSidebarWidth(width: number): void;
    setHeaderHeight(height: number): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AppState, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AppState>;
}

declare class HTTPServiceExtensions implements HttpServiceExtensions {
    private lc;
    private tks;
    private as;
    private router;
    private ac;
    private msgs;
    constructor(lc: LocalizationService, tks: TokenService, as: AppState, router: Router, ac: AccessControlService, msgs: MessageService);
    retrieveAccessToken(): string;
    retrieveIdentity(): {
        IdUser: string;
        Idtenant: string;
    };
    readRedirectingToLogin(): boolean;
    writeRedirectingToLogin(status: boolean): void;
    redirectToLogin(): void;
    readRedirectionStatus(): boolean;
    writeRedirectionStatus(status: boolean): void;
    readHandlingErrorStatus(): boolean;
    writeHandlingErrorStatus(status: boolean): void;
    handleNotConfiguredException(): boolean;
    handleBlockingException(status: number, text: string): void;
    handleException(status: number, text: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<HTTPServiceExtensions, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<HTTPServiceExtensions>;
}

declare class MenuFilteringService {
    /**
     * Applica un filtro agli elementi di menù in modo da poterli filtrare in base a condizioni arbitrarie (inclusi check lato BE)
     *
     * @param rawMenus Menù originali, non filtrati
     * @returns {Observable<ApplicationMenu[]>} Menù filtrati
     */
    filter(rawMenus: ApplicationMenu[]): Observable<ApplicationMenu[]>;
    static ɵfac: i0.ɵɵFactoryDeclaration<MenuFilteringService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<MenuFilteringService>;
}

declare class CompletedJobRedirectionService {
    /**
     * Effettua un'operazione di redirect basata sul Job Completato
     *
     * @param completedJob Job appena completato per cui effettuare un redirect
     */
    redirect(completedJob: ApplicationJob): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<CompletedJobRedirectionService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<CompletedJobRedirectionService>;
}

declare class SessionRetriever implements BaseSessionRetriever {
    private bts;
    private router;
    private anonymousMode;
    constructor(bts: TokenService, router: Router, anonymousMode: boolean);
    /** Tenant§Account§User§ModuleId */
    getSessionKey(global?: boolean): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<SessionRetriever, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SessionRetriever>;
}

declare class ApplicationCachePersistor extends CachePersistor {
    private lc;
    private http;
    private tks;
    constructor(lc: LocalizationService, http: HttpClient, tks: TokenService, session: BaseSessionRetriever);
    persist<T>(key: string, item: T): Observable<boolean>;
    recover<T>(key?: string): Observable<T>;
    recoverAll(): Observable<{
        [index: string]: any;
    }>;
    remove(key?: string): Observable<boolean>;
    clear(): Observable<boolean>;
    private getHeaders;
    private getSessionUrl;
    private getItemsUrl;
    private getItemUrl;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationCachePersistor, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationCachePersistor>;
}

declare class ApplicationPreferencesPersistor extends PreferencesPersistor {
    private lc;
    private http;
    private tks;
    constructor(lc: LocalizationService, http: HttpClient, tks: TokenService, session: BaseSessionRetriever);
    persist<T>(key: string, item: T, global?: boolean): Observable<boolean>;
    recover<T>(key?: string, global?: boolean): Observable<T>;
    recoverAll(global?: boolean): Observable<{
        [index: string]: any;
    }>;
    remove(key?: string, global?: boolean): Observable<boolean>;
    clear(global?: boolean): Observable<boolean>;
    private getHeaders;
    private getSessionUrl;
    private getItemsUrl;
    private getItemUrl;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationPreferencesPersistor, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationPreferencesPersistor>;
}

declare class UserPreferencesService {
    private injector;
    private AccountId;
    ProfilePicture: SafeResourceUrl;
    fakeToken: boolean;
    sanitizer: DomSanitizer;
    http: HTTPService;
    msgExts: MessageService;
    constructor(injector: Injector);
    getAccountProfile(): Promise<UserAccount>;
    doReloadProfilePicture(): Promise<void>;
    getCurrentProfilePicture(): Promise<string>;
    doUpdateProfilePicture(image: any): Promise<CallResult>;
    doUpdateRecoverySettings(email: string): Promise<CallResult>;
    doUpdatePassword(oldPassword: string, newPassword: string, newPasswordConfirm: string): Promise<CallResult>;
    doDeleteProfilePicture(): Promise<CallResult>;
    static ɵfac: i0.ɵɵFactoryDeclaration<UserPreferencesService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<UserPreferencesService>;
}

declare class BaseRouterGuard extends AccessControlRouteGuard {
    constructor(ms: MessageService, acc: AccessControlService, router: Router, ts: TokenService);
    static ɵfac: i0.ɵɵFactoryDeclaration<BaseRouterGuard, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<BaseRouterGuard>;
}

export { APPErrorHandler, AppState, ApplicationCachePersistor, ApplicationPreferencesPersistor, BaseRouterGuard, CompletedJobRedirectionService, GlobalSearchService, HTTPServiceExtensions, MenuFilteringService, OutZoneEventPlugin, SessionRetriever, TokenService, UserPreferencesService };
