Skip to content

State

Type class

A named set of setting values, such as "hover", that an element takes on when the state is applied.

More info: Element states

Sources

This information about State is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.

Inheritance

State does not extend any other symbol.

State is not extended by any other symbol.

Settings

Set these settings on a State object using its set() and setAll() methods. Read about settings concept.

State does not have any settings.

Properties

State does not have any properties.

Methods

apply()

Returns void

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.

applyAnimate(duration?: undefined | number)

Returns Animations

Applies the state to its element, animating each setting to its new value. Returns the Animation objects, by setting key.

constructor(entity: E,
settings: Partial
)

Returns State

get(key: Key)

Returns [""]

Returns the state's value for setting key, or fallback if it has none.

More info: Settings

remove(key: Key)

Returns void

Removes setting key from the state.

More info: Settings

set(key: Key,
value: [""]
)

Returns void

Sets the value setting key takes when the state is applied.

setAll(settings: Partial)

Returns void

Sets several of the state's settings at once, from an object of key-value pairs.

More info: Settings

Events

State does not have any events.