import type { Entity, Dirty } from "./Entity"; import type { Animations } from "./Animation"; /** * A named set of setting values, such as `"hover"`, that an element takes on * when the state is applied. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/states/} for more info */ export declare class State { private _entity; _settings: Partial; _userSettings: Dirty; _computedSettings: Dirty; constructor(entity: E, settings: Partial); /** * Returns the state's value for setting `key`, or `fallback` if it has * none. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info * @param key Settings key * @param fallback Value to return if the state has no value * @return Value */ get(key: Key): this["_settings"][Key]; get(key: Key, fallback: F): NonNullable | F; /** * @ignore */ setRaw(key: Key, value: E["_settings"][Key]): void; /** * Sets the value setting `key` takes when the state is applied. * * @param key Setting key * @param value Setting value */ set(key: Key, value: E["_settings"][Key]): void; /** * Writes a value the library worked out itself, without announcing it - used * where a state notes what to return to. * * @ignore */ _setCRaw(key: Key, value: E["_settings"][Key]): void; /** * Same as `set()`, but for a value the library works out itself rather than * one that was asked for. * * The state behaves identically - the value is only additionally flagged as * computed, so that it can be left out when the chart is serialized. * * @ignore * @param key Setting key * @param value Setting value */ _setC(key: Key, value: E["_settings"][Key]): void; /** * Removes setting `key` from the state. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info * @param key Setting key */ remove(key: Key): void; /** * Sets several of the state's settings at once, from an object of * key-value pairs. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/} for more info * @param settings Settings */ setAll(settings: this["_settings"]): void; private _eachSetting; /** * Applies the state to its element at once, without animation. The values * the element had before are kept in its `"default"` state, for going back. */ apply(): void; /** * Applies the state to its element, animating each setting to its new * value. Returns the [[Animation]] objects, by setting key. * * @param duration Duration in milliseconds; `stateAnimationDuration` of the state or element if not given * @return Animations */ applyAnimate(duration?: number): Animations; } /** * The [[State]] objects of an element, by name, such as `"hover"` or * `"hidden"`. * * @see {@link https://www.amcharts.com/docs/v5/concepts/settings/states/} for more info */ export declare class States { private _states; private _entity; constructor(entity: E); /** * Returns the state called `name`, or `undefined` if there is none. * * @param name State name * @return State */ lookup(name: string): State | undefined; /** * Creates the state called `name` with `settings`, or adds `settings` to * it if it already exists. * * @param name State name * @param settings Settings * @return State */ create(name: string, settings: Partial): State; /** * Same as `create()`, but for a state the library sets up itself rather than * one that was asked for. * * The state behaves identically - its settings are only additionally flagged * as computed, so that they can be left out when the chart is serialized. * * @ignore * @param name State name * @param settings Settings * @return New State */ _createC(name: string, settings: Partial): State; /** * Removes the state called `name`. * * @param name State name */ remove(name: string): void; /** * Applies the state called `newState` to the element at once, without * animation. * * @param newState State name */ apply(newState: string): void; /** * Applies the state called `newState` to the element, animating each * setting to its new value. Returns the [[Animation]] objects, by setting * key, or `undefined` if there is no such state. * * @param newState State name * @param duration Duration in milliseconds; `stateAnimationDuration` of the state or element if not given * @return Animations */ applyAnimate(newState: string, duration?: number): Animations | undefined; } //# sourceMappingURL=States.d.ts.map