import type { Entity } from "../core/util/Entity"; import type { Theme } from "../core/Theme"; import { Root } from "../core/Root"; declare const BaseElement: typeof HTMLElement; /** * Details of the element's `ready` event. * * @since 5.21.0 */ export interface IChartElementReadyEvent { /** * The chart's root element. */ root: Root; /** * What the config built: usually the chart. */ chart: Entity; } /** * The events of ``. * * @since 5.21.0 */ export interface IChartElementEventMap { /** * The chart is built. */ ready: CustomEvent; /** * The chart could not be built; `detail` has the error. */ error: CustomEvent; } /** * A chart as an HTML element: ``, built from a JSON config. * * ```html * * ``` * * The config is given with the `config` attribute or property (an object or * a JSON string), or loaded from a URL with `src`. Themes are not part of a * config: set them with the `themes` property (theme classes), or with the * `themes` attribute (names, for the script version, where each theme is a * global). `renderer="svg"` draws the chart as SVG. * * With script tags, load `index.js`, `plugins/json.js` and `element.js`, and * then the chart types the config uses, e.g. `percent.js`. * * The element dispatches `ready` when the chart is built, with `root` and * `chart` in its `detail`, and `error` when it could not be. A config given * in the page can be built before a script adds its listener: `whenReady()` * works whenever it is called. * * Without a height of its own, from CSS or its parent, the element is 400 * pixels high. * * @see {@link https://www.amcharts.com/docs/v5/getting-started/integrations/am5-chart-element/} for more information * @see {@link https://www.amcharts.com/docs/v5/concepts/serializing/} for the config format * @since 5.21.0 */ export declare class ChartElement extends BaseElement { /** * @ignore */ static get observedAttributes(): Array; /** * The chart's root element, once it is built. */ root: Root | undefined; /** * What the config built, usually the chart, once it is built. */ chart: Entity | undefined; protected _config: object | string | undefined; protected _themes: Array | undefined; protected _container: HTMLDivElement | undefined; protected _build: number; protected _scheduled: boolean; protected _pending: boolean; protected _abort: AbortController | undefined; protected _sizer: ResizeObserver | undefined; protected _ready: Promise | undefined; protected _settle: { resolve: (value: IChartElementReadyEvent) => void; reject: (error: unknown) => void; } | undefined; /** * Returns a promise of the built chart. It resolves at once if the chart * is already built, or once it is, and rejects if the build fails or the * element is removed first. A new config makes a new chart and a new * promise. * * @return Promise of the root and the chart */ whenReady(): Promise; protected _resolve(detail: IChartElementReadyEvent): void; protected _reject(error: unknown): void; /** * The chart's JSON config: an object, or a JSON string. Setting it builds * the chart again. */ get config(): object | string | undefined; set config(value: object | string | undefined); /** * Themes for the chart, as theme classes, e.g. `[am5themes_Animated]`. * Setting them builds the chart again. */ get themes(): Array | undefined; set themes(value: Array | undefined); addEventListener(type: K, listener: (this: ChartElement, event: IChartElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: K, listener: (this: ChartElement, event: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ChartElement, event: IChartElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: K, listener: (this: ChartElement, event: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; /** * @ignore */ connectedCallback(): void; /** * @ignore */ disconnectedCallback(): void; /** * @ignore */ attributeChangedCallback(name: string, previous: string | null, value: string | null): void; protected _size(): void; protected _stopSizer(): void; protected _dispose(): void; protected _rebuild(): void; protected _make(): void; protected _load(): Promise; protected _themeClasses(): Array; } /** * Registers ``, or the element under another name. Loading the * module does this already; call it for a different name. * * @param name Element name, with a hyphen in it * @since 5.21.0 */ export declare function defineChartElement(name?: string): void; export {}; //# sourceMappingURL=ChartElement.d.ts.map