type DashboardColorScheme = 'light' | 'dark' | 'light dark'; export interface DashboardConfiguration { version: number; /** * Hides the refresh button in the dashboard. * * @deprecated This property is not currently available while we take time to conduct additional * testing and analyze additional scenarios. */ hideRefreshButton?: boolean; /** * When true, hides the "Powered by Databricks" logo in the embedded dashboard footer. */ hideDatabricksLogo?: boolean; } export interface NavigateOptions { /** * The ID of the dashboard to navigate to. * * @example 'abcdedf123456' */ dashboardId: string; /** * The ID of the page to navigate to. If not provided, navigates to the first page. * * @example 'ab12cd34' */ pageId?: string; } export interface DatabricksDashboardOptions { /** * The workspace ID where the dashboard is located. * * @example 1234567890123456 */ workspaceId: string; /** * The instance URL of the Databricks workspace. * * @example https://my-databricks-instance */ instanceUrl: string; /** * The container element to render the dashboard in. */ container: HTMLElement; /** * The ID of the dashboard to render. * * @example https://my-databricks-instance/dashboardsv3//published */ dashboardId: string; /** * The id of the page to render. Defaults to the first page. * * @example https://my-databricks-instance/dashboardsv3//published/pages/ */ pageId?: string; /** * The token generated by Databricks. * * ⚠️ CAUTION: This token is accessible by viewers of this page. Please * consider: * - **Restrict the scope of the token appropriately.** Follow Databricks documentation * to ensure the scope shared in the browser only allows access to the * current dashboard. */ token: string | undefined; /** * Utility function that sets a new token for the dashboard. * Use this to maintain access to long-running dashboards without interrupting the user experience. * * @returns A new token generated by Databricks. */ getNewToken?: () => Promise; /** * Specifies the color scheme for the embedded dashboard. * * - "light": Forces light mode * - "dark": Forces dark mode * - "light dark": Allows the dashboard to automatically match the user's system/browser preference * * This value maps to the CSS `color-scheme` property: * https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme */ colorScheme?: DashboardColorScheme; /** * Configuration properties for the dashboard instance to be embedded. */ config?: DashboardConfiguration; } /** * A Databricks dashboard that can be embedded in a web page. * @example * ```typescript * const dashboard = new DatabricksDashboard({ * workspaceId: "1234567890123456", * instanceUrl: "https://my-databricks-instance.com", * container: document.getElementById("dashboard-container"), * dashboardId: "abcdedf123456", * pageId: "ab12cd34", * token: tokenThatCanBeSeenByViewers, * getNewToken: getNewTokenFunction, // Retrieve a new token from your server. * config: { * version: 1, * hideRefreshButton: true, // Hide the refresh button in the dashboard. * hideDatabricksLogo: true, // Hide the "Powered by Databricks" logo. * }, * }).initialize(); * ``` */ export declare class DatabricksDashboard { readonly container: HTMLElement; readonly dashboardId: string; readonly instanceUrl: string; readonly workspaceId: string; readonly pageId: string | undefined; private getNewToken; private iframe; private isDestroyed; private refreshTimeoutId; private initialToken; private config; private isIframeLoaded; private iframeLoadedPromiseResolver; private isIframeLoadedPromise; private colorScheme; constructor({ workspaceId, instanceUrl, container, dashboardId, pageId, token, getNewToken, colorScheme, config, }: DatabricksDashboardOptions); initialize(): void; destroy(): void; /** * Navigate to a different dashboard or page within the embedded iframe without reloading. * This provides a smooth transition between dashboards. * * @param options - Navigation options including dashboardId and optional pageId * @throws {DatabricksDashboardError} If the instance is destroyed or iframe is not loaded * * @example * ```typescript * // Navigate to a different dashboard * dashboard.navigate({ dashboardId: 'xyz789' }); * * // Navigate to a specific page in a dashboard * dashboard.navigate({ dashboardId: 'xyz789', pageId: 'page123' }); * ``` */ navigate(options: NavigateOptions): Promise; private initializeIframe; private initializeRefreshTokenTimer; private initializeConfig; private displayError; private handleMessages; /** * Validates and migrates the configuration to the latest version. Provides sensible defaults where possible. * * @param config - The configuration to migrate. * @returns The migrated configuration, or throws an error if the configuration is invalid. */ private migrateConfig; } export {}; //# sourceMappingURL=DatabricksDashboard.d.ts.map