@mongodb-js/charts-embed-dom
Version:
JavaScript library for embedding MongoDB Charts
27 lines (26 loc) • 1.24 kB
TypeScript
import { EmbedDashboardOptions } from '.';
import type { EmbedChartOptions, PlainObject, SharedEmbedOptions } from './types';
export declare const SDK_PROTOCOL_CHART: "3";
export declare const SDK_PROTOCOL_DASHBOARD: "3";
export declare const isPlainObject: (value: unknown) => value is PlainObject;
/**
* Retrieves embed options that are shared.
*
* Validates the values passed in as well.
*/
export declare const getSharedEmbedOptions: (options: Partial<SharedEmbedOptions>) => SharedEmbedOptions;
export declare const getPathname: (url: URL, pathname: string) => string;
/**
* Constructs the chart iframe URL from the baseUrl, chartId & tenantId
*/
export declare const getChartUrl: (options: EmbedChartOptions) => string;
/**
* Constructs the dashboard iframe URL from the baseUrl, dashboardId & tenantId
*/
export declare const getDashboardUrl: (options: EmbedDashboardOptions) => string;
export declare const parseCSSMeasurement: (value: unknown) => string | null;
/**
* Returns the background after validation checks
* or default background based on theme if not set
*/
export declare const getBackground: (background: string | undefined, theme: string | undefined, lightBackground: string, darkBackground: string) => string;