import { QueryEngineConfig, QueryEngineEndpoint } from '../../shared-logic/src/QueryEngineConfig/types';
import { identityCallback, loadDataCallback, loadDataSetsCallback, loadQueryEngineConfigCallback, programmaticDashboardCallback } from '../../shared-logic/src/Callbacks/types';
import { IdentityConfig } from '../../shared-logic/src/IdentityConfig/types';
import { DashboardStorageStrategy } from '../../shared-logic/src/DashboardAPI/types';
import { DataSet } from '../../shared-logic/src/DataSet/types';
import { Dashboard as DashboardFromAPI, UpdateGlobalLibraryParams as APIUpdateGlobalLibraryParams, GlobalLibrary } from '@vizzly/api-client';
import * as DashboardLogic from '../../shared-logic/src/Dashboard';
import { LoaderOptions } from './VizzlyLoader';
import { Row, Cell, Dashboard, Header, Library, Editor } from './Services';
import * as Views from './Services/View';
import type { ViewConfiguration } from '../../shared-logic/src/ViewConfiguration/types';
import { EventBus, EventBusParams } from './eventbus.types';
import { QueryAttributes } from '../../shared-logic/src/QueryAttributes/types';
import { CustomDriver } from '../../results-driver/src/types';
import { Result } from '../../shared-logic/src/Result/types';
import { DateTimeFilterOptions } from '../../shared-logic/src/DateTime/types';
import { VariableList } from '../../shared-logic/src/Variables/types';
import { FilterConfig } from '../../shared-logic/src/AdditionalFilter/types';
import * as Field from '../../shared-logic/src/Field';
import * as QueryEngineConfigLogic from '../../shared-logic/src/QueryEngineConfig';
export type { FilterConfig } from '../../shared-logic/src/AdditionalFilter/types';
export type { ViewConfiguration } from '../../shared-logic/src/ViewConfiguration/types';
export { VizzlyInstanceNotLoaded } from './errors/VizzlyInstanceNotLoaded';
import { CustomField } from '../../shared-logic/src/CustomField/types';
import { AliasFields } from '../../shared-logic/src/AliasFields/types';
export declare type FilterDashboardOptions = {
    onlyAllowScope?: 'read' | 'read_write';
    onlyChildDashboardsForParent?: string;
    onlyChildDashboards?: boolean;
    onlyParentDashboards?: boolean;
    onlyDashboardsIncludingMetadata?: DashboardLogic.Dashboard['metadata'];
};
export declare type VizzlyServicesProperties = {
    queryEngine: 'in-browser' | QueryEngineEndpoint | loadQueryEngineConfigCallback | undefined;
    identity: identityCallback;
    programmaticDashboard?: programmaticDashboardCallback;
    dataSets?: loadDataSetsCallback;
    extraCustomFields?: (dataSet: DataSet) => Array<CustomField>;
};
declare class VizzlyServices {
    private queryEngineConfig;
    static queryEngine: QueryEngineEndpoint | loadQueryEngineConfigCallback | undefined;
    private dataSets;
    private identityConfig;
    private vizzlyAPIClient;
    private programmaticDashboard;
    static _instanceStore: {
        [instanceId: string]: VizzlyServices;
    };
    static DEFAULT_INSTANCE_ID: string;
    private static eventBus;
    constructor(identityConfig: IdentityConfig, queryEngineConfig: QueryEngineConfig, dataSets: DataSet[], dashboardStorageStrategy: DashboardStorageStrategy, programmaticDashboard: programmaticDashboardCallback | undefined, options: {
        host: string;
    });
    getDataSets(): DataSet<DataSet.Field>[];
    /**
     * @param properties
     * @param options
     * @returns Vizzly instance for programmatically managing dashboards.
     */
    static load(properties: VizzlyServicesProperties, options?: LoaderOptions): Promise<VizzlyServices>;
    static use(instanceId?: string): VizzlyServices;
    static waitToUse(instanceId?: string, timeoutMs?: number): Promise<any>;
    static clearInstances(): void;
    /**
     * Use the dashboard API to create the dashboard, upcast
     * and return the dashboard with the data sets.
     */
    createDashboard(params: CreateDashboardParams): Promise<DashboardLogic.Dashboard>;
    updateDashboard(params: UpdateDashboardParams): Promise<DashboardLogic.Dashboard>;
    getDashboards(params?: {
        abortController?: AbortController;
    }): Promise<DashboardLogic.Dashboard[]>;
    /**
     * Provides the configuration needed for each Vizzly view.
     */
    getViewConfiguration(): ViewConfiguration;
    getIdentityConfig(): IdentityConfig;
    query(queries: Query[], params?: QueryParams): Promise<QueryResponse>;
    static upcastDashboard(dashboard: DashboardFromAPI, dataSets: DataSet[], queryEngineConfig: QueryEngineConfig): Array<DashboardLogic.Dashboard>;
    static filterDashboards(dashboards: DashboardLogic.Dashboard[], options: FilterDashboardOptions): DashboardLogic.Dashboard[];
    updateGlobalLibrary(params: UpdateGlobalLibraryParams): Promise<GlobalLibrary | undefined>;
    /**
     * Publishes data to all subscribed event bus listeners.
     * This method is static and will affect all instances of Vizzly.
     * @param data The event bus options containing dashboard data and targets.
     */
    static publish(event: EventBusParams): void;
    /**
     * Subscribes a new listener to the event bus and provides a method to unsubscribe.
     * @param listener The event listener to subscribe.
     * @returns A function that unsubscribes the listener when called.
     */
    static subscription(listener: EventBus): () => void;
    static Row: typeof Row;
    static Cell: typeof Cell;
    static Dashboard: typeof Dashboard;
    static Editor: typeof Editor;
    static Header: typeof Header;
    static Library: typeof Library;
    static View: typeof Views.View;
    static AreaChart: typeof Views.AreaChart;
    static AreaChartV2: typeof Views.AreaChartV2;
    static LineChart: typeof Views.LineChart;
    static LineChartV2: typeof Views.LineChartV2;
    static BarChart: typeof Views.BarChart;
    static BarChartV2: typeof Views.BarChartV2;
    static PieChart: typeof Views.PieChart;
    static BubbleChart: typeof Views.BubbleChart;
    static BubbleChartV2: typeof Views.BubbleChartV2;
    static ScatterChart: typeof Views.ScatterChart;
    static ComboChart: typeof Views.ComboChart;
    static ComboChartV2: typeof Views.ComboChartV2;
    static PivotTable: typeof Views.PivotTable;
    static BasicTable: typeof Views.BasicTable;
    static HorizontalBarChart: typeof Views.HorizontalBarChart;
    static HorizontalBarChartV2: typeof Views.HorizontalBarChartV2;
    static MercatorMap: typeof Views.MercatorMap;
    static SingleStat: typeof Views.SingleStat;
    static Progress: typeof Views.Progress;
    static RichText: typeof Views.RichText;
    static WaterfallChart: typeof Views.WaterfallChart;
    static FunnelChart: typeof Views.FunnelChart;
    static SunburstChart: typeof Views.SunburstChart;
    static RadarChart: typeof Views.RadarChart;
}
export declare type UpdateDashboardParams = {
    dashboardId: string;
    definition?: DashboardLogic.SaveableDashboardDefinition;
    deleted?: boolean;
    metadata?: Object;
    /** @deprecated Use metadata instead. */
    meta?: Object;
    abortSignal?: AbortSignal;
    name?: string;
};
export declare type UpdateGlobalLibraryParams = APIUpdateGlobalLibraryParams & {
    globalLibraryId: string;
    abortSignal?: AbortSignal;
};
export declare type CreateDashboardParams = {
    definition: DashboardLogic.SaveableDashboardDefinition;
    /** @deprecated - use `metadata` instead */
    meta?: Object;
    /**
     * The metadata for the dashboard.
     *
     * @property {any} meta - The metadata for the dashboard can be set to anything you require.
     *
     */
    metadata?: Object;
    /**
     * The ID of the parent dashboard.
     *
     * @property {string} parentDashboardId - The ID of the parent dashboard.
     * @default The default parent dashboard ID.
     */
    parentDashboardId: string;
    abortSignal?: AbortSignal;
};
export declare type Query = QueryAttributes;
export declare type QueryResponse = {
    results: (Result | null)[] | (any[][] | null)[] | null;
};
export declare type Vizzly = VizzlyServices;
export declare const Vizzly: typeof VizzlyServices;
export declare type QueryParams = {
    abortController?: AbortController;
    instanceId?: string;
    runQueries?: CustomDriver['runQueries'];
    data?: loadDataCallback;
    queryEngineEndpoint?: QueryEngineEndpoint;
    dateFilterOptions?: DateTimeFilterOptions;
    variables?: VariableList;
    aliasFields?: AliasFields;
    filterConfig?: FilterConfig;
};
export declare const SharedLogic: {
    Field: typeof Field;
    QueryEngineConfig: typeof QueryEngineConfigLogic;
};
