@mongodb-js/charts-embed-dom
Version:
JavaScript library for embedding MongoDB Charts
34 lines (33 loc) • 1.23 kB
TypeScript
import Chart from './chart';
import Dashboard from './dashboard';
import type { SharedEmbedOptions, EmbedOptions, EmbedChartOptions, EmbedDashboardOptions, RenderingSpec } from './types';
import { getRealmUserToken } from './realm-auth';
/**
* Creates an instance of the embedding SDK
*/
export default class EmbedSDK {
private defaultOptions;
/**
* Accepts an optional {@link EmbedChartOptions} object to use as the
* default options for any charts created using this SDK instance.
*
* ```js
* const sdk = new EmbedSDK({
* baseUrl: "https://charts.mongodb.com",
* })
* ```
*/
constructor(options: Partial<EmbedOptions>);
/**
* Creates a new {@link Chart} instance that allows you to
* interact with and embed charts into your application
*/
createChart(options: Partial<EmbedChartOptions>): Chart;
/**
* Creates a new {@link Dashboard} instance that allows you
* to embed a dashboard into your application
*/
createDashboard(options: Partial<EmbedDashboardOptions>): Dashboard;
}
export { getRealmUserToken };
export type { Chart, Dashboard, SharedEmbedOptions, EmbedChartOptions, EmbedDashboardOptions, RenderingSpec, };