import { Switchboard } from '@superset-ui/switchboard'; /** * The function to fetch a guest token from your Host App's backend server. * The Host App backend must supply an API endpoint * which returns a guest token with appropriate resource access. */ export declare type GuestTokenFetchFn = () => Promise; export declare type UiConfigType = { hideTitle?: boolean; hideTab?: boolean; hideChartControls?: boolean; emitDataMasks?: boolean; filters?: { [key: string]: boolean | undefined; visible?: boolean; expanded?: boolean; }; urlParams?: { [key: string]: any; }; showRowLimitWarning?: boolean; }; export declare type EmbedDashboardParams = { /** The id provided by the embed configuration UI in Superset */ id: string; /** The domain where Superset can be located, with protocol, such as: https://abc123.us1a.preset.io */ supersetDomain: string; /** The html element within which to mount the iframe */ mountPoint: HTMLElement; /** A function to fetch a guest token from the Host App's backend server */ fetchGuestToken: GuestTokenFetchFn; /** The dashboard UI config: hideTitle, hideTab, hideChartControls, filters.visible, filters.expanded **/ dashboardUiConfig?: UiConfigType; /** Enables extra logging */ debug?: boolean; /** The iframe title attribute */ iframeTitle?: string; /** additional iframe sandbox attributes ex (allow-top-navigation, allow-popups-to-escape-sandbox) **/ iframeSandboxExtras?: string[]; /** force a specific refererPolicy to be used in the iframe request **/ referrerPolicy?: ReferrerPolicy; }; export declare type Size = { width: number; height: number; }; export declare type ObserveDataMaskCallbackFn = (dataMask: Record & { crossFiltersChanged: boolean; nativeFiltersChanged: boolean; }) => void; export declare type ThemeMode = 'default' | 'dark' | 'system'; export declare type EmbeddedDashboard = { getScrollSize: () => Promise; unmount: () => void; getDashboardPermalink: (anchor: string) => Promise; getActiveTabs: () => Promise; observeDataMask: (callbackFn: ObserveDataMaskCallbackFn) => void; getDataMask: () => Record; setThemeConfig: (themeConfig: Record) => void; setThemeMode: (mode: ThemeMode) => void; getChartDataPayloads: (params?: { chartId?: number; }) => Promise>; }; /** * Embeds a Superset dashboard into the page using an iframe. */ export declare function embedDashboard({ id, supersetDomain, mountPoint, fetchGuestToken, dashboardUiConfig, debug, iframeTitle, iframeSandboxExtras, referrerPolicy, }: EmbedDashboardParams): Promise; export declare function _initComms(window: Window, targetOrigin: string, debug?: boolean): Switchboard;