import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
import { CdkMenuTrigger } from '@angular/cdk/menu';
import { DisplayDensity, ISelectOption, NgmAppearance } from '@metad/ocap-angular/core';
import { ChartAnnotation, ChartOptions, ChartSettings, ChartType, DataSettings, Dimension, ISlicer, Property } from '@metad/ocap-core';
import { EChartEngineEvent } from '@metad/ocap-echarts';
import { ComponentStore } from '@metad/store';
import { ECharts } from 'echarts/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { Step } from '@metad/ocap-angular/common';
import { TranslateService } from '@ngx-translate/core';
import { SlicersCapacity } from '@metad/ocap-angular/selection';
import * as i0 from "@angular/core";
export interface DrillLevel {
    parent: Dimension;
    dimension: Dimension;
    slicer: ISlicer;
    value?: any;
    text?: string;
    active?: boolean;
}
export interface AnalyticalCardOptions {
    showSlicers?: boolean;
    /**
     * Hide elements in this component
     */
    hideHeader?: boolean;
    hideRefresh?: boolean;
    hideLoading?: boolean;
    hideScreenshot?: boolean;
    hideDataDownload?: boolean;
    disableContextMenu?: boolean;
    /**
     * Enable realtinme linked analysis: output slicers immediately when data selected
     */
    realtimeLinked?: boolean;
}
export interface AnalyticalCardState {
    dataSettings: DataSettings;
    drilledDimensions: Array<DrillLevel>;
    selectedDrilledDimensions: Array<DrillLevel>;
    selectedSlicers: ISlicer[];
}
export declare class AnalyticalCardComponent extends ComponentStore<AnalyticalCardState> implements OnInit, OnDestroy {
    #private;
    DisplayDensity: typeof DisplayDensity;
    eSlicersCapacity: typeof SlicersCapacity;
    private readonly businessService;
    readonly translate: TranslateService;
    private readonly _ngZone;
    private readonly _cdr;
    private echartsEngine;
    private _slicersChanging$;
    _isAnalyticalCard: boolean;
    title: string;
    appearance: NgmAppearance;
    /**
     * Data Settings
     */
    get dataSettings(): DataSettings;
    set dataSettings(value: DataSettings);
    private _dataSettings$;
    _dataSettings: import("@angular/core").WritableSignal<DataSettings>;
    readonly chartSettings: import("@angular/core").InputSignal<ChartSettings>;
    readonly chartOptions: import("@angular/core").InputSignal<ChartOptions>;
    readonly options: import("@angular/core").InputSignal<AnalyticalCardOptions>;
    get slicers(): ISlicer[];
    set slicers(value: ISlicer[]);
    /**
     * @deprecated use slicersChanging
     */
    slicersChange: EventEmitter<ISlicer[]>;
    /**
     * To avoid being confused with slicers & slicersChange
     */
    slicersChanging: Observable<ISlicer[]>;
    chartClick: Observable<any>;
    chartHighlight: Observable<unknown>;
    chartContextMenu: Observable<EChartEngineEvent>;
    explain: EventEmitter<any[]>;
    contextMenu: CdkMenuTrigger;
    contextMenuPosition: {
        x: string;
        y: string;
    };
    get displayDensity(): DisplayDensity;
    readonly _chartSettings: import("@angular/core").Signal<ChartSettings>;
    readonly _chartOptions: import("@angular/core").Signal<ChartOptions>;
    readonly _options: import("@angular/core").Signal<AnalyticalCardOptions>;
    readonly showHeader: import("@angular/core").Signal<boolean>;
    get chartType(): ChartType;
    set chartType(chartType: ChartType);
    readonly options$: Observable<any>;
    readonly isLoading$: BehaviorSubject<boolean>;
    readonly error$: BehaviorSubject<string>;
    private _empty$;
    set empty(value: boolean);
    readonly empty$: Observable<boolean>;
    readonly selectedDrilledDimensions$: Observable<DrillLevel[]>;
    readonly selectedSlicers$: Observable<ISlicer[]>;
    readonly drilledDimensions$: Observable<DrillLevel[]>;
    readonly breadcrumbs$: Observable<Step[]>;
    readonly dillSlicers$: Observable<ISelectOption<ISlicer>[]>;
    /**
     * 维度下钻
     * 1. 来自于 PresentationVariant 中的 groupBy
     * 2. disable 已被选中的下钻维度
     */
    readonly drillDimensions$: Observable<{
        dimension: Dimension;
        property: Property;
        disabled: boolean;
    }[]>;
    readonly canDrillDimensions$: Observable<boolean>;
    /**
     * 最终的数据设置
     */
    readonly dataSettings$: Observable<{
        selectionVariant: {
            selectOptions: ISlicer[];
            id?: string;
            text?: string;
            parameters?: {
                [key: string]: any;
            };
            filterExpression?: string;
        };
        modelId?: string;
        dataSource: string;
        entitySet: string;
        dimension?: Dimension;
        chartAnnotation?: ChartAnnotation;
        presentationVariant?: import("@metad/ocap-core").PresentationVariant;
        selectionPresentationVariant?: import("@metad/ocap-core").SelectionPresentationVariant[];
        analytics?: import("@metad/ocap-core").AnalyticsAnnotation;
        selectionFieldsAnnotation?: import("@metad/ocap-core").SelectionFieldsAnnotation;
        valueListAnnotation?: import("@metad/ocap-core").ValueListAnnotation;
        KPIAnnotation?: import("@metad/ocap-core").KPIType;
        identificationAnnotation?: import("@metad/ocap-core").IdentificationAnnotation;
        lazyInit?: boolean;
    }>;
    /**
     * 1. TODO 暂时取 chartAnnotation 中所有的 dimensions 维度
     * 2. disable 级别数小于已选中层级的维度
     */
    readonly drillLevels$: Observable<({
        property: import("@metad/ocap-core").PropertyHierarchy;
        slicer: any;
        levels?: undefined;
        slicerCaption?: undefined;
    } | {
        slicer: ISlicer;
        property: import("@metad/ocap-core").PropertyHierarchy;
        levels: {
            property: import("@metad/ocap-core").PropertyLevel;
            disabled: boolean;
        }[];
        slicerCaption: any;
    })[]>;
    readonly canDrillLevels$: Observable<boolean>;
    /**
     * 默认下钻行为: 如果图形为多维度, 则默认取第一个维度
     */
    readonly dilldown$: Observable<ISlicer>;
    /**
    |--------------------------------------------------------------------------
    | Subscriptions (effect)
    |--------------------------------------------------------------------------
    */
    private _dataSettingsSub;
    private _explainSub;
    private _echartsOptionSub;
    private _contextMenuSub;
    private _selectChangedSub;
    constructor();
    ngOnInit(): void;
    /**
     * Refresh data
     *
     * @param force Force refresh
     */
    refresh(force?: boolean): void;
    onChartInit(event: ECharts): void;
    onOptionsError(event: Error): void;
    openContextMenu(slicers: ISlicer[], event?: any): void;
    /**
     * Linked analysis, output selected slicers on chart
     *
     * @param slicers
     */
    onLinkAnalysis(slicers: ISlicer[]): void;
    readonly drill: (observableOrValue: DrillLevel | Observable<DrillLevel>) => import("rxjs").Subscription;
    readonly reselectDrill: (observableOrValue: any[] | Observable<any[]>) => import("rxjs").Subscription;
    readonly drillLevel: (observableOrValue: {
        slicer: ISlicer;
        property: Property;
    } | Observable<{
        slicer: ISlicer;
        property: Property;
    }>) => import("rxjs").Subscription;
    readonly drillDown: (observableOrValue: ISlicer | Observable<ISlicer>) => import("rxjs").Subscription;
    readonly clearDrill: () => void;
    updateSlicers(slicers: ISlicer[]): void;
    screenshot(): void;
    downloadData(): void;
    get _drilled(): DrillLevel[];
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AnalyticalCardComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AnalyticalCardComponent, "ngm-analytical-card", never, { "title": { "alias": "title"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "dataSettings": { "alias": "dataSettings"; "required": false; }; "chartSettings": { "alias": "chartSettings"; "required": false; "isSignal": true; }; "chartOptions": { "alias": "chartOptions"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "slicers": { "alias": "slicers"; "required": false; }; }, { "slicersChange": "slicersChange"; "slicersChanging": "slicersChanging"; "chartClick": "chartClick"; "chartHighlight": "chartHighlight"; "chartContextMenu": "chartContextMenu"; "explain": "explain"; }, never, ["*", "[ngmAction]"], false, never>;
}
