Settings
Type class
Base class for objects with settings, such as Entity.
More info: Settings
Sources
This information about Settings is provided for reference only and is not available through exported packages and thus should not be imported or used on its own.
Inheritance
Settings does not extend any other symbol.
Settings is extended by DataItem, Entity.
Properties
enableDisposeType
booleanDefaulttrueSet to
falseto makedispose()do nothing.uidType
numberDefault++counterA unique number, given to each object as it is created.
Methods
animate(options:AnimationOptions)Returns
AnimationAnimates a setting from its current value (or
from) toto. The setting jumps tofromat once. Withduration0, or no value to start from, it is set totoat once and the returned animation is already stopped.More info: Animations: animating settings
constructor(settings:ISettingsSettings)Returns
Settingsdispose()Returns
voidDisposes the object, freeing everything it holds. A disposed object can't be used again.
get(key:Key,
fallback:F)Returns
NonNullable|FReturns the value of setting
key, orfallbackif it is not set.More info: Settings
has(key:Key)Returns
booleanReturns
trueif settingkeyis set.More info: Settings
isDisposed()Returns
booleanReturns
trueif the object has been disposed.off(key:Key,
callback?:undefined| (value:[""], target:this, key:Key) =>void)Returns
voidSince 5.9.2Removes a callback added with
on(). Withoutcallback, removes all of them forkey.More info: Events: settings value change
offDebounced(key:Key,
callback?:undefined| (value:[""], target:this, key:Key) =>void)Returns
voidRemoves a callback added with
onDebounced(). Withoutcallback, removes all of them forkey.More info: Events: settings value change
offDebouncedPrivate(key:Key,
callback?:undefined| (value:[""], target:this, key:Key) =>void)Returns
voidRemoves a callback added with
onPrivateDebounced(). Withoutcallback, removes all of them forkey.More info: Events: settings value change
offPrivate(key:Key,
callback?:undefined| (value:[""], target:this, key:Key) =>void)Returns
voidSince 5.9.2Removes a callback added with
onPrivate(). Withoutcallback, removes all of them forkey.More info: Events: settings value change
on(key:Key,
callback: (value:[""], target:this, key:Key) =>void)Returns
IDisposerCalls
callbackeach time the value of settingkeychanges or is removed. Setting the same value again does not call it.More info: Events: settings value change
once(key:Key,
callback: (value:[""], target:this, key:Key) =>void)Returns
IDisposerSince 5.20.4Like
on(), but the callback is removed after it is called once.More info: Events: settings value change
onceDebounced(key:Key,
callback: (value:[""], target:this, key:Key) =>void,
debounceDelay:number)Returns
IDisposerSince 5.20.4Like
onDebounced(), but the callback is removed after it is called once.More info: Events: settings value change
onDebounced(key:Key,
callback: (value:[""], target:this, key:Key) =>void,
debounceDelay:number)Returns
IDisposerLike
on(), but waits until settingkeyhas not changed fordebounceDelaymilliseconds, then callscallbackonce with the latest value.More info: Events: settings value change
onPrivate(key:Key,
callback: (value:[""], target:this, key:Key) =>void)Returns
IDisposerCalls
callbackeach time the value of private settingkeychanges.More info: Events: settings value change
onPrivateDebounced(key:Key,
callback: (value:[""], target:this, key:Key) =>void,
debounceDelay:number)Returns
IDisposerLike
onPrivate(), but waits until private settingkeyhas not changed fordebounceDelaymilliseconds, then callscallbackonce with the latest value.More info: Events: settings value change
remove(key:Key)Returns
voidRemoves the value of setting
key.More info: Settings
removeAll()Returns
voidRemoves all settings, as
remove()does for each one.More info: Settings
set(key:Key,
value:Value)Returns
ValueSets setting
keytovalueand returnsvalue. Stops any animation of that setting.More info: Settings
setAll(settings:Partial)Returns
voidSets several settings at once, from an object of key-value pairs.
More info: Settings
Events
Settings does not have any events.