import { type DataSource, DataSourceField } from '@sisense/sdk-data';
import { HttpClient } from '@sisense/sdk-rest-client';
import { FeatureCollection as GeoJsonFeatureCollection } from 'geojson';
import { GetHierarchiesOptions } from '../../domains/drilldown/hierarchy-model/types';
import { PaletteDto } from '../../infra/api/types/palette-dto';
import { HierarchyDto, SharedFormulaDto, WidgetDto } from '../../domains/widgets/components/widget-by-id/types';
import { TranslatableError } from '../translation/translatable-error';
import type { DashboardDto } from './types/dashboard-dto';
/** PATCH body for persisting Highcharts navigator scroller bounds on a dashboard widget. */
export type WidgetDashboardScrollerLocationPatch = {
    options: Partial<NonNullable<WidgetDto['options']>> & {
        previousScrollerLocation: {
            min: number;
            max: number;
        };
    };
};
/** Supported PATCH bodies for `RestApi.patchWidgetInDashboard`. */
export type PatchWidgetInDashboardBody = Partial<Pick<WidgetDto, 'title'>> | WidgetDashboardScrollerLocationPatch;
type GetDashboardsOptions = {
    searchByTitle?: string;
    fields?: string[];
    expand?: string[];
};
type GetDashboardOptions = {
    fields?: string[];
    sharedMode?: boolean;
};
export declare class RestApi {
    private httpClient;
    private defaultDataSource?;
    constructor(httpClient: HttpClient | undefined, defaultDataSource?: DataSource);
    /**
     * Get all dashboards
     */
    getDashboards: (options?: GetDashboardsOptions) => Promise<({
        oid: string;
        title: string;
        datasource: import("@sisense/sdk-data").JaqlDataSource;
        widgets?: WidgetDto[] | undefined;
        filters?: (import("./types/dashboard-dto").FilterDto | import("./types/dashboard-dto").CascadingFilterDto)[] | undefined;
        filterRelations?: {
            datasource: string;
            filterRelations: import("@sisense/sdk-data").FilterRelationsModelNode;
        }[] | undefined;
        layout?: import("./types/dashboard-dto").LayoutDto | undefined;
        style?: import("./types/dashboard-dto").DashboardStyleDto | undefined;
        settings?: import("./types/dashboard-dto").DashboardSettings | undefined;
        userAuth?: import("../../shared/utils/utility-types").AnyObject | undefined;
    } & import("../../shared/utils/utility-types").AnyObject)[]>;
    /**
     * Get a specific dashboard
     */
    getDashboard: (dashboardOid: string, options?: GetDashboardOptions) => Promise<DashboardDto | undefined>;
    /**
     * Get a specific dashboard using the legacy API version
     */
    getDashboardLegacy: (dashboardOid: string) => Promise<DashboardDto | undefined>;
    /**
     * Get all widgets of a specific dashboard
     */
    getDashboardWidgets: (dashboardOid: string, sharedMode?: boolean) => Promise<WidgetDto[] | undefined>;
    /**
     * Get a specific widget from a dashboard
     */
    getWidget: (widgetOid: string, dashboardOid: string, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
    /**
     * Get a GeoJSON data for all countries
     */
    getCountriesGeoJson: () => Promise<GeoJsonFeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined>;
    /**
     * Get a GeoJSON data for all USA states
     */
    getUsaStatesGeoJson: () => Promise<GeoJsonFeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties> | undefined>;
    /**
     * Get all palettes
     */
    getPalettes: () => Promise<PaletteDto[] | undefined>;
    /**
     * Get hierarchies
     */
    getHierarchies: ({ dataSource, dimension, ids, alwaysIncluded, }: GetHierarchiesOptions) => Promise<HierarchyDto[]>;
    /**
     * Partially update a dashboard
     */
    patchDashboard: (dashboardOid: string, dashboard: Partial<DashboardDto>, sharedMode?: boolean) => Promise<DashboardDto | undefined>;
    /**
     * Add widget to a dashboard
     */
    addWidgetToDashboard: (dashboardOid: string, widgetDto: WidgetDto, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
    /**
     * Delete widget from a dashboard
     */
    deleteWidgetFromDashboard: (dashboardOid: string, widgetOid: string, sharedMode?: boolean) => Promise<void | undefined>;
    /**
     * Partially update a widget in a dashboard.
     */
    patchWidgetInDashboard: (dashboardOid: string, widgetOid: string, patch: PatchWidgetInDashboardBody, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
    /**
     * Get shared formulas by ids
     *
     * @param sharedFormulasIds - An array of shared formulas ids
     * @returns A dictionary of shared formulas
     */
    getSharedFormulas: (sharedFormulasIds: string[]) => Promise<Record<string, SharedFormulaDto>>;
    /**
     * Get a shared formula by id.
     * Uses flat=true so nested formula references are inlined in the response context.
     *
     * @param sharedFormulaId - A shared formula id
     * @returns A shared formula
     */
    getSharedFormula: (sharedFormulaId: string) => Promise<SharedFormulaDto | undefined>;
    /**
     * Get legacy Fusion datasource fields
     *
     * @param dataSource - A datasource name
     * @param options - An object with offset and count
     * @returns A list of datasource fields
     */
    getDataSourceFields: (dataSource: string, options?: {
        offset?: number;
        count?: number;
        searchValue?: string;
    }) => Promise<DataSourceField[] | undefined>;
}
export declare const useRestApi: () => {
    restApi: RestApi | undefined;
    isReady: boolean;
};
export declare class RestApiNotReadyError extends TranslatableError {
    constructor();
}
export {};
