import { Settings } from "../util/Entity";
import { Container, IContainerSettings, IContainerPrivate, IContainerEvents } from "./Container";
import { ListData } from "../util/Data";
import type * as $ease from "../util/Ease";
import type { Bullet } from "./Bullet";
import { Sprite } from "./Sprite";
/**
* One item of a [[Component]]'s data, holding its values and settings.
*/
export declare class DataItem
extends Settings {
_settings: P;
/**
* The [[Component]] the data item belongs to.
*/
component: Component;
/**
* The object in the source data this data item was made from.
*/
dataContext: unknown;
/**
* Bullets shown for this data item.
*/
bullets: Array | undefined;
/**
* Start of the base interval each date field's value falls in, by field.
* Set by a [[DateAxis]].
*/
open: {
[index: string]: any;
} | undefined;
/**
* End of the base interval each date field's value falls in, by field.
* Set by a [[DateAxis]].
*/
close: {
[index: string]: any;
} | undefined;
constructor(component: Component, dataContext: unknown, settings: P);
/**
* @ignore
*/
markDirty(): void;
/**
* @ignore
*/
_markDirtyKey(key: Key): void;
_startAnimation(): void;
protected _animationTime(): number | null;
protected _dispose(): void;
/**
* Shows the data item.
*
* @param duration Animation duration in milliseconds
*/
show(duration?: number): void;
/**
* Hides the data item.
*
* @param duration Animation duration in milliseconds
*/
hide(duration?: number): void;
/**
* Returns `true` if the data item is hidden.
*/
isHidden(): boolean;
}
export interface IComponentDataItem {
visible?: boolean;
}
export interface IComponentSettings extends IContainerSettings {
/**
* Duration in milliseconds of the animation from old values to new ones,
* e.g. when data changes.
*
* @see {@link https://docs.amcharts.com/v5/concepts/animations/#animating-data-values} for more info
* @default 0
*/
interpolationDuration?: number;
/**
* Easing function of the animation from old values to new ones.
*
* @see {@link https://docs.amcharts.com/v5/concepts/animations/#easing-functions} for more info
*/
interpolationEasing?: $ease.Easing;
}
export interface IComponentPrivate extends IContainerPrivate {
}
export interface IComponentEvents extends IContainerEvents {
/**
* The component's data changed and was processed.
*/
datavalidated: {};
/**
* Values of the component's data items changed.
*/
valueschanged: {};
}
/**
* Base class for elements that use data.
*/
export declare abstract class Component extends Container {
static className: string;
static classNames: Array;
_settings: IComponentSettings;
_privateSettings: IComponentPrivate;
_dataItemSettings: IComponentDataItem;
_events: IComponentEvents;
/**
* The layer name an SVG document gives `sprite`, an element shown for one
* of this component's data items.
*
* @ignore
*/
_dataItemName(_dataItem: DataItem, _sprite: Sprite): string | undefined;
protected _data: ListData;
protected _dataItems: Array>;
_mainDataItems: DataItem[];
protected valueFields: Array;
protected fields: Array;
protected _valueFields: Array;
protected _valueFieldsF: {
[index: string]: {
fieldKey: string;
workingKey: string;
};
};
protected _fields: Array;
protected _fieldsF: {
[index: string]: string;
};
_valuesDirty: boolean;
protected _dataChanged: boolean;
protected _dataGrouped: boolean;
/**
* Rows at the start of the data unchanged since it was last grouped; -1
* after a change anywhere but the end.
*
* @ignore
*/
_groupKeptRows: number;
/**
* Rows taken off the start of the data since it was last grouped.
*
* @ignore
*/
_groupDroppedRows: number;
/**
* Changes to the rows other than one added at the end, taken off the start
* or given new values.
*
* @ignore
*/
_rowsRewritten: number;
/**
* Rows taken off the start of the data.
*
* @ignore
*/
_rowsDropped: number;
protected _afterDataChangeQueued: boolean;
/**
* Becomes `true` after the component's first update.
*/
inited: boolean;
/**
* The component's data: a list of data objects, each made into a data
* item.
*
* @see {@link https://docs.amcharts.com/v5/concepts/data/} for more info
*/
set data(data: ListData);
/**
* @return Data
*/
get data(): ListData;
protected _dispose(): void;
protected _onDataClear(): void;
protected _afterNew(): void;
protected _queueAfterDataChange(data: ListData): void;
protected _rowsPushed(data: ListData, rows: Array): void;
protected _processTemplateFields(dataItem: DataItem): void;
protected _postUpdateData(): void;
/**
* Updates the data in place, keeping the existing data items: each object's
* values go into the data item at the same index. Extra objects are added
* as new data items, and data items beyond the new data are removed.
*
* @param data New data
*/
updateData(data: Array): void;
protected _updateFields(): void;
/**
* The component's data items.
*
* @return Data items
*/
get dataItems(): Array>;
protected processDataItem(_dataItem: DataItem): void;
_makeDataItem(data: unknown): this["_dataItemSettings"];
protected _fieldsResolved?: {
valueKeys: Array;
valueFields: Array;
workingKeys: Array;
keys: Array;
fields: Array;
};
/**
* Each value key's and field key's data field name, e.g. `valueY` > `"close"`.
*
* @ignore
*/
_resolveFields(): {
valueKeys: string[];
valueFields: string[];
workingKeys: string[];
keys: string[];
fields: string[];
};
/**
* Creates and processes a data item, without adding it to `dataItems`.
*
* @param data Data item settings
* @param dataContext Object to use as the data item's `dataContext`
* @return New data item
*/
makeDataItem(data: this["_dataItemSettings"], dataContext?: any): DataItem;
/**
* Creates a data item straight from settings, not from data, and adds it
* to the component's data items.
*
* @param data Data item settings
* @param dataContext Object to use as the data item's `dataContext`
* @return New data item
*/
pushDataItem(data: this["_dataItemSettings"], dataContext?: any): DataItem;
/**
* @ignore
*/
disposeDataItem(_dataItem: DataItem): void;
/**
* Shows a data item.
*
* @param dataItem Data item
* @param _duration Animation duration in milliseconds
* @return Promise
*/
showDataItem(dataItem: DataItem, _duration?: number): Promise;
/**
* Hides a data item.
*
* @param dataItem Data item
* @param _duration Animation duration in milliseconds
* @return Promise
*/
hideDataItem(dataItem: DataItem, _duration?: number): Promise;
_clearDirty(): void;
protected _afterDataChange(): void;
_afterChanged(): void;
/**
* Makes the component redraw from its data on the next frame.
*
* @since 5.0.21
*/
markDirtyValues(_dataItem?: DataItem): void;
_markDirtyGroup(): void;
/**
* A setting of one of the component's data items changed.
*
* @ignore
*/
_dataItemKeyChanged(_dataItem: DataItem, _key: string): void;
/**
* @ignore
*/
markDirtySize(): void;
/**
* Returns the data item whose `id` matches, if any.
*
* @param id ID
* @return Data item
*/
getDataItemById(id: string): DataItem | undefined;
}
//# sourceMappingURL=Component.d.ts.map