import { AXPQueryRequest, AXPPagedListResult } from '@acorex/platform/core';
import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
import { HttpClient } from '@angular/common/http';
import * as i0 from '@angular/core';
import * as i1$1 from 'angular-oauth2-oidc';
import { AuthConfig } from 'angular-oauth2-oidc';
import * as i2 from '@acorex/platform/auth';
import { AXPApplicationLoader, AXPSessionContext, AXPApplication, AXPFeatureLoader, AXPFeature, AXPAuthStrategy, AXPBaseCredentials, AXPSignInResult, AXPPermissionLoader, AXPPermission, AXPTenantLoader, AXPTenant } from '@acorex/platform/auth';
import * as i3 from '@acorex/connectivity/utils';
import * as i1 from '@acorex/platform/runtime';
import { Observable } from 'rxjs';
import { AXPUserAvatarProvider, AXPUserAvatarData } from '@acorex/platform/layout/components';

declare class AXCApiEntityStorageService implements AXPEntityStorageService<string, any> {
    private http;
    private configs;
    private filterService;
    private mainUrl;
    private readonly API_VERSION;
    private readonly DEFAULT_AREA;
    constructor(http: HttpClient);
    get dbName(): string;
    getConfigEntity(entityName: string): {
        module: string;
        entity: string;
        area: string;
        version: string;
    };
    initial<T = any>(entityName: string, collection: T[]): Promise<T[]>;
    getOne<T = any>(entityName: string, id: string): Promise<T>;
    updateOne<T = any>(entityName: string, id: string, keyValue: {
        [key: string]: any;
    }): Promise<T>;
    deleteOne(entityName: string, id: string): Promise<void>;
    insertOne<T = any>(entityName: string, entityItem: T): Promise<string>;
    getAll<T = any>(entityName: string): Promise<T[]>;
    query<T = any>(entityName: string, request: AXPQueryRequest): Promise<AXPPagedListResult<T>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXCApiEntityStorageService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXCApiEntityStorageService>;
}

declare class AXCReportManagementApiModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXCReportManagementApiModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXCReportManagementApiModule, never, [typeof i1.AXPRuntimeModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXCReportManagementApiModule>;
}

declare class AXCApiModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXCApiModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXCApiModule, never, [typeof i1$1.OAuthModule, typeof i2.AXPAuthModule, typeof i3.AXCUtilsModule, typeof AXCReportManagementApiModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXCApiModule>;
}

declare class AXMOidcApplicationLoader implements AXPApplicationLoader {
    private http;
    private configs;
    private apiGetApps;
    private apiSetApp;
    constructor(http: HttpClient);
    getList(context: AXPSessionContext): Promise<AXPApplication[]>;
    set(application: AXPApplication): Promise<void>;
    private mapToAXPApplication;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMOidcApplicationLoader, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcApplicationLoader>;
}

interface Localization {
    values: Record<string, Record<string, string>>;
    resources: Record<string, Resource>;
    languages: Language[];
    currentCulture: Culture;
    defaultResourceName: string;
    languagesMap: Record<string, NameValue[]>;
    languageFilesMap: Record<string, NameValue[]>;
}
interface Resource {
    texts: Record<string, string>;
    baseResources: string[];
}
interface Language {
    cultureName: string;
    uiCultureName: string;
    displayName: string;
    twoLetterISOLanguageName: string;
    flagIcon: string;
}
interface Culture {
    displayName: string;
}
interface NameValue {
    name: string;
    value: string;
}
interface Auth {
    grantedPolicies: Record<string, boolean>;
}
interface ApplicationConfiguration {
    localization: Localization;
    auth: Auth;
    setting: Record<string, any>;
    currentUser: any;
    features: Record<string, any>;
    globalFeatures: Record<string, any>;
    multiTenancy: Record<string, any>;
    currentCulture: Culture;
    timing: Record<string, any>;
    clock: Record<string, any>;
    objectExtensions: Record<string, any>;
    extraProperties: Record<string, any>;
}
declare class AXMConfigurationService {
    private http;
    private configs;
    private applicationConfig;
    private apiGetConfig;
    private fetchInProgress;
    private configSubject;
    constructor(http: HttpClient);
    init(): Observable<ApplicationConfiguration>;
    getConfig(): Observable<ApplicationConfiguration>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMConfigurationService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMConfigurationService>;
}

declare class AXMOidcFeatureLoader implements AXPFeatureLoader {
    private list;
    getList(context: AXPSessionContext): Promise<AXPFeature[]>;
}

declare class AXCAPIOidcStrategy extends AXPAuthStrategy {
    private aXMAuthConfigs;
    private oauthService;
    private http;
    private sessionService;
    private router;
    userInfo: any;
    openidConfigurationInfo: any;
    configureOAuth(): Promise<void>;
    signin(credentials: AXPBaseCredentials): Promise<AXPSignInResult | undefined>;
    private handleOidcPasswordSignin;
    updateToken(params: {
        [key: string]: any;
    }): Promise<AXPSignInResult | void>;
    /**
     * Signs out the user according to OpenID Connect standards.
     * Tries to call the standard OIDC end_session_endpoint if available, else falls back to configured logoutUrl.
     * Falls back to root landing page on local logout if nothing is provided.
     * This runs in the background (without redirecting user immediately to the endpoint).
     */
    signout(): Promise<void>;
    refreshToken(context: AXPSessionContext): Promise<AXPSignInResult>;
    private loadAuthData;
    loadUserInfo(): Promise<object>;
    private handleError;
    get name(): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXCAPIOidcStrategy, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXCAPIOidcStrategy>;
}
interface AXPUserPassCredentials extends AXPBaseCredentials {
    username: string;
    password: string;
}
interface AXPOAuthExternalCredentials extends AXPBaseCredentials {
    strategy: string;
    accessToken: string;
    refreshToken: string;
    idToken: string;
    user: string;
    expiresIn: string;
    provider: string;
}
interface IAuthenticationDataModel {
    access_token: string;
    applicationid: string;
    applicationname: string;
    applicationtitle: string;
    editionid: string;
    editionname: string;
    editiontitle: string;
    id_token: string;
    refresh_token: string;
    scope: string;
    tenantid: string;
    tenantname: string;
    tenanttitle: string;
    token_type: string;
    expires_in?: number;
    sub?: string;
    fullname?: string;
    picture?: string;
}

declare class AXMOidcPermissionLoader implements AXPPermissionLoader {
    private http;
    private configs;
    private apiGetConfig;
    constructor(http: HttpClient);
    getList(context: AXPSessionContext): Promise<AXPPermission[]>;
    mapTo(jsonObj: any): string[];
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMOidcPermissionLoader, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcPermissionLoader>;
}

declare class AXMOidcTenantLoader implements AXPTenantLoader {
    private http;
    private configs;
    private apiGetTenants;
    constructor(http: HttpClient);
    getList(context: AXPSessionContext): Promise<AXPTenant[]>;
    set(tenant: AXPTenant): Promise<void>;
    private mapToAXPTenant;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMOidcTenantLoader, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcTenantLoader>;
}

declare class AXCApiUserAvatarProvider implements AXPUserAvatarProvider {
    private userService;
    private sessionService;
    provide(userId: string): Promise<AXPUserAvatarData>;
}

declare class APIGoogleStrategy extends AXPAuthStrategy {
    private aXMAuthConfigs;
    private oauthService;
    private http;
    private sessionService;
    private router;
    private externalAuthorizationService;
    private tenantLoader;
    private applicationLoader;
    userInfo: any;
    authConfig: AuthConfig;
    openidConfigurationInfo: any;
    constructor();
    get name(): string;
    configureOAuth(): Promise<void>;
    signin(credentials: AXPBaseCredentials): Promise<void>;
    signout(): Promise<void>;
    refreshToken(context: AXPSessionContext): Promise<AXPSignInResult>;
    updateToken(params: {
        [key: string]: any;
    }): Promise<AXPSignInResult | undefined>;
    private loadAuthData;
    private handleError;
    static ɵfac: i0.ɵɵFactoryDeclaration<APIGoogleStrategy, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<APIGoogleStrategy>;
}

/**
 * Execute Report DTO - Response from report execution API
 */
interface AXPExecuteReportDto {
    type: string;
    items: Record<string, unknown>[];
    totalCount: number;
}
/**
 * API Response for Category endpoint
 * Used by: GET /api/v1/global/report-management/category
 *          GET /api/v1/global/report-management/category/{parentId}
 */
interface AXCReportCategoryApiResponse {
    totalCount: number;
    items: AXCReportCategoryApiItem[];
}
/**
 * Category Item with recursive structure
 * Each category can contain child categories (folderItems) and reports (reportDefinitionItems)
 */
interface AXCReportCategoryApiItem {
    reportCategoryParentId: string | null;
    name: string;
    title: string;
    description: string | null;
    folderCount: number;
    itemCount: number;
    isArchived: boolean;
    reportDefinitionItems: AXCReportDefinitionApiItem[];
    folderItems: AXCReportCategoryApiItem[];
    id: string;
}
/**
 * Report Definition Item (in category list, without full layout)
 */
interface AXCReportDefinitionApiItem {
    categoryIds: string[];
    name: string;
    title: string;
    description: string | null;
    isArchived: boolean;
    id: string;
}
/**
 * Full Report Definition with complete details including layouts
 * Used by: GET /api/v1/global/report-management/report/{reportId}
 */
interface AXCReportDefinitionApiResponse {
    id: string;
    name: string;
    title: string;
    description: string | null;
    categoryIds: string[];
    parameterGroups: AXCReportParameterGroup[];
    layouts: AXCReportLayoutDefinition[];
    defaultLayoutId: string;
}
/**
 * Parameter Group for report parameters
 */
interface AXCReportParameterGroup {
    name: string;
    title: string;
    parameters: AXCReportParameter[];
}
/**
 * Report Parameter definition
 */
interface AXCReportParameter {
    path: string;
    title: string;
    description?: string;
    widget: {
        type: string;
        path?: string | null;
        options?: any;
        valueTransforms?: any;
    };
}
/**
 * Layout Definition for report display
 */
interface AXCReportLayoutDefinition {
    id: string;
    title: string;
    layout: any;
    dataSource?: {
        type: string;
        name?: string;
        provider?: string;
    };
    export?: {
        fileNameTemplate: string;
        pdf?: any;
        excel?: any;
        csv?: any;
    };
    isDefault?: boolean;
}

export { APIGoogleStrategy, AXCAPIOidcStrategy, AXCApiEntityStorageService, AXCApiModule, AXCApiUserAvatarProvider, AXCReportManagementApiModule, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcTenantLoader };
export type { AXCReportCategoryApiItem, AXCReportCategoryApiResponse, AXCReportDefinitionApiItem, AXCReportDefinitionApiResponse, AXCReportLayoutDefinition, AXCReportParameter, AXCReportParameterGroup, AXPExecuteReportDto, AXPOAuthExternalCredentials, AXPUserPassCredentials, ApplicationConfiguration, Auth, Culture, IAuthenticationDataModel, Language, Localization, NameValue, Resource };
