decorators
import
{
...
}
from
"@motion-canvas/2d/lib/decorators"
;
Classes
-
FiltersSignalContext
Interfaces
-
PropertyMetadata
Type Aliases
CanvasStyleSignal
type
CanvasStyleSignal
T
=
Signal
PossibleCanvasStyle
CanvasStyle
T
Type Parameters
FiltersSignal
type
FiltersSignal
TOwner
=
Signal
Filter
[]
Filter
[]
TOwner
FiltersSignalContext
TOwner
[
K
in
FilterName
]:
SimpleSignal
number
TOwner
Type Parameters
Initializer
type
Initializer
T
=
public
()
Type Parameters
Vector2LengthSignal
Type Parameters
Functions
addInitializer
public
addInitializer
T
target
:
any
initializer
:
Initializer
T
:
void
Type Parameters
Parameters
-
target : any -
initializer : Initializer T
canvasStyleSignal
public
canvasStyleSignal
():
PropertyDecorator
cloneable
Create a cloneable property decorator.
This decorator specifies whether the property should be copied over whencloning the node.
By default, any property is cloneable.
Must be specified before the
signal
decorator.
Examples
Type Parameters
Parameters
-
value : boolean = trueWhether the property should be cloneable.
colorSignal
public
colorSignal
():
PropertyDecorator
compound
public
compound
entries
:
Record
string
string
:
PropertyDecorator
Create a compound property decorator.
This decorator turns a given property into a signal consisting of one or morenested signals.
Examples
Parameters
-
entries : Record string stringA record mapping the property in the compound object to thecorresponding property on the owner node.
computed
public
computed
():
MethodDecorator
Create a computed method decorator.
This decorator turns the given method into a computed value.See
createComputed
for more information.
defaultStyle
Type Parameters
Parameters
filtersSignal
public
filtersSignal
():
PropertyDecorator
getPropertiesOf
public
getPropertiesOf
value
:
any
:
Record
string
PropertyMetadata
any
Parameters
-
value : any
getPropertyMeta
Type Parameters
Parameters
getPropertyMetaOrCreate
Type Parameters
Parameters
initial
Create an initial signal value decorator.
This decorator specifies the initial value of a property.
Must be specified before the
signal
decorator.
Examples
Type Parameters
Parameters
initialize
Parameters
initializeSignals
Parameters
inspectable
Create an inspectable property decorator.
This decorator specifies whether the property should be visible in theinspector.
By default, any property is inspectable.
Must be specified before the
signal
decorator.
Examples
Type Parameters
Parameters
-
value : boolean = trueWhether the property should be inspectable.
interpolation
Create a signal interpolation function decorator.
This decorator specifies the interpolation function of a property.The interpolation function is used when tweening between different values.
Must be specified before the
signal
decorator.
Examples
Type Parameters
Parameters
parser
Create a signal parser decorator.
This decorator specifies the parser of a property.Instead of returning the raw value, its passed as the first parameter to theparser and the resulting value is returned.
If the wrapper class has a method called
lerp
it will be set as thedefault interpolation function for the property.
Must be specified before the
signal
decorator.
Examples
Type Parameters
Parameters
-
value : public ()The wrapper class for the property.
signal
public
signal
T
():
PropertyDecorator
Create a signal decorator.
This decorator turns the given property into a signal.
The class using this decorator can implement the following methods:
-
get[PropertyName]- A property getter. -
get[PropertyName]- A property setter. -
tween[PropertyName]- A tween provider.
Examples
Type Parameters
vector2Signal
public
vector2Signal
prefix
?:
string
Record
string
string
:
PropertyDecorator
Parameters
-
prefix ?: string Record string string
wrapper
Create a signal wrapper decorator.
This is a shortcut decorator for setting both the
parser
and
interpolation
.
The interpolation function will be set only if the wrapper class has a methodcalled
lerp
, which will be used as said function.
Must be specified before the
signal
decorator.