import { DataSource } from '@sisense/sdk-data';
import { RestApi } from '../../../../../infra/api/rest-api';
import { AppSettings } from '../../../../../infra/app/settings/settings';
import { CompleteThemeSettingsInternal } from '../../../../../types';
import { UseDashboardModelInternalAction } from './types.js';
export type PersistDashboardModelMiddlewareParams = {
    /** Dashboard OID, or undefined if not initialized */
    dashboardOid: string | undefined;
    /** Internal dashboard model action to persist */
    action: UseDashboardModelInternalAction;
    /** Sisense REST API instance */
    restApi: RestApi;
    /** Whether the dashboard is in shared mode */
    sharedMode: boolean;
    /** Application settings forwarded to {@link toWidgetDto} (controls widget design feature flag) */
    appSettings: AppSettings;
    /** Theme settings forwarded to {@link toWidgetDto} (used as defaults for widget design) */
    themeSettings: CompleteThemeSettingsInternal;
    /**
     * Dashboard-level data source. Used as a fallback data source for widgets
     * whose model does not carry one (e.g. text widgets), so the produced DTO
     * still satisfies the server's datasource schema.
     */
    dashboardDataSource?: DataSource;
};
/**
 * Middleware that persists the dashboard model changes to the Sisense server.
 *
 * @returns Promise resolving to the action (possibly transformed, e.g. for ADD_WIDGET)
 * @internal
 */
export declare function persistDashboardModelMiddleware({ dashboardOid, action, restApi, sharedMode, appSettings, themeSettings, dashboardDataSource, }: PersistDashboardModelMiddlewareParams): Promise<UseDashboardModelInternalAction>;
